stty(1) - SerenityOS man pages

#Name

stty - set or print terminal characteristics

#Synopsis

$ stty [-a] [-g] [-F device] [setting...]

#Description

stty sets or displays terminal settings for the current terminal or a specified terminal device. Without arguments, it prints the current terminal settings. With settings specified, it applies those settings to the terminal.

#Options

The -g and -a options are mutually exclusive.

#Settings

Settings can be specified in several ways. To disable a setting, prefix it with a dash (-).

#Special settings

#Baud rate

Specify a numeric value to set both input and output baud rates:

#Window size

#Control characters

Control characters can be set using various formats:

Control character values can be specified as:

#Input flags

#Output flags

#Control flags

#Local flags

#Examples

Display current terminal settings:

$ stty
speed 38400 baud; rows 24; columns 80;

Save terminal settings for later restoration:

$ stty -g > saved_settings
$ stty intr ^X  # Make some changes (changes the interrupt key to Ctrl + X)
$ stty $(cat saved_settings)  # Restore settings

Set the terminal to raw mode:

$ stty raw

Set the baud rate to 115200:

$ stty 115200

Set the terminal size:

$ stty rows 30 cols 100

Reset terminal to sane defaults:

$ stty sane

#See also