Questions tagged [stty]

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

Filter by
Sorted by
Tagged with
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 '"\...
user avatar
  • 302
0 votes
1 answer
50 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 ...
user avatar
0 votes
0 answers
46 views

Zsh: bind a key to run another command while a zsh script is in foreground

Zsh keybindings seem to work only when the shell is waiting for a command after the prompt. When a zsh script is launched, it cares about reading inputs only when a command like read is encountered, ...
user avatar
0 votes
0 answers
9 views

Configure xbindkeys to SIGINT?

The end goal is to be able to press ALT+c in gnome-terminal and interrupt a running process. I was hoping I could simply reconfigure stty but super key notation for stty implies this is not possible. ...
user avatar
  • 101
0 votes
1 answer
43 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 ...
user avatar
  • 179
0 votes
0 answers
21 views

Multiple hops XON/XOFF

I'm back! With the same issue but slightly different. In two previous threads with the help of some folks here I was able to resolve some issues I was experiencing with flow control and a vintage ...
user avatar
2 votes
1 answer
189 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 ...
user avatar
0 votes
1 answer
239 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: ...
user avatar
2 votes
0 answers
22 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 ...
user avatar
1 vote
1 answer
302 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 ...
user avatar
1 vote
1 answer
37 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 ...
user avatar
  • 1,791
4 votes
1 answer
201 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 ...
user avatar
2 votes
1 answer
61 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 ...
user avatar
  • 125
2 votes
0 answers
129 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 avatar
  • 309
0 votes
2 answers
148 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 ...
user avatar
  • 517
0 votes
1 answer
319 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 -...
user avatar
1 vote
1 answer
103 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 ...
user avatar
1 vote
1 answer
799 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 ...
user avatar
  • 1,287
0 votes
1 answer
466 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 ...
user avatar
0 votes
0 answers
813 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 ...
user avatar
  • 1
0 votes
1 answer
2k 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 ...
user avatar
0 votes
1 answer
150 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 ...
user avatar
  • 467
0 votes
1 answer
200 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 ...
user avatar
3 votes
0 answers
133 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 & ...
user avatar
1 vote
1 answer
11k 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 ...
user avatar
0 votes
1 answer
46 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 ...
user avatar
  • 184
2 votes
1 answer
423 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. ...
user avatar
  • 1,635
2 votes
2 answers
973 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). ...
user avatar
  • 1,073
0 votes
1 answer
1k 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,...
user avatar
0 votes
1 answer
232 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 ...
user avatar
1 vote
1 answer
446 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 = &...
user avatar
3 votes
1 answer
1k 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'...
user avatar
  • 235
2 votes
1 answer
51 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 ...
user avatar
  • 21
1 vote
1 answer
404 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 ...
user avatar
  • 127
2 votes
1 answer
620 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 ...
user avatar
1 vote
0 answers
3k 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 ...
user avatar
-2 votes
2 answers
44 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 ...
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 ...
user avatar
  • 3,720
4 votes
1 answer
7k 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, ...
user avatar
  • 445
0 votes
0 answers
129 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 ...
user avatar
1 vote
1 answer
1k 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 -...
user avatar
  • 11
2 votes
1 answer
177 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 #...
user avatar
0 votes
3 answers
529 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 ...
user avatar
4 votes
1 answer
11k 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 ...
user avatar
  • 298
1 vote
0 answers
27 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 ...
user avatar
1 vote
0 answers
34 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 ...
user avatar
2 votes
0 answers
417 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 ...
user avatar
1 vote
0 answers
121 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(...
user avatar
  • 111
2 votes
1 answer
949 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 ...
user avatar
1 vote
1 answer
1k views

key press not displaying in tty1

I have Ubuntu 16.04.04 LTS server. I was doing some work in tty1 and then took a lunch break. In the meantime, my desktop monitor went asleep. When I came back, I pressed Esc and my screen awoke ...
user avatar
  • 170