Search notes:

Shell command: stty

Change and print terminal device settings/options. stty stands for set tty.
Apparently, stty uses termios (3).

Show all settings

stty -a
Use -F to show the settings of another terminal:
sudo stty -a -F /dev/tty15

Specify the interactive attention character

stty intr specifies the interactive attention character. When a TTY finds this character in the input stream, it immediately sends a SIGINT signal to the corresponding process.
stty intr ^F

stty raw

On linux, a terminal will by default buffer input until Enter is pressed. This can be changed with
stty raw

stty size

stty returns the screen dimensions.
#!/bin/bash

stty_size=$(stty size)    # Returns two numbers: rows and columns

nofCols=${stty_size##* }  # delete up to last space from the left
nofRows=${stty_size%% *}  # delete from first space to the right

echo "Number of columns: $nofCols"
echo "Number of rows:    $nofRows"
Github repository shell-commands, path: /stty/size_screen-dimension

stty -ixon

Turn off flow control (xon/xoff).
This is necessary for example to to bind ctrl-q in readline.

See also

/dev/tty
tty
Shell commands

Index