Questions tagged [stty]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
22 views

Reasons for stty -tostop having no effect [duplicate]

I am trying to get a background process to print to the terminal. I haven't seen anything that otherwise indicates there is anything else to do besides stty -tostop. Am I missing something? Running ...
Sterling Butters's user avatar
0 votes
1 answer
62 views

why doesn't the stty setting onlcr add a carriage return?

TLDR - I have onlcr configured in my terminal, but I don't see the \r getting added If plug two FTDI serial converters together, and plug them both into my computer, I get two ports called /dev/...
Alex028502's user avatar
1 vote
1 answer
130 views

Send and trap SIGTTIN SIGTTOU in foreground process?

From the description of signals (reference), it seems like SIGTTIN and SIGTTOU are sent to a process only if it is in background. Pressing Ctrl-s does stop printing in terminal, if such flow control ...
codepoet's user avatar
  • 566
0 votes
1 answer
112 views

Why can bash not to follow stty settings?

From an answer to one my previous question I learned that shells (such as bash) have an ability not to follow the rules of terminal input processing set by stty(1). In particular, they can operate in ...
Ilya Loskutov's user avatar
0 votes
1 answer
46 views

Why erase and kill characters do the same thing?

Among the stty -a settings on my machine there are such as erase = ^?; kill = ^U;. The man page reports that erase CHAR CHAR will erase the last character typed kill CHAR ...
Ilya Loskutov's user avatar
1 vote
0 answers
143 views

Enable tmux detached non-interactive session to run stty without "input/output error"

I'm trying to launch a MineCraft server at startup of an AWS EC2 instance running Amazon Linux. For convenience, I used tmux to start a detached session, so I could ssh in to the box and connect to ...
ErikE's user avatar
  • 119
0 votes
1 answer
138 views

Working with file descriptors in the (bash) shell?

I came across the following set of shell commands for reading and writing to serial ports, from this thread: stty -speed 19200 < /dev/ttyS0 # sets the speed of the port exec 99<>/dev/ttyS0 (...
First User's user avatar
0 votes
0 answers
20 views

How can I remap crtl-z? [duplicate]

I have several keys remapped successfully, but ctrl-z is being stubborn.. I can get these to work: stty susp undef bind '"\C-f": undo' bind '"\C-Z": undo' ..but not: bind '"\...
alchemy's user avatar
  • 547
0 votes
1 answer
625 views

force stty -echo for all ssh users

I would like to disable TTY echoing for all users that are connecting via SSH. The Linux command stty -echo does the trick, however instead of users having to execute this command on their TTY I would ...
Evyatar Saias's user avatar
1 vote
1 answer
354 views

strange 5-characters-sequence appear in PuTTY terminal with mouse click

While running some program (Configure), my terminal will be messed up. My typing is not shown. I can use "stty sane" to fix it but I notice that whenever I click my mouse on the terminal (I ...
some user's user avatar
  • 219
1 vote
1 answer
572 views

How to disable Ctrl+S in terminal applications started from file manager or via shortcut?

I've successfully disabled Ctrl+S in terminal using instructions here. However, if I launch a terminal programs (namely terminal vim) from "outside the terminal", Ctrl+S still freezes the ...
demiaus's user avatar
  • 13
0 votes
1 answer
725 views

timeout stty hangs

I don't understand why the behavior of executing the following script: $ cat z.sh saved_stty=$(stty -g) echo "saved_stty: ${saved_stty}" stty "${saved_stty}" $ ./z.sh saved_stty: ...
Martin Raszyk's user avatar
2 votes
0 answers
38 views

Disabling user I/O during loop (temporarily)

I have a shell script that backs up my git repos that are all saved in one specific file. I wanted to add a cool "spinning load thingy" just for fun and that's pretty simple. The problem is ...
lua_python_java's user avatar
2 votes
1 answer
1k views

Serial flow control issue with ttyUSB0

This is related to a previous thread I created about a month ago and which was answered. Today I am attempting to setup a serial console login prompt on a laptop running Ubunutu 20 with a Belkin ...
Albert Elmore's user avatar
1 vote
1 answer
193 views

disable terminal werase setting only in interactive mode in bash

I want to bind C^w to a non-default action in bash, but it requires disabling werase in the terminal. This, unfortunately, affects other programs launched by bash, especially my ssh sessions: when I ...
basin's user avatar
  • 1,941
3 votes
1 answer
558 views

Does XON/XOFF flow control transmit through multiple terminal session hops?

The puzzle I am trying to solve for is where larger outputs of text eventually fall apart into scrambled text. For context I am working on an older machine (EPSON PX-8) connected to Pi3 over RS232 ...
Albert Elmore's user avatar
2 votes
1 answer
224 views

How are characters encoded in stty's output?

I ran stty --all on a terminal which had been reconfigured by a badly behaved process which exited before putting my terminal back to its original settings. Part of the output reads: eol = M-^?;. What ...
Void Star's user avatar
  • 125
1 vote
0 answers
247 views

Strange Cygwin terminal behaviour with trap and stty -echo

If I exit the script with Ctrl+C during the read ... command, the stty -echo mode is stuck! (I'm using the Cygwin terminal on Windows 10.) Unfortunately read -s won't solve my problem as it is "...
user's user avatar
  • 339
0 votes
2 answers
700 views

screen /dev/pts/<num> of a VM never has correct stty settings

A virtual machine (using linux+kvm+qemu) is setup to provided a serial port for a terminal, which is made available via a pseudo-terminal, some random /dev/pts/<number> I use screen as a way to ...
fraleone's user avatar
  • 747
0 votes
1 answer
884 views

How does `stty -echo; cat -v; stty echo` work to echo special keys?

stty -echo; cat -v; stty echo is a technique to see what key you send to terminal. But I just wonder how this command work? When I remove stty -echo it will print twice what you typed in. I know stty -...
Daniel Lin's user avatar
0 votes
1 answer
360 views

reset command over serial connection setting clocal to -clocal

I have a connection from my debian computer to a device with debian linux on it. If I type the reset command on the serial commandline the clocal will be set to -clocal. I search the internet why, but ...
svanschu's user avatar
2 votes
1 answer
2k views

zsh: Why do I get suspended background processes even when I have `stty -tostop`?

I like my background processes to freely write to the tty. stty -tostop is already the default in my zsh (I don't know why, perhaps because of OhMyzsh?): ❯ stty -a |rg tostop ...
HappyFace's user avatar
  • 1,493
0 votes
1 answer
884 views

Hard-set (NOT resize/reset) stty rows/columns in ~/.profile, ~/.bashrc, grub.cfg?

When I PuTTy in, I typically: "stty rows 48 columns 240" after login. I'm after a single-line/entry, in .profile or .bashrc or even grub.cfg to hard-set stty cols/rows If this requires a ...
Gus.Gilliland's user avatar
0 votes
0 answers
1k views

Garbled serial console output even with correct baud rate

I'm trying to connect to a headless NAS box via serial console, and have reached a wall that even Google can't seem to help with. I have a USB to 3.5mm serial cable, with the USB end going into my ...
Wuubb's user avatar
  • 1
0 votes
1 answer
3k views

Press ENTER to continue

I want to know if there is any way to make my script stop until the user hits the Enter key, but without using the command read, just by the options of stty. I was wondering a code for this and got ...
Regis Barbosa's user avatar
0 votes
1 answer
423 views

Why output from `stty -a < /dev/pts/0` on pts/1 is different than `stty -a` on pts/0? [duplicate]

If I type stty -a on pts/0, it shows icanon among other flags, which is expected. However, if I run stty from a terminal which is not the controlling terminal of the (bash) shell that I am currently ...
QnA's user avatar
  • 535
-1 votes
1 answer
489 views

Prevent the terminal changing size for a program that understands terminal size changes over SSH

We are using a text based program through SSH. The session is started with a login script, which does a bit of setup then starts the program without a shell. It works well in putty. We are trying to ...
Csaba Mihaly's user avatar
3 votes
0 answers
246 views

Why does CTRL-C work in one user account but not another?

I have a bash script which is supposed to run a command every X seconds, until the operator interrupts it. Like this: test.sh #!/bin/bash while true; do echo Doing a thing... sleep 3 & ...
goldPseudo's user avatar
1 vote
1 answer
17k views

How to send and receive data from serial port using command line?

In the past, I have used c++ and python to communicate with serial ports in a Linux and Windows environment. In Linux, I have also used programs like picocom, minicom, and cutecom for serial ...
Smetronic's user avatar
0 votes
1 answer
63 views

How do I generate a particular (named) escape sequence for the current terminal?

I recently saw a trick that let you sort of "generically" output terminal control codes (based on the current termcap/terminfo settings), but can't find it back. If I remember correctly it let you do ...
natevw's user avatar
  • 174
1 vote
1 answer
635 views

How can I revert the effect of "stty cols N"?

I have set stty cols 72 in my xterm terminal. How to unset it to normal? Because when I change the size of that terminal, cols always set to 72 and can't stretch to current resized terminal window. ...
Tuyen Pham's user avatar
  • 1,765
3 votes
2 answers
1k views

What is `stty line NUMBER` even doing?

According to this page, this field describes the "line discipline", which determines what happens when a user presses backspace or ^C. Essentially, what happens when a program calls read(2). ...
extremeaxe5's user avatar
  • 1,143
1 vote
1 answer
2k views

Unable to write/read from serial port after couple of minutes/hours. Error message: stty: standard input: Inappropriate ioctl for device

I am trying to write and read from serial port at the same time. The purpose of this is to turn on and off a device over a DIO card which is connected to the serial port. While doing these on/off test,...
apploid's user avatar
  • 11
0 votes
1 answer
615 views

How to make xterm erase shift+backspace?

I know that if I want to make xterm erase a character when I press backspace, I do: stty erase ^? but I also want xterm to erase a character when I press shift+backspace, and I can't find an ...
master_latch's user avatar
1 vote
1 answer
1k views

How bash sets tty attributes before and after running a command?

Open xterm, run tty and see pseudo terminal slave file (let's say it is /dev/pts/0). Then open another xterm and run $ stty -F /dev/pts/0 speed 38400 baud; line = 0; lnext = <undef>; discard = &...
Igor Liferenko's user avatar
4 votes
1 answer
2k views

Can current `stty -g` settings be saved when also consuming stdin?

I'd like to save then restore the current stty settings in a script that is also consuming stdin however stty -g is complaining about it: stty: 'standard input': Inappropriate ioctl for device I'...
whiteinge's user avatar
  • 255
2 votes
1 answer
57 views

ssh: 2 acts like ^w regardless of terminal

In my decades of experience of *n?x based OSes, I have never seen this before: It happens during SSH commands. Regardless of terminal or terminal emulator, pressing the number 2 within SSH sends a ^W ...
Jama G's user avatar
  • 21
2 votes
1 answer
2k views

Reading data from serial port

FYI I am running busybox. I am able to send data to my ttyS1 using the following command: stty -F /dev/ttyS1 speed 115200 cs8 -cstopb -parenb -echo echo -en 'data here' > /dev/ttyS1 But when I ...
GeneCode's user avatar
  • 157
2 votes
1 answer
1k views

Interpreting serial data via bash

I am trying to write a bash script that is able to interpreter data coming from a serial device. I configure the port in raw and then I am able to do a simple cat of /dev/ttyUSB0 and see the data. My ...
rec0nf1g's user avatar
2 votes
0 answers
5k views

Line-ending problem with Telnet: can't remove LF from CRLF when sending command

I am unable to get Telnet to send only CR (\r) at the end of a command, despite setting the crlf toggle to <CR><NUL> (see example below). Instead, Telnet always sends CR-LF (\r\n). My ...
nuthatch's user avatar
-1 votes
2 answers
60 views

changing/modifying terminal parameters general uses

I am learning about being able to change terminal parameters on red hat Linux, what are some professional applications in which this could be useful? Is this a common thing to do? I am considering ...
Matt 's user avatar
6 votes
3 answers
2k views

Echoed escape sequences doesn't interpreted in Linux tty

Prerequisites The Linux virtual terminal (tty) is an emulation of VT102 - Virtual terminal subsystem source. The real VT100 (nearly the same as VT102) has the following behavior (I suppose): In the ...
MiniMax's user avatar
  • 4,033
6 votes
1 answer
10k views

How do you disable XON/OFF flow control?

I issued a stty -ixon command which enables XON/XOFF flow control. There is a stty -ixoff command but that enables the "sending of start/stop characters". So once XON/XOFF flow control is enabled, ...
StevieD's user avatar
  • 875
0 votes
0 answers
196 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 ...
Karn Kumar's user avatar
1 vote
1 answer
3k 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 -...
sanslol's user avatar
  • 11
2 votes
1 answer
363 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 #...
alabamatoy's user avatar
1 vote
3 answers
898 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 ...
Adam Farnsworth's user avatar
7 votes
1 answer
18k 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 ...
F.M's user avatar
  • 378
1 vote
0 answers
28 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 ...
Shivaprasad A Prabhu's user avatar
1 vote
0 answers
35 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 ...
Shivaprasad A Prabhu's user avatar