stty" -- Command" "

Set/print terminal modes

stty
ssttttyy --aa
ssttttyy --gg
ssttttyy _x::_x:: ...... ::_x
ssttttyy _a_r_g_l_i_s_t _._._.

The command stty lets you change or display the settings of the standard input device. The device is usually a terminal, although tapes, disks and other special files may be applicable.

Default Settings

The following describes how COHERENT sets up a terminal device by default. This normal processing is often called ``cooked'' mode. Note that on some machines, the default characters differ from those given below.

The erase and kill characters (normally <crtl-H> and <ctrl- U>) erase, respectively, one typed character and an entire line of typing.

The stop-output and start-output characters (normally <ctrl-S> and <ctrl-Q>) respectively stop and restart output.

The interrupt character (normally <ctrl- C>) sends the signal SIGINT, which usually terminates program execution.

The quit character (normally &&lltt;;ccttrrll--\\&&ggtt;;) sends the signal SIGQUIT, which usually terminates program execution with a core dump.

The end of file character (normally <ctrl- D>) generates an end-of-file signal from the terminal.

You can change the setting of each special character by invoking stty with the appropriate option.

Options

When called without any arguments, stty gives a brief listing of settings for the standard-input device.

stty can read the settings of devices other than the standard-input device by redirecting that device to it. For example, the command

     stty < /dev/com1l

prints a brief summary of the settings for serial device com1l.

stty's command-line arguments can take a number, as indicated below by n; or they can take a character, as indicated below by c. Argument c can be one of the following:

+o
A single character.
+o
A caret `^' followed by a single character (to indicate a control character, e.g., ^^XX for &&lltt;;ccttrrll--XX&&ggtt;;).
+o
An ^^??, which denotes the &&lltt;;ddeell&&ggtt;; character.
+o
An `0x' followed by two hexadecimal digits.
+o
An ^^--, which indicates that that option is not used.

stty recognizes the following command-line arguments:

--aa
Give a complete listing of settings for the standard- input device.
--gg
Give a complete list of settings for the standard-input device, but in hexadecimal. This is a dump of the termio structure in effect at the moment. For more information on the termio structure, see the Lexicon entry for termio.
_x::_x::......::_x
Establish new settings for the standard-input device. The settings are hexadecimal values that are separated by colons. This form can be combined with --gg option to copy stty settings from one device to another. For example, to set device com2l so that it mimics device com1l, use the following command:
     stty `stty -g < /dev/com1l` < /dev/com2l

00
Hang up the telephone.
5500
Set line speed to 50 bps.
7755
Set line speed to 75 bps.
111100
Set line speed to 110 bps.
113344
Set line speed to 110 bps.
115500
Set line speed to 150 bps.
220000
Set line speed to 200 bps.
330000
Set line speed to 300 bps.
660000
Set line speed to 600 bps.
11220000
Set line speed to 1200 bps.
11880000
Set line speed to 1800 bps.
22440000
Set line speed to 2400 bps.
44880000
Set line speed to 4800 bps.
99660000
Set line speed to 9600 bps.
1199220000
Set line speed to 19200 bps.
3388440000
Set line speed to 38400 bps.
bbrrkkiinntt
Send interrupt on break.
--bbrrkkiinntt
Do not send interrupt on break.
bbss00
No delay on backspace.
bbss11
Delay briefly on backspace.
ccllooccaall
Turn on modem control.
--ccllooccaall
Turn off modem control.
ccooookkeedd
Set the device into cooked mode. This is a composite of options parenb, -parodd, cs7, brkint, ignpar, istrip, icrnl, ixon, opost, onlcr, isig, and icanon.
ccrr00
No delay on carriage returns.
ccrr11
Carriage-return delay depends upon column position.
ccrr22
Delay approximately 0.10 seconds on carriage return.
ccrr33
Delay appoximately 0.15 seconds on carriage return.
ccrreeaadd
Enable the receiver.
--ccrreeaadd
Disable the receiver.
ccss55
Character size is five bits.
ccss66
Character size is six bits.
ccss77
Character size is seven bits.
ccss88
Character size is eight bits.
ccssttooppbb
Use two stop bits per character.
--ccssttooppbb
Use one stop bit per character.
eecchhoo
Echo every character.
--eecchhoo
Do not echo characters.
eecchhooee
Echo the erase character as backspace-space-backspace.
--eecchhooee
Do not echo the erase character as backspace-space- backspace.
eecchhookk
Echo newline after the kill character.
--eecchhookk
Do not echo newline after the kill character.
eecchhoonnll
Echo newline.
--eecchhoonnll
Do not echo newline.
eekk
Set the kill and erase characters to printable characters. A composite of erase '#' and kill '@'.
eeooff _c
Set the end-of-file character to c.
eeooll _c
Set the end-of-line character to c.
eerraassee _c
Set the erase character to c.
eevveennpp
Set the port to even parity. This is a composite of the options parenb, -parodd, and cs7.
--eevveennpp
Turn off even parity -- in effect, turn off parity altogether. This is a composite of the options -parenb and cs8.
ffff00
No delay on formfeeds.
ffff11
Delay approximately two seconds on formfeeds.
hhuupp
Hang up the telephone on logging out.
--hhuupp
Do not hang up the telephone on logging out.
hhuuppccll
Same as hhuupp.
--hhuuppccll
Same as --hhuupp.
iiccaannoonn
Enable canonical input.
--iiccaannoonn
Disable canonical input.
iiccrrnnll
Map carriage-return to newline on input.
--iiccrrnnll
Do not map carriage-return to newline on input.
iiggnnbbrrkk
Ignore break on input.
--iiggnnbbrrkk
Do not ignore break on input.
iiggnnccrr
Ignore carriage return on input.
--iiggnnccrr
Do not ignore carriage return on input.
iiggnnppaarr
Ignore parity errors on input.
--iiggnnppaarr
Do not ignore parity errors on input.
iinnllccrr
Map newline to carriage return on input.
--iinnllccrr
Do not map newline to carriage return on input.
iinnppcckk
Enable parity checking on input.
--iinnppcckk
Do not enable parity checking on input.
iinnttrr _c
Set the interrupt character to c.
iissiigg
Check input against interrupt and quit characters.
--iissiigg
Do not check input against interrupt and quit characters.
iiuuccllcc
Map input's upper-case characters to lower case.
--iiuuccllcc
Do not map input's upper-case characters to lower case.
iissttrriipp
Strip input to seven bits.
--iissttrriipp
Do not strip input to seven bits.
iixxaannyy
Allow any on input character to restart output.
--iixxaannyy
Do not allow any input character to restart output.
iixxooffff
Request that system send start or stop characters when the input queue is, respectively, nearly full or nearly empty.
--iixxooffff
Do not request that system send start or stop characters to manage input queue.
iixxoonn
Use start/stop characters to control output queue.
--iixxoonn
Do not use start/stop characters to control output queue
kkiillll _c
Set the kill character to c.
llccaassee
Map upper-case characters to lower case. A composite of options xcase, iuclc, and olcuc.
--llccaassee
Turn off mapping of upper-case character to lower case. A composite of options -xcase, -iuclc, and -olcuc.
LLCCAASSEE
A synonym for lcase.
--LLCCAASSEE
A synonym for -lcase.
mmiinn _n
Set the constant VMIN to decimal value n. For more about VMIN, see the Lexicon entry for termio.
nnll
A composite of options -icrnl and -onlcr.
--nnll
A composite of options icrnl, -inlcr, -igncr, onlcr, -ocrnl, and -onlret.
nnll00
No delay on newline.
nnll11
Delay approximately 0.10 seconds on newline.
nnooffllsshh
Flush buffer on interrupt or quit.
--nnooffllsshh
Do not flush buffer on interrupt or quit.
ooccrrnnll
In output, map carriage return to newline.
--ooccrrnnll
In output, do not map carriage return to newline.
ooddddpp
Set device to odd parity. This option is a composite of the options parenb, parodd, and cs7.
--ooddddpp
Turn off odd parity -- in effect, turn off parity altogether. This is a composite of the options -parenb and cs8.
ooffddeell
Use delete characters as fill characters.
--ooffddeell
Do not use delete characters as fill characters.
ooffiillll
Use fill characters for delays.
--ooffiillll
Do not use fill characters for delays.
oollccuucc
Map lower-case characters to upper case on output.
--oollccuucc
Do not map lower-case characters to upper case on output.
oonnllccrr
Map newline to carriage return/newline on output.
--oonnllccrr
Do not map newline to carriage return/newline on output.
oonnllrreett
A newline character executes a carriage return.
--oonnllrreett
A newline character does not execute a carriage return.
oonnooccrr
Do not output carriage returns at column 0.
--oonnooccrr
Output carriage returns at column 0.
ooppoosstt
Post-process output.
--ooppoosstt
Do not post-process output.
ppaarreennbb
Enable parity generation and detection.
--ppaarreennbb
Disable parity generation and detection.
ppaarriittyy
Synonym for option evenp.
--ppaarriittyy
Synonym for option -evenp.
ppaarrmmrrkk
Mark parity errors.
--ppaarrmmrrkk
Do not mark parity errors.
ppaarroodddd
Odd parity.
--ppaarroodddd
Turn off odd parity; i.e., use even parity.
qquuiitt _c
Set the quit character to c.
rraaww
Set the device into raw mode. This is a composite of the options -parenb, -parodd, -hupcl, cs8, -opost, -olcuc, -ocrnl, -onocr, -onlret, -ofill, -ofdel, nl0, cr0, tab0, bs0, vt0, and ff0. This turns off most character processing, including all input processing (see c_iflag fields in <termio.h>), canonical input buffering (--iiccaannoonn), and output processing (--ooppoosstt). It does not turn off echo.
--rraaww
Turn off raw mode -- in effect, restore the device to cooked mode. Same as ccooookkeedd.
ssaannee
Restore the device to ``sanity'' -- for example, after an editor or communications program has died unexpectedly. This is a composite of options icrnl, opost, onlcr, isig, icanon, -xcase, echo, echoe, echok, and erase ^h.
ttaabb00
No delay for horizontal-tab character.
ttaabb11
Delay for horizontal-tab character depends on column position.
ttaabb22
Delay approximately 0.10 seconds on horizontal tab.
ttaabb33
Expand horizontal-tab characters into spaces.
ttaabbss
A synonym for tab0.
--ttaabbss
A synonym for tab3.
ttiimmee _n
Set the constant VTIME to decimal value n. For more about VTIME, see the Lexicon entry for termio.
vvtt00
No delay on vertical-tab characters.
vvtt11
Delay approximately two seconds on vertical-tab characters.
xxccaassee
Canonical presentation of upper-case and lower-case characters.
--xxccaassee
Do not process upper-case and lower-case characters.

See Also

Notes

Executing stty with input redirected from another device does not have an effect unless the device being read is open. The last close of any terminal device resets all termio values to the system defaults. Thus, to change the settings of a device, you must first open the device.

A For example,

     enable com1l

A or

     sleep 32000 > /dev/com1l &

A might precede:

     stty evenp < /dev/com1l

A Note, too, that stty does not check its arguments for consistency.

A stty provides complete access to the System-V-style termio structure. Note, however, that the settings of termio are processed by the kernel's in-line discipline and device- driver modules. Under COHERENT, none of these modules pays attention to delay settings. Therefore, setting delays with stty does not, at present, affect the behavior of the terminal device.