Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [stty]

"stty" command sets the options of terminal (tty).

0
votes
0answers
45 views

login with rsh having zero size terminal (stty)

I've received a very peculiar problem all of sudden to the Linux hosts while doing rsh to them from a remote site and them opening a file it returns the file opened very limited on the terminal saying ...
0
votes
0answers
23 views

Start PyGame on /dev/tty1 from a SSH session (can't access the framebuffer via SSH)

I have a small touchscreen attached to a Raspberry Pi, and when I start a Python script via an attached keyboard, directly on /dev/tty1, this script is able to execute pygame.display.init() ...
1
vote
0answers
101 views

How to enable/disable stty settings?

I'm on linux using bash with GNOME Terminal. I used the command stty -ixon and then I checked if ctrl-s was sending XOFF and ctrl-q was sending XON : they weren't. The problem is that by using stty -...
1
vote
1answer
42 views

GPIO board read/write via bash

Trying to get a GPIO board working, need to access it from script, here is what I am using: stty -F /dev/ttyACM1 115200 raw -echo #CONFIGURE SERIAL PORT exec 3</dev/ttyACM1 #...
0
votes
3answers
53 views

Is there a way I can tab between screens without pressing ctrl-a tab every time?

Essentially I just want to press Ctrl+Tab, not Ctrl+A then Tab. I don't believe this can be accomplished with an alias, but have read some stuff about maybe using stty? But I've never used stty and ...
-1
votes
1answer
325 views

How to resize TTY console width?

I'm on FreeBSD. I want to set console width (just console, not ssh or telnet). I used this command: stty cols 132 Is this work for just console or worked for all of the connections (console, ssh ...
0
votes
0answers
149 views

Difference between eof=^A and eof=^D of stty command

I would like to know the difference between eof=^A and eof=^D which will be displayed when stty -a command is given. Also is there any command to change it from eof=^A to eof=^D?
1
vote
0answers
19 views

Data loss over ttyACM* in Ubuntu 14.04 whereas success on Ubuntu 16.04 when “cat” command is used [duplicate]

I have a development board which will have 3 ACM interfaces when connected to Ubuntu host and i want to transfer data from Host to Device over ttyACM3. I have followed the following procedure for ...
1
vote
0answers
28 views

PING token missed after un-successful Bulk OUT transfer

I'm trying to send a large amount of data(~15 Mb) from Host to Device over ttyACM3. I have used "cat" command for sending the data from host. Host side: cat ./pattern.bin > /dev/ttyACM3 Device ...
2
votes
0answers
158 views

Data loss over ttyACM* when 'cat' command is used for data transfer

I have a development board which will have 3 ACM interfaces when connected to Ubuntu host and i want to transfer data from Host to Device over ttyACM3. I have followed the following procedure for ...
1
vote
0answers
58 views

Strange serial port behaviour on Raspberry PI

I'm trying to receive serial data on a Raspberry Pi through the GPIO15(RXD) pin. I have the following python script: serPort = serial.Serial("/dev/ttyAMA0", baudrate=2400) while True: rcv = ord(...
0
votes
0answers
217 views

How to configure Telit LE910-NAG serial ports to use them with cat?

We are using the 3G modem Telit LE910-NAG (I'm aware that it is not recommended for new development but for now I cannot change it). I’m using it on a Linux OpenWRT platform. I followed the direction ...
1
vote
1answer
253 views

troubleshooting serial settings through stty

Hardware PHYTEC Mira Board with i.MX6 Processor Operating System Yocto Image created using the BSP provided by PHYTECSource with minimal packages in it. The board has an UART board called UART3 ...
1
vote
1answer
357 views

Starting multiple Screen windows from shell script uses wrong configuration

When running Screen, I can use Ctrl+ac to create a new window and run vim in each window. Also from Screen, I can run the command screen vim multiple times to open new windows with vim already running....
1
vote
1answer
757 views

What does the “opost” stty flag do?

The documentation says the following: [-]opost postprocess output I don't understand what this means. I have tried to disable this flag to see what it does: stty -opost -F /dev/pts/0 And I have ...
4
votes
1answer
850 views

Confused about the “onlcr” stty flag

In the stty documentation, the following is mentioned: [-]icrnl translate carriage return to newline [-]inlcr translate newline to carriage return * [-]ocrnl translate ...
1
vote
2answers
196 views

Explanation of stty parameters not found in man page

I have some old code that was written in java for interfacing with a serial port that I'm attempting to convert to python. The following lines are found in a bash file that is run to setup the serial ...
1
vote
1answer
275 views

gnome-terminal issue related to tty configuration

I'm facing an strange issue, I'll add a photo since is better to explain what's happening As you can see. After using git log and exit (either pressing q or Q or :q or ^C), I'm not able to use more ...
1
vote
1answer
716 views

How to inhibit serial reception during serial writes for a RS485 (half-duplex) serial line

I have an app that expects to do I/O over a full-duplex serial line. That is: char buf[4]; write(fd, "ping", 4); read(fd, buf, 4); ... expects to end up with whatever four bytes the remote device ...
1
vote
0answers
1k views

Restoring tty correctly with stty

I'm writing a bash script to read some user input (like a password request), and I'd like to capture the result and pass it through its stdout. (I'm working in a GNU/Linux environment, with recent ...
3
votes
1answer
494 views

What are the implications of setting the baud rate of a terminal from userspace?

Sometimes I just need to read from a serial device, so I skip the complexities of minicom or screen and just cat. However, this only works if I first set the baud rate of the terminal using stty <...
1
vote
0answers
1k views

Configuring the serial port on Ubuntu to communicate with a Betaflight board

I'm trying to get my Java flight data acquisition program, which runs on a single-board computer with Lubuntu 16.04, to talk to the Betaflight Nero F7 IMU sensor board, which is connected to the SBC ...
2
votes
1answer
284 views

Why changing tty settings on one file descriptor affects another?

ECHO setting is enabled on stdin and stdout by default. But why if we disable ECHO on stdin, it is also disabled on stdout? They have two separate descriptors - 0 and 1, so why they are changed ...
12
votes
1answer
636 views

Why are two ^D presses necessary to exit `cat`? [duplicate]

Let's run cat and then type a then ^D - you will see that cat did not exit. Compare it with cat + a + Enter + ^D - now cat did exit. So, why two ^D presses are necessary to exit cat in the first ...
2
votes
1answer
217 views

How can one override bash Ctrl+C to be more fish-like

I find myself using bash more often than not on remote machines even though fish is my preferred shell. Fish has small, but nice feature that when you hit Ctrl+C something like this happens: if ...
0
votes
1answer
510 views

Set terminal TTY line settings while a process is running

When I need to configure terminal line settings when the terminal shell is available, I use stty. When I attach a debugger to a process that's running curses, the current tty settings get in the way ...
3
votes
1answer
729 views

terminfo disable XON/XOFF

I can disable XON/XOFF flow control: stty -ixon So I put this in my "~/.profile". However I have started making my own terminal with "terminfo" and "tic", and I noticed these options: xon_xoff ...
3
votes
1answer
221 views

Terminal shows garbled characters with same settings as other terminal showing correct characters

I have vim setup with NerdTree on a remote machine. I have two local machines. When I ssh to remote machine from one of the local machines (say A), it displays all the symbols in NerdTree correctly. ...
3
votes
1answer
178 views

The effect of `stty --file=<terminal> <flag>` is only temporary for consoles in bash. Why?

Open two consoles / X terminals. From one, which is attached to say /dev/tty1 (Linux console) or /dev/pts/0 (X terminal), run $ stty -echo. (Now echoing to keyboad is turned off.) Then from the other, ...
2
votes
1answer
515 views

use stty command to enable remapping ctrl+v

Searching around, I found that stty -ixon enables remapping of C-q and C-s(such as in ~/.inputrc). Now I also want to remap C-v(to paste-from-clipboard, the default S-Ins feels awkward). With stty -...
3
votes
2answers
671 views

What is the equivalent of “stty -echo” for zsh?

I can hide what is written in a terminal with bash with stty -echo This is however not working for zsh: running this command does not change the output of stty -a What is the equivalent command ...
2
votes
1answer
32 views

Deactivate DCS contol character

Esoteric characters in filenames sometimes lead to weird errors. I recently backed up files with rsync, noticing that some minutes into the process, all status output stopped. Investigating further, I ...
0
votes
1answer
318 views

serial DMA pausing after 2048 bytes

I have a sama5d36 device running Debian jessie (kernel 4.1.10) with a DMA USART. To get the DMA USART to output correctly I had to turn off ECHO and ONLCR. stty -F /dev/ttyS2 -echo -onlcr speed ...
3
votes
2answers
2k views

How to monitor a serial connection @ 250000 baud?

I wish to directly monitor the serial-over-usb connection to my 3d printer, which runs at 250000 baud. e.g I might monitor it with cat /dev/ttyUSB0 However first I need to set the baud rate, e.g ...
0
votes
2answers
106 views

changing the behaviour of control signals at startup

I am trying to change the default behavior of the control signals with stty. Signals like Ctrl+C, Ctrl+D, Ctrl+Z, Ctrl+\. Can any one give me idea about how to disable and enable these signals on ...
3
votes
1answer
325 views

How can I rebind stty lnext to ^q?

You can type characters literally by using the "lnext" functionality (often ^V per default) in your tty driver However, I bind Ctrl+v to "paste" in my terminal emulator. (Since I don't use control ...
1
vote
1answer
308 views

VIM replaces backspace with ^?

Whenever I type backspace in VIM the editor inserts ^?. I've edited .vimrc to have set backspace=indent,eol,start and it didn't work. set backspace=2 Didn't work either. I've read that you need to ...
1
vote
1answer
276 views

Key other than Control to send SIG*?

I'd like to swap Ctrl & Super so that I can use the physical super/meta key for copy/paste/select-all/find/etc. without application-specific configuration, which often doesn't exist. However, I'd ...
1
vote
1answer
981 views

stty on old AT&T unix: how to add End-key for “end of line”?

How I can use the ctrl+e keyboard combination in emacs mode to go to the end of the line, but also be able to use the End key to do the same? How do I set that with stty? I have tried this combination ...
0
votes
2answers
502 views

Gap between two characters writing message over RS485

I am using an ATMEL embedded controller (at91sam9x25e) and its serial port to send/receive over RS485 Modbus RTU. Normal communication works fine, but sometimes - when writing - some packages are ...
2
votes
1answer
143 views

How to prevent garbled screen display while running scripts on remote hosts?

Current scenario: I am trying to run Unix shell script from a Solaris 5.10 box, within the script one of the tasks is to ssh to another Linux host (ssh-key pair already setup) and run a set of ...
2
votes
2answers
3k views

Understanding Return, Enter, and stty icrlf

In Ubuntu/gnome-terminal, if I run: $ stty -icrnl Then launch the GHC interactive environment (a Haskell console): $ ghci Then pressing Return does not submit the line; however, Enter does. ...
2
votes
1answer
891 views

How to prevent CTS from toggling each time a tty is opened or closed?

Each time I open() or close() a tty device file, the RTS line of the port is toggled off for a moment. This seems to happen even when hardware flow control is disabled with raw -crtscts. Is there ...
6
votes
1answer
1k views

How to have type-ahead apply to bash history search (Ctrl-R)?

Context Typeahead in bash: good When a bash shell is busy (initializing, running a command), one can type before the next prompt appears. If the shell has launched a program, that program will ...
5
votes
1answer
524 views

Why do the terminal attributes look different from outside the terminal?

If I open up a terminal (xfce4-terminal 0.6.3, but I doubt it matters) and I look at what terminal attributes are set (BASH is running in the terminal), $ stty -a speed 38400 baud; rows 24; columns ...
0
votes
1answer
110 views

Bind C-j to backward-kill-word, says command not found

bind -x '"\C-j": backward-kill-word' says, backward-kill-word: command not found As mikeserv quoted here, i am able to do backward-kill-word using Ctrl-w. However this is the same key i use in ...
4
votes
1answer
21k views

Sending serial commands with echo vs screen session

I have a small LED matrix controlled by a display driver that accepts serial commands to update the display. I'm successfully controlling it via node with the node serial package, however I'd like to ...
1
vote
1answer
131 views

stty doesn't display backward-delete-word shortcut

stty -a shows, speed 38400 baud; rows 39; columns 143; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt ...
6
votes
2answers
2k views

Why does the terminal echo keystrokes when commands are running?

I was recently running tail -f on a log file of a server that was running, trying to diagnose a bug, when I accidentally bumped the keyboard and typed some characters. They got mixed in with the ...
14
votes
3answers
11k views

How are terminal length and width forwarded over SSH and telnet?

When I view the length and width of my terminal emulator with stty size then it is 271 characters long and 71 lines tall. When I log into another server over SSH and execute stty size, then it is also ...