stty(1) stty(1)
NAME
stty - set the options for a terminal
SYNOPSIS
stty [-n filename] [-a] [-g] [options]
DESCRIPTION
stty sets certain terminal I/O options for the device that
is the current standard input; without arguments, it reports
the settings of certain options;
With the -n filename flag option, stty will open the file
specified by filename with the option ONODELAY (this means
that it will open modem-controlled lines immediately instead
of waiting for a carrier before opening them was completed)
and uses it as standard input.
With the -a flag option, it reports all of the option
settings.
With the -g flag option, it reports current settings in a
form that can be used as an argument to another stty
command. Detailed information about the modes listed in the
first five groups below may be found in termio(7) in the
Oreo System Administration Reference. Flag options in the
``Combination Modes'' group are implemented using options in
the previous groups. Note that many combinations of options
make no sense, but checking is performed.
The options are selected from the following:
Control Modes
parenb (-parenb)
enable (disable) parity generation and detection.
parodd (-parodd)
select odd (even) parity.
cs5 cs6 cs7 cs8
select character size (see termio(7)).
0 hang up phone line immediately.
50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 exta
extb
Set terminal baud rate to the number given, if
possible. (All speeds are not supported by all
hardware interfaces; 9600 baud is assumed.) 19200
is equivalent to exta. 38400 is equivalent to
extb.
hupcl (-hupcl)
hang up (do not hang up) modem connection on last
close.
hup (-hup)
same as hupcl (-hupcl).
cstopb (-cstopb)
use two (one) stop bits per character.
Page 1 (last mod. 1/16/87)
stty(1) stty(1)
cread (-cread)
enable (disable) the receiver.
clocal (-clocal)
assume a line without (with) modem control.
loblk (-loblk)
block (do not block) output from a non-current
layer.
Input Modes
ignbrk (-ignbrk)
ignore (do not ignore) break on input.
brkint (-brkint)
signal (do not signal) INTR on break.
ignpar (-ignpar)
ignore (do not ignore) parity errors.
parmrk (-parmrk)
mark (do not mark) parity errors (see termio(7)).
inpck (-inpck)
enable (disable) input parity checking.
istrip (-istrip)
strip (do not strip) input characters to seven
bits.
inlcr (-inlcr)
map (do not map) NL to CR on input.
igncr (-igncr)
ignore (do not ignore) CR on input.
icrnl (-icrnl)
map (do not map) CR to NL on input.
iuclc (-iuclc)
map (do not map) upper-case alphabetics to lower
case on input.
ixon (-ixon)
enable (disable) START/STOP output control.
Output is stopped by sending an ASCII DC3 and
started by sending an ASCII DC1.
ixany (-ixany)
allow any character (only DC1) to restart output.
ixoff (-ixoff)
request that the system send (not send) START/STOP
characters when the input queue is nearly
empty/full.
Output Modes
opost (-opost)
post-process output (do not post-process output;
ignore all other output modes).
olcuc (-olcuc)
map (do not map) lower-case alphabetics to upper
case on output.
onlcr (-onlcr)
map (do not map) NL to CR-NL on output.
ocrnl (-ocrnl)
map (do not map) CR to NL on output.
onocr (-onocr)
Page 2 (last mod. 1/16/87)
stty(1) stty(1)
do not (do) output CRs at column zero.
onlret (-onlret)
on the terminal NL performs (does not perform) the
CR function.
ofill (-ofill)
use fill characters (use timing) for delays.
ofdel (-ofdel)
fill characters are DELs (NULs).
cr0 cr1 cr2 cr3
select style of delay for carriage returns (see
termio(7)).
nl0 nl1 select style of delay for line-feeds (see
termio(7)).
tab0 tab1 tab2 tab3
select style of delay for horizontal tabs (see
termio(7)).
bs0 bs1 select style of delay for backspaces (see
termio(7)).
ff0 ff1 select style of delay for form-feeds (see
termio(7)).
vt0 vt1 select style of delay for vertical tabs (see
termio(7)).
Local Modes
isig (-isig)
enable (disable) the checking of characters
against the special control characters INTR, QUIT,
and SWTCH.
icanon (-icanon)
enable (disable) canonical input (ERASE and KILL
processing).
xcase (-xcase)
canonical (unprocessed) upper/lower-case
presentation.
echo (-echo)
echo back (do not echo back) every character
typed.
echoe (-echoe)
echo (do not echo) ERASE character as a
backspace-space-backspace string. Note: this mode
will erase the ERASEed character on many CRT
terminals; however, it does not keep track of
column position and, as a result, may be confusing
on escaped characters, tabs, and backspaces.
echok (-echok)
echo (do not echo) NL after KILL character.
lfkc (-lfkc)
the same as echok (-echok); obsolete.
echonl (-echonl)
echo (do not echo) NL.
noflsh (-noflsh)
disable (enable) flush after INTR, QUIT, or SWTCH.
stwrap (-stwrap)
Page 3 (last mod. 1/16/87)
stty(1) stty(1)
disable (enable) truncation of lines longer than
79 characters on a synchronous line.
stflush (-stflush)
enable (disable) flush on a synchronous line after
every write(3).
stappl (-stappl)
use application mode (use line mode) on a
synchronous line.
Control Assignments
control-character c
set control-character to c, where control-
character is erase, kill, intr, quit, swtch, eof,
eol, ctab, min, or time (ctab is used with
-stappl, (min and time are used with -icanon; see
termio(7)). If c is preceded by an (escaped from
the shell) circumflex (^), then the value used is
the corresponding CONTROL character (e.g., d is a
CONTROL-d CONTROL-d is interpreted as DEL and is
interpreted as undefined.
line i set line discipline to i (0 < i < 127 ).
BSD 4.2 Compatible Features
susp c Set the suspend character to c. When typed, the
suspend character sends SIGTSTP to the current
process group.
dsusp c The current process group is sent SIGTSTP when a
program attempts to read terminal input.
tostop (-tostop)
When set, background processes which write on the
control TTY will be stopped until brought into
foreground by the shell.
Combination Modes
evenp or parity
enable parenb and cs7.
oddp enable parenb, cs7, and parodd.
-parity, -evenp, or -oddp
disable parenb, and set cs8.
raw (-raw or cooked)
enable (disable) raw input and output (no ERASE,
KILL, INTR, QUIT, SWTCH, EOT, or output post
processing).
nl (-nl) unset (set) icrnl, onlcr. In addition -nl unsets
inlcr, igncr, ocrnl, and onlret.
lcase (-lcase)
set (unset) xcase, iuclc, and olcuc.
LCASE (-LCASE)
same as lcase (-lcase).
tabs (-tabs or tab3)
preserve (expand to spaces) tabs when printing.
ek reset ERASE and KILL characters back to normal #
and @.
sane resets all modes to some reasonable values.
term set all modes suitable for the terminal type term,
Page 4 (last mod. 1/16/87)
stty(1) stty(1)
where term is one of tty33, tty37, vt05, tn300,
ti700, or tek.
Hardware-specific modes
modem (-modem)
Enable modem control for this device. This is
normally only turned on on lines connected to
modems. Such lines cannot be opened (see open(2))
unless the device's data carrier detect line (DCD)
is asserted by an external device such as a modem.
Not all devices support this option, refer to the
specific device's documentation for details. This
option is on by default for /dev/modem and
/dev/tty0. Since it uses the same signal line as
dtrflow and emodem (below), both of these options
cannot be used at the same time.
emodem (-emodem)
``European style'' modem control. Similar to
modem above. Refer to termio(7) for further
information.
dtrflow (-dtrflow)
hxctl (-hxctl)
Enable hardware flow control for this device using
the DCD line as input. This is normally used as a
flow control with devices such as printers. Not
all devices support this option, refer to the
specific device's documentation for details. This
option is on by default for /dev/printer and
/dev/tty1. Since it uses the same signal line as
modem and emodem (above) both of these options
cannot be used at the same time.
flow (-ow)
Enable hardware flow control using the request to
send and clear to send lines (RTS/CTS) on a serial
device. Not all devices support this option, refer
to the specific device's documentation for
details. Often it is preferable and easier to use
XON/XOFF (ixon, ixoff and ixany above) which is
supported for all devices.
They are for modem control - not all devices
support all or any them. If any are supported then
UIOCTTSTAT is supported. The default is
UIOCNOMODEM/UIOCNOFLOW. All these are
``remembered'' when a device is closed and
repoened again.
FILES
/bin/stty
SEE ALSO
tabs(1), ioctl(2), termio(7).
Page 5 (last mod. 1/16/87)