BSD 4_4_Lite2 development
[unix-history] / usr / share / man / cat1 / stty.0
STTY(1) BSD Reference Manual STTY(1)
N\bNA\bAM\bME\bE
s\bst\btt\bty\by - set the options for a terminal device interface
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
s\bst\btt\bty\by [-\b-a\ba | -\b-e\be | -\b-g\bg] [-\b-f\bf _\bf_\bi_\bl_\be] [operands]
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The s\bst\btt\bty\by utility sets or reports on terminal characteristics for the de-
vice that is its standard input. If no options or operands are speci-
fied, it reports the settings of a subset of characteristics as well as
additional ones if they differ from their default values. Otherwise it
modifies the terminal state according to the specified arguments. Some
combinations of arguments are mutually exclusive on some terminal types.
The following options are available:
-\b-a\ba Display all the current settings for the terminal to standard
output as per IEEE Std1003.2 (``POSIX'').
-\b-e\be Display all the current settings for the terminal to standard
output in the traditional BSD ``all'' and ``everything'' formats.
-\b-f\bf Open and use the terminal named by _\bf_\bi_\bl_\be rather than using stan-
dard input. The file is opened using the O_NONBLOCK flag of
o\bop\bpe\ben\bn(), making it possible to set or display settings on a termi-
nal that might otherwise block on the open.
-\b-g\bg Display all the current settings for the terminal to standard
output in a form that may be used as an argument to a subsequent
invocation of s\bst\btt\bty\by to restore the current terminal state as per
IEEE Std1003.2 (``POSIX'').
The following arguments are available to set the terminal characteris-
tics:
C\bCo\bon\bnt\btr\bro\bol\bl M\bMo\bod\bde\bes\bs:\b:
Control mode flags affect hardware characteristics associated with the
terminal. This corresponds to the c_cflag in the termios structure.
p\bpa\bar\bre\ben\bnb\bb (-\b-p\bpa\bar\bre\ben\bnb\bb)
Enable (disable) parity generation and detection.
p\bpa\bar\bro\bod\bdd\bd (-\b-p\bpa\bar\bro\bod\bdd\bd)
Select odd (even) parity.
c\bcs\bs5\b5 c\bcs\bs6\b6 c\bcs\bs7\b7 c\bcs\bs8\b8
Select character size, if possible.
_\bn_\bu_\bm_\bb_\be_\br Set terminal baud rate to the number given, if possible. If
the baud rate is set to zero, modem control is no longer as-
serted.
i\bis\bsp\bpe\bee\bed\bd _\bn_\bu_\bm_\bb_\be_\br
Set terminal input baud rate to the number given, if possi-
ble. If the input baud rate is set to zero, the input baud
rate is set to the value of the output baud rate.
o\bos\bsp\bpe\bee\bed\bd _\bn_\bu_\bm_\bb_\be_\br
Set terminal output baud rate to the number given, if possi-
ble. If the output baud rate is set to zero, modem control
is no longer asserted.
s\bsp\bpe\bee\bed\bd _\bn_\bu_\bm_\bb_\be_\br
This sets both i\bis\bsp\bpe\bee\bed\bd and o\bos\bsp\bpe\bee\bed\bd to _\bn_\bu_\bm_\bb_\be_\br.
h\bhu\bup\bpc\bcl\bl (-\b-h\bhu\bup\bpc\bcl\bl)
Stop asserting modem control (do not stop asserting modem
control) on last close.
h\bhu\bup\bp (-\b-h\bhu\bup\bp) Same as hupcl (-\b-h\bhu\bup\bpc\bcl\bl).
c\bcs\bst\bto\bop\bpb\bb (-\b-c\bcs\bst\bto\bop\bpb\bb)
Use two (one) stop bits per character.
c\bcr\bre\bea\bad\bd (-\b-c\bcr\bre\bea\bad\bd)
Enable (disable) the receiver.
c\bcl\blo\boc\bca\bal\bl (-\b-c\bcl\blo\boc\bca\bal\bl)
Assume a line without (with) modem control.
c\bcr\brt\bts\bsc\bct\bts\bs (-\b-c\bcr\brt\bts\bsc\bct\bts\bs)
Enable RTS/CTS flow control.
I\bIn\bnp\bpu\but\bt M\bMo\bod\bde\bes\bs:\b:
This corresponds to the c_iflag in the termios structure.
i\big\bgn\bnb\bbr\brk\bk (-\b-i\big\bgn\bnb\bbr\brk\bk)
Ignore (do not ignore) break on input.
b\bbr\brk\bki\bin\bnt\bt (-\b-b\bbr\brk\bki\bin\bnt\bt)
Signal (do not signal) INTR on break.
i\big\bgn\bnp\bpa\bar\br (-\b-i\big\bgn\bnp\bpa\bar\br)
Ignore (do not ignore) parity errors.
p\bpa\bar\brm\bmr\brk\bk (-\b-p\bpa\bar\brm\bmr\brk\bk)
Mark (do not mark) parity errors.
i\bin\bnp\bpc\bck\bk (-\b-i\bin\bnp\bpc\bck\bk)
Enable (disable) input parity checking.
i\bis\bst\btr\bri\bip\bp (-\b-i\bis\bst\btr\bri\bip\bp)
Strip (do not strip) input characters to seven bits.
i\bin\bnl\blc\bcr\br (-\b-i\bin\bnl\blc\bcr\br)
Map (do not map) NL to CR on input.
i\big\bgn\bnc\bcr\br (-\b-i\big\bgn\bnc\bcr\br)
Ignore (do not ignore) CR on input.
i\bic\bcr\brn\bnl\bl (-\b-i\bic\bcr\brn\bnl\bl)
Map (do not map) CR to NL on input.
i\bix\bxo\bon\bn (-\b-i\bix\bxo\bon\bn)
Enable (disable) START/STOP output control. Output from the
system is stopped when the system receives STOP and started
when the system receives START, or if i\bix\bxa\ban\bny\by is set, any char-
acter restarts output.
i\bix\bxo\bof\bff\bf (-\b-i\bix\bxo\bof\bff\bf)
Request that the system send (not send) START/STOP characters
when the input queue is nearly empty/full.
i\bix\bxa\ban\bny\by (-\b-i\bix\bxa\ban\bny\by)
Allow any character (allow only START) to restart output.
i\bim\bma\bax\bxb\bbe\bel\bl (-\b-i\bim\bma\bax\bxb\bbe\bel\bl)
The system imposes a limit of MAX_INPUT (currently 255) char-
acters in the input queue. If i\bim\bma\bax\bxb\bbe\bel\bl is set and the input
queue limit has been reached, subsequent input causes the
system to send an ASCII BEL character to the output queue
(the terminal beeps at you). Otherwise, if i\bim\bma\bax\bxb\bbe\bel\bl is unset
and the input queue is full, the next input character causes
the entire input and output queues to be discarded.
O\bOu\but\btp\bpu\but\bt M\bMo\bod\bde\bes\bs:\b:
This corresponds to the c_oflag of the termios structure.
o\bop\bpo\bos\bst\bt (-\b-o\bop\bpo\bos\bst\bt)
Post-process output (do not post-process output; ignore all
other output modes).
o\bon\bnl\blc\bcr\br (-\b-o\bon\bnl\blc\bcr\br)
Map (do not map) NL to on output.
o\box\bxt\bta\bab\bbs\bs (-\b-o\box\bxt\bta\bab\bbs\bs)
Expand (do not expand) tabs to spaces on output.
L\bLo\boc\bca\bal\bl M\bMo\bod\bde\bes\bs:\b:
Local mode flags (lflags) affect various and sundry characteristics of
terminal processing. Historically the term "local" pertained to new job
control features implemented by Jim Kulp on a Pdp 11/70 at IIASA. Later
the driver ran on the first VAX at Evans Hall, UC Berkeley, where the job
control details were greatly modified but the structure definitions and
names remained essentially unchanged. The second interpretation of the
'l' in lflag is ``line discipline flag'' which corresponds to the _\bc_\b__\bl_\bf_\bl_\ba_\bg
of the _\bt_\be_\br_\bm_\bi_\bo_\bs structure.
i\bis\bsi\big\bg (-\b-i\bis\bsi\big\bg)
Enable (disable) the checking of characters against the spe-
cial control characters INTR, QUIT, and SUSP.
i\bic\bca\ban\bno\bon\bn (-\b-i\bic\bca\ban\bno\bon\bn)
Enable (disable) canonical input (ERASE and KILL processing).
i\bie\bex\bxt\bte\ben\bn (-\b-i\bie\bex\bxt\bte\ben\bn)
Enable (disable) any implementation defined special control
characters not currently controlled by icanon, isig, or ixon.
e\bec\bch\bho\bo (-\b-e\bec\bch\bho\bo)
Echo back (do not echo back) every character typed.
e\bec\bch\bho\boe\be (-\b-e\bec\bch\bho\boe\be)
The ERASE character shall (shall not) visually erase the last
character in the current line from the display, if possible.
e\bec\bch\bho\bok\bk (-\b-e\bec\bch\bho\bok\bk)
Echo (do not echo) NL after KILL character.
e\bec\bch\bho\bok\bke\be (-\b-e\bec\bch\bho\bok\bke\be)
The KILL character shall (shall not) visually erase the the
current line from the display, if possible.
e\bec\bch\bho\bon\bnl\bl (-\b-e\bec\bch\bho\bon\bnl\bl)
Echo (do not echo) NL, even if echo is disabled.
e\bec\bch\bho\boc\bct\btl\bl (-\b-e\bec\bch\bho\boc\bct\btl\bl)
If e\bec\bch\bho\boc\bct\btl\bl is set, echo control characters as ^X. Otherwise
control characters echo as themselves.
e\bec\bch\bho\bop\bpr\brt\bt (-\b-e\bec\bch\bho\bop\bpr\brt\bt)
For printing terminals. If set, echo erased characters back-
wards within ``\'' and ``/''. Otherwise, disable this fea-
ture.
n\bno\bof\bfl\bls\bsh\bh (-\b-n\bno\bof\bfl\bls\bsh\bh)
Disable (enable) flush after INTR, QUIT, SUSP.
t\bto\bos\bst\bto\bop\bp (-\b-t\bto\bos\bst\bto\bop\bp)
Send (do not send) SIGTTOU for background output. This caus-
es background jobs to stop if they attempt terminal output.
a\bal\blt\btw\bwe\ber\bra\bas\bse\be (-\b-a\bal\blt\btw\bwe\ber\bra\bas\bse\be)
Use (do not use) an alternate word erase algorithm when pro-
cessing WERASE characters. This alternate algorithm consid-
ers sequences of alphanumeric/underscores as words. It also
skips the first preceding character in its classification (as
a convenience since the one preceding character could have
been erased with simply an ERASE character.)
m\bmd\bdm\bmb\bbu\buf\bf (-\b-m\bmd\bdm\bmb\bbu\buf\bf)
If set, flow control output based on condition of Carrier De-
tect. Otherwise writes return an error if Carrier Detect is
low (and Carrier is not being ignored with the CLOCAL flag.)
f\bfl\blu\bus\bsh\bho\bo (-\b-f\bfl\blu\bus\bsh\bho\bo)
Indicates output is (is not) being discarded.
p\bpe\ben\bnd\bdi\bin\bn (-\b-p\bpe\ben\bnd\bdi\bin\bn)
Indicates input is (is not) pending after a switch from non-
canonical to canonical mode and will be re-input when a read
becomes pending or more input arrives.
C\bCo\bon\bnt\btr\bro\bol\bl C\bCh\bha\bar\bra\bac\bct\bte\ber\brs\bs:\b:
_\bc_\bo_\bn_\bt_\br_\bo_\bl_\b-_\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br _\bs_\bt_\br_\bi_\bn_\bg
Set _\bc_\bo_\bn_\bt_\br_\bo_\bl_\b-_\bc_\bh_\ba_\br_\ba_\bc_\bt_\be_\br to _\bs_\bt_\br_\bi_\bn_\bg. If string is a single char-
acter, the control character is set to that character. If
string is the two character sequence "^-" or the string "un-
def" the control character is disabled (i.e. set to
{_POSIX_VDISABLE}.)
Recognized control-characters:
control-
character Subscript Description
_________ _________ _______________
eof VEOF EOF character
eol VEOL EOL character
eol2 VEOL2 EOL2 character
erase VERASE ERASE character
werase VWERASE WERASE character
intr VINTR INTR character
kill VKILL KILL character
quit VQUIT QUIT character
susp VSUSP SUSP character
start VSTART START character
stop VSTOP STOP character
dsusp VDSUSP DSUSP character
lnext VLNEXT LNEXT character
reprint VREPRINT REPRINT character
status VSTATUS STATUS character
m\bmi\bin\bn _\bn_\bu_\bm_\bb_\be_\br
t\bti\bim\bme\be _\bn_\bu_\bm_\bb_\be_\br
Set the value of min or time to number. MIN and TIME are
used in Non-Canonical mode input processing (-icanon).
C\bCo\bom\bmb\bbi\bin\bna\bat\bti\bio\bon\bn M\bMo\bod\bde\bes\bs:\b:
_\bs_\ba_\bv_\be_\bd _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs
Set the current terminal characteristics to the saved set-
tings produced by the -\b-g\bg option.
e\bev\bve\ben\bnp\bp or p\bpa\bar\bri\bit\bty\by
Enable parenb and cs7; disable parodd.
o\bod\bdd\bdp\bp Enable parenb, cs7, and parodd.
-\b-p\bpa\bar\bri\bit\bty\by, -\b-e\bev\bve\ben\bnp\bp, -\b-o\bod\bdd\bdp\bp
Disable parenb, and set cs8.
n\bnl\bl (-\b-n\bnl\bl) Enable (disable) icrnl. In addition -nl unsets inlcr and
igncr.
e\bek\bk Reset ERASE and KILL characters back to system defaults.
s\bsa\ban\bne\be Resets all modes to reasonable values for interactive termi-
nal use.
t\btt\bty\by Set the line discipline to the standard terminal line disci-
pline TTYDISC.
c\bcr\brt\bt (-\b-c\bcr\brt\bt) Set (disable) all modes suitable for a CRT display device.
k\bke\ber\brn\bni\bin\bnf\bfo\bo (-\b-k\bke\ber\brn\bni\bin\bnf\bfo\bo)
Enable (disable) the system generated status line associated
with processing a STATUS character (usually set to ^T). The
status line consists of the system load average, the current
command name, its process ID, the event the process is wait-
ing on (or the status of the process), the user and system
times, percent cpu, and current memory usage.
c\bco\bol\blu\bum\bmn\bns\bs _\bn_\bu_\bm_\bb_\be_\br
The terminal size is recorded as having _\bn_\bu_\bm_\bb_\be_\br columns.
c\bco\bol\bls\bs _\bn_\bu_\bm_\bb_\be_\br
is an alias for c\bco\bol\blu\bum\bmn\bns\bs.\b.
r\bro\bow\bws\bs _\bn_\bu_\bm_\bb_\be_\br
The terminal size is recorded as having _\bn_\bu_\bm_\bb_\be_\br rows.
d\bde\bec\bc Set modes suitable for users of Digital Equipment Corporation
systems ( ERASE, KILL, and INTR characters are set to ^?, ^U,
and ^C; ixany is disabled, and crt is enabled.)
e\bex\bxt\btp\bpr\bro\boc\bc (-\b-e\bex\bxt\btp\bpr\bro\boc\bc)
If set, this flag indicates that some amount of terminal pro-
cessing is being performed by either the terminal hardware or
by the remote side connected to a pty.
r\bra\baw\bw (-\b-r\bra\baw\bw) If set, change the modes of the terminal so that no input or
output processing is performed. If unset, change the modes of
the terminal to some reasonable state that performs input and
output processing. Note that since the terminal driver no
longer has a single RAW bit, it is not possible to intuit
what flags were set prior to setting r\bra\baw\bw. This means that un-
setting r\bra\baw\bw may not put back all the setting that were previ-
ously in effect. To set the terminal into a raw state and
then accurately restore it, the following shell code is rec-
ommended:
save_state=$(stty -g)
stty raw
...
stty "$save_state"
s\bsi\biz\bze\be The size of the terminal is printed as two numbers on a sin-
gle line, first rows, then columns.
C\bCo\bom\bmp\bpa\bat\bti\bib\bbi\bil\bli\bit\bty\by M\bMo\bod\bde\bes\bs:\b:
These modes remain for compatibility with the previous version of the
stty command.
a\bal\bll\bl Reports all the terminal modes as with s\bst\btt\bty\by -\b-a\ba except that
the control characters are printed in a columnar format.
e\bev\bve\ber\bry\byt\bth\bhi\bin\bng\bg Same as a\bal\bll\bl.
c\bco\boo\bok\bke\bed\bd Same as s\bsa\ban\bne\be.
c\bcb\bbr\bre\bea\bak\bk If set, enables b\bbr\brk\bki\bin\bnt\bt, i\bix\bxo\bon\bn, i\bim\bma\bax\bxb\bbe\bel\bl, o\bop\bpo\bos\bst\bt, i\bis\bsi\big\bg, i\bie\bex\bxt\bte\ben\bn,
and -\b-i\bic\bca\ban\bno\bon\bn. If unset, same as s\bsa\ban\bne\be.
n\bne\bew\bw Same as t\btt\bty\by.
o\bol\bld\bd Same as t\btt\bty\by.
n\bne\bew\bwc\bcr\brt\bt (-\b-n\bne\bew\bwc\bcr\brt\bt)
Same as c\bcr\brt\bt.
p\bpa\bas\bss\bs8\b8 The converse of p\bpa\bar\bri\bit\bty\by.
t\bta\ban\bnd\bde\bem\bm (-\b-t\bta\ban\bnd\bde\bem\bm)
Same as i\bix\bxo\bof\bff\bf.
d\bde\bec\bcc\bct\btl\blq\bq (-\b-d\bde\bec\bcc\bct\btl\blq\bq)
The converse of i\bix\bxa\ban\bny\by.
c\bcr\brt\bte\ber\bra\bas\bse\be (-\b-c\bcr\brt\bte\ber\bra\bas\bse\be)
Same as e\bec\bch\bho\boe\be.
c\bcr\brt\btb\bbs\bs (-\b-c\bcr\brt\btb\bbs\bs)
Same as e\bec\bch\bho\boe\be.
c\bcr\brt\btk\bki\bil\bll\bl (-\b-c\bcr\brt\btk\bki\bil\bll\bl)
Same as e\bec\bch\bho\bok\bke\be.
c\bct\btl\ble\bec\bch\bho\bo (-\b-c\bct\btl\ble\bec\bch\bho\bo)
Same as e\bec\bch\bho\boc\bct\btl\bl.
p\bpr\brt\bte\ber\bra\bas\bse\be (-\b-p\bpr\brt\bte\ber\bra\bas\bse\be)
Same as e\bec\bch\bho\bop\bpr\brt\bt.
l\bli\bit\bto\bou\but\bt (-\b-l\bli\bit\bto\bou\but\bt)
The converse of o\bop\bpo\bos\bst\bt.
t\bta\bab\bbs\bs (-\b-t\bta\bab\bbs\bs)
The converse of t\bta\bab\bbs\bs.
b\bbr\brk\bk _\bv_\ba_\bl_\bu_\be Same as the control character e\beo\bol\bl.
f\bfl\blu\bus\bsh\bh _\bv_\ba_\bl_\bu_\be
Same as the control character d\bdi\bis\bsc\bca\bar\brd\bd.
r\brp\bpr\brn\bnt\bt _\bv_\ba_\bl_\bu_\be
Same as the control character r\bre\bep\bpr\bri\bin\bnt\bt.
The s\bst\btt\bty\by utility exits with a value of 0 if successful, and >0 if an er-
ror occurs.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
termios(4)
S\bST\bTA\bAN\bND\bDA\bAR\bRD\bDS\bS
The s\bst\btt\bty\by function is expected to be IEEE Std1003.2 (``POSIX'') compati-
ble. The flags -\b-e\be and -\b-f\bf are extensions to the standard.
4.4BSD June 1, 1994 7