首页
首页 » 其它 » stty

stty


stty

stty [options] [modes]

Set terminal I/O options for the current standard input device. Without options, stty reports the terminal settings that differ from those set by running stty sane, where ^ indicates the Ctrl key and ^` indicates a null value. Most modes can be negated using an optional - (shown in brackets). The corresponding description is also shown in brackets. Some arguments use non-POSIX extensions; these are marked with *.

Options

-a, --all

Report all option settings.

-F dev, --device=dev

Open the specified device and use it instead of standard input.

-g, --save

Report settings in stty-readable form (i.e., hex).

--help

Print help message and exit.

--version

Print version information and exit.

Control modes

[-] clocal

[Enable] disable modem control.

[-] cread

[Disable] enable the receiver.

[-] crtscts*

[Disable] enable RTS/CTS handshaking.

csbits

Set character size to bits, which must be 5, 6, 7, or 8.

[-] cstopb

[1] 2 stop bits per character.

[-] hup

[Do not] hang up connection on last close.

[-] hupcl

Same as previous.

[-] parenb

[Disable] enable parity generation and detection.

[-] parodd

Use [even] odd parity.

Input modes

[-] brkint

[Do not] signal INTR on break.

[-] icrnl

[Do not] map CR to NL on input.

[-] ignbrk

[Do not] ignore break on input.

[-] igncr

[Do not] ignore CR on input.

[-] ignpar

[Do not] ignore parity errors.

[-] imaxbel*

When input buffer is too full to accept a new character, [flush the input buffer] beep without flushing the input buffer.

[-] inlcr

[Do not] map NL to CR on input.

[-] inpck

[Disable] enable input parity checking.

[-] istrip

[Do not] strip input characters to 7 bits.

[-] iuclc*

[Do not] map uppercase to lowercase on input.

[-] ixany*

Allow [only XON] any character to restart output.

[-] ixoff, [-] tandem

[Enable] disable sending of START/STOP characters.

[-] ixon

[Disable] enable XON/XOFF flow control.

[-] parmrk

[Do not] mark parity errors.

Output modes

bsn*

Select style of delay for backspaces (0 or 1).

crn*

Select style of delay for carriage returns (0-3).

ffn*

Select style of delay for formfeeds (0 or 1).

nln*

Select style of delay for linefeeds (0 or 1).

tabn, [-] tabs*

Select style of delay for horizontal tabs (0-3). tabs is the same as tab0 and -tabs is the same as tab3.

vtn*

Select style of delay for vertical tabs (0 or 1).

[-] ocrnl*

[Do not] map CR to NL on output.

[-] ofdel*

Set fill character to [NULL] DEL.

[-] ofill*

Delay output with [timing] fill characters.

[-] olcuc*

[Do not] map lowercase to uppercase on output.

[-] onlcr*

[Do not] map NL to CR-NL on output.

[-] onlret*

On the terminal, NL performs [does not perform] the CR function.

[-] onocr*

Do not [do] output CRs at column 0.

[-] opost

[Do not] postprocess output.

Local modes

[-] echo

[Do not] echo every character typed.

[-] echoe, [-] crterase

[Do not] echo ERASE character as BS-space-BS string.

[-] echok

[Do not] echo NL after KILL character.

[-] echonl

[Do not] echo NL.

[-] icanon

[Disable] enable canonical input (ERASE, KILL, WERASE, and RPRINT processing).

[-] iexten

[Disable] enable extended functions for input data.

[-] isig

[Disable] enable checking of characters against INTR, SUSPEND, and QUIT.

[-] noflsh

[Enable] disable flush after INTR or QUIT.

[-] tostop*

[Do not] send SIGTTOU when background processes write to the terminal.

[-] xcase*

[Do not] change case on local output.

[-] echoprt, [-] prterase*

When erasing characters, echo them backward, enclosed in and /.

[-] echoctl. [-] ctlecho*

Do not echo control characters literally. Use hat notation (e.g., ^Z).

[-] echoke [-] crtkill*

Erase characters as specified by the echoprt and echoe settings (default is echoctl and echok settings).

Control assignments

ctrl-char c

Set control character to c. ctrl-char is dsusp (flush input and then send stop), eof, eol, eol2 (alternate end-of-line), erase, intr, lnext (treat next character literally), kill, rprnt (redraw line), quit, start, stop, susp, swtch, or werase (erase previous word). c can be a literal control character, a character in hat notation (e.g., ^Z), in hex (must begin with 0x), in octal (must begin with 0), or in decimal. Disable the control character with values of ^- or undef.

min n

Set the minimum number of characters that will satisfy a read until the time value has expired when -icanon is set.

time n

Set the number of tenths of a second before reads time out if the min number of characters has not been read when -icanon is set.

line i*

Set line discipline to i (1-126).

Combination modes

[-] cooked

Same as [raw] -raw.

[-] evenp, [-] parity

Same as [-] parenb and cs[8] 7.

ek

Reset ERASE and KILL characters to Ctrl-h and Ctrl-u, their defaults.

[-] lcase, [-] LCASE

[Unset] set xcase, iuclc, and olcuc.

[-] nl

[Unset] set icrnl and onlcr. -nl also unsets inlcr, igncr, ocrnl, and onlret, icrnl, onlcr.

[-] oddp

Same as [-] parenb, [-] parodd, and cs7[8] .

[-] raw

[Disable] enable raw input and output (no ERASE, KILL, INTR, QUIT, EOT, SWITCH, or output postprocessing).

sane

Reset all modes to reasonable values.

[-] cbreak

Same as [icanon] -icanon.

[-] pass8

Same as -parenb -istrip cs8.

[-] litout

Same as -parenb -istrip cs8.

[-] decctlq*

Same as -ixany.

crt

Same as echoe echoctl echoke.

dec

Same as echoe echoctl echoke -ixany. Additionally, set INTERRUPT to Ctrl-C, ERASE to Del, and KILL to Ctrl-U.

Special settings

n

Set terminal baud rate to n (e.g., 2400).

ispeed speed

Specify input speed.

ospeed speed

Specify output speed.

rows rows*

Specify number of rows.

cols columns, columns columns*

Specify number of columns.

size*

Display current row and column settings.

speed

Display terminal speed.