stty Command stty
Set/print terminal modes
stty [option ...]
If no option is specified, stty prints the modes of the standard
output device in the standard error stream. Otherwise, each
option modifies the modes of the standard output device. The
device is usually a terminal, although tapes, disks and other
special files may be applicable.
In normal processing (``cooked'' mode), the erase and kill
characters (normally <crtl-H> and <ctrl-U>) erase, respectively,
one typed character and a typed line. The stop-output and start-
output characters (normally <ctrl-S> and <ctrl-Q>) stop and res-
tart output. The interrupt character (normally DELETE or RUBOUT
ASCII 0177), sends the signal SIGINT, which usually terminates
program execution. The quit character (normally ASCII 034, FS,
which differs on various terminals but is often <ctrl-\>) 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 from the terminal. Each special charac-
ter can be changed with the appropriate option.
On some machines, the default characters differ from those given
above. On the IBM Personal Computer, for example, the default
kill character is <ctrl-U> and the default interrupt character is
<ctrl-C>.
The following table describes each available option. The c argu-
ment may be a literal character or may be of the form `^X' for
<ctrl-X>.
number Set input and output baud rates of the device to the
speed number, if possible.
0 Hang up phone immediately.
-a Display all modes.
break c
Set the break character to c.
cbreak Break after every input character. This allows a program
to return after having read N characters from a terminal,
even if no end of file, break or newline character was
typed.
-cbreak
Exit from cbreak mode.
cooked Exit from raw mode.
crt Terminal is a CRT. Echoing is enhanced.
COHERENT Lexicon Page 1
stty Command stty
-crt The terminal is not a CRT.
echo Output characters as they are received on the input.
-echo Disable echoing.
ek Set the erase character to `#' and the kill character to
`@'.
eof c Set the end of file character to c.
erase c
Set the erase character to c.
even Accept even-parity characters.
-even Do not accept even-parity characters.
excl Exclusive use: subsequent opens will fail.
-excl Non-exclusive use.
flush Flush characters waiting in output or input queues.
-flush Do not flush characters.
hup Hang up the phone on last close.
-hup Do not hang up on last close.
int c Set the interrupt character to c.
kill c Set the kill character to c.
nl Disable newline mapping.
-nl Enable newline mapping: map carriage returns to linefeeds
on input, and append carriage returns before linefeeds on
output.
odd Accept odd-parity characters.
-odd Do not accept odd-parity characters.
print Print terminal attributes.
quit c Set the quit character to c.
raw Raw mode: suppress all processing and mapping (except
echo).
-raw Exit from raw mode.
rawin Suppress all processing and mapping on the input stream.
COHERENT Lexicon Page 2
stty Command stty
-rawin Exit from rawin mode.
rawout Suppress all processing and mapping on the output stream.
-rawout
Exit from rawout mode.
start c
Set the start-output character to c.
stop c Set the stop-output character to c.
tabs Do not expand tabs: useful for terminals which process
tabs internally.
-tabs Expand tabs to the appropriate number of spaces on out-
put. The system assumes tabstops are at every eighth
column.
tandem Tandem mode. The system will send the programmed stop-
output character whenever there is a danger of losing
characters from the input stream due to buffering
limitations. The system will send the start-character
when the level of unprocessed characters has subsided.
-tandem
Disable tandem mode.
***** See Also *****
ASCII, commands, getty, init, ioctl(), signal()
***** Notes *****
The system does not support character delays or mapping upper to
lower case.
COHERENT Lexicon Page 3