STTY(1-SysV) RISC/os Reference Manual STTY(1-SysV)
NAME
stty - set the options for a terminal
SYNOPSIS
stty [ -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.
In this discussion, if a character is preceded by a caret
(^), then the value of that option is the corresponding CTRL
character (e.g., ``^h'' is CTRL-h ; in this case, recall
that CTRL-h is the same as the ``back-space'' key.) The
sequence ``^''' means that an option has a null value. For
example, normally stty -a will report that the value of
swtch is ``^'''.
-a reports all of the option settings;
-g reports current settings in a form that
can be used as an argument to another
stty command.
Options in the last group are implemented using options in
the previous groups. Note that many combinations of options
make no sense, but no sanity 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.
110 300 600 1200 1800 2400 4800 9600 19200 38400
Set terminal baud rate to the number
given, if possible. (All speeds are not
supported by all hardware interfaces.)
hupcl (-hupcl) hang up (do not hang up) Dataphone con-
nection on last close.
hup (-hup) same as hupcl (-hupcl).
cstopb (-cstopb) use two (one) stop bits per character.
cread (-cread) enable (disable) the receiver.
clocal (-clocal) n assume a line without (with) modem
control.
loblk (-loblk) block (do not block) output from a non-
current layer.
mdmbuf (-mdmbuf) enable (disable) blocking of output when
carrier (CD) drops and resuming of out-
put when carrier rises, if the
Printed 1/15/91 Page 1
STTY(1-SysV) RISC/os Reference Manual STTY(1-SysV)
controller supports this facility.
rtscts (-rtscts) enable (disable) RTS/CTS handshaking.
RTS is raised when input can be
accepted, lowered when input queue is
nearly full. Output is stopped when CTS
is lowered and resumed when CTS is high.
Supported only if the controller sup-
ports this facility.
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 con-
trol. Output is stopped by sending an
ASCII DC3 and started by sending an
ASCII DC1. (The start and stop charac-
ters may be changed from the defaults as
discussed below.)
ixany (-ixany) allow any character (only DC1) to res-
tart 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) 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
Page 2 Printed 1/15/91
STTY(1-SysV) RISC/os Reference Manual STTY(1-SysV)
(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 charac-
ters against the special control charac-
ters 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 char-
acter typed.
echoe (-echoe) echo (do not echo) ERASE character as a
backspace-space-backspace string. Note:
this mode will erase the ERASEed charac-
ter 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 back-
spaces.
echok (-echok) echo (do not echo) NL after KILL charac-
ter.
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.
tostop (-tostop) disable (enable) sending of SIGTTOU on
background output. (Applies only to
line disciplines 1 and 2.)
stwrap (-stwrap) disable (enable) truncation of lines
longer than 79 characters on a synchro-
nous line.
stflush (-stflush) enable (disable) flush on a synchronous
line after every write(2).
stappl (-stappl) use application mode (use line mode) on
a synchronous line.
ctlecho (-ctlecho) echo (do not echo) control characters as
"^x", where "x" is the character with
0x40 OR'ed in. (Applies only to line
discipline 2.)
prterase (-prterase)
echo (do not echo) erased characters
with a " sequence, where "x" is the
character or characters erased.
Printed 1/15/91 Page 3
STTY(1-SysV) RISC/os Reference Manual STTY(1-SysV)
(Applies only to line discipline 2.)
flusho (-flusho) output is (not) being flushed, until
this flag is toggled. Flag is toggled
explicitly or via receipt of the "flush"
character. (Applies only to line dis-
cipline 2.)
crtbs (-crtbs) Backspace (do not backspace) on erase,
instead of echoing the erase character.
Also, if crtbs is enabled, and echok is
also enabled, kill erases the entire
line, instead of echoing a new line.
(Applies to line discipline 2 only.
Line discipline 0 always echoes the
erase character; line discipline 1
always backspaces.)
pendin (-pendin) Retype (do not retype) pending input at
next read or input character. (Applies
only to line discipline 2.)
Control Assignments
Control character options are of the form
control-character c
and set the specified control-character to c, where
control-character is erase, kill, intr, quit, swtch, eof,
ctab, min, or time. Also, in line discipline 1 or 2,
control-character may be start, stop, susp, dsusp, rprnt,
flush, werase, lnext, or status. (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) caret (^),
then the value used is the corresponding CTRL character
(e.g., ``^d'' is a CTRL-d); ``^?'' is interpreted as DEL
and ``^-'' is interpreted as undefined (0377). Note that if
-istrip and -parenb are set, then it is possible for an 0377
character be processed as input, and it will be interpreted
as a control character which has been set to "undefined",
unless the system control variable posixvdisable is set;
see kopt(8). If posixvdisable is set, an 0377 input char-
acter will never be interpreted as a character. (The
posixvdisable option is set by default, but may be changed
by a system administrator.)
erase c The erase character erases the last
input character on the current input
line not yet erased. The default char-
acter is '#', but is often set to ^H.
It is so interpreted only if icanon is
set.
kill c The kill character erases all of the
current input line. The default charac-
ter is '@', but is often set to ^U. It
Page 4 Printed 1/15/91
STTY(1-SysV) RISC/os Reference Manual STTY(1-SysV)
is so interpreted only if icanon is set.
intr c The intr character sends SIGKILL to the
current foreground terminal process
group. The default character is DEL
(0177, ^?), but is often set to ^C. It
is so interpreted only if isig is set.
quit c The quit character sends SIGQUIT to the
current foreground terminal process
group. The default character is
Control-\ (034). It is so interpreted
only if isig is set.
eof c The eof character terminates the current
input line (if not empty), and produces
an end-of-file indication when read. (In
line discipline 2, the eof character
only terminates the current input line
if the current input line is not empty.
That is, it produces an end-of-file
indication (other than a line not ter-
minated by an end-of-line character)
only if there is no pending partial
input line.) The default character is
Control-D. The eof character is signi-
ficant only if icanon is set.
eol c The eol character terminates the current
input line, and is appended to that
line. The default character is LF
(012). The eol character is significant
only if icanon is set.
min c The numeric value of the min character
is taken as the minimum number of char-
acters required before input is returned
to a read request. It is so interpreted
only if -icanon is set.
time c The numeric value of the time character
is taken as the maximum time (in units
of 0.01 seconds) for which pending input
should be buffered before being returned
to a pending read. It is so interpreted
only if -icanon is set.
start c The start character is the character
which is interpreted to resume the flow
of data ("XON"). The default value is
Control-Q. It is interpreted on input,
to resume output, only if ixon is set
and ixany is not set. It is transmitted
to resume input only if ixoff is set.
stop c The stop character is the character
which is intrepreted to suspend the flow
of data ("XOFF"). The default value is
Control-S. It is interpreted on input,
to suspend output, only if ixon is set.
Printed 1/15/91 Page 5
STTY(1-SysV) RISC/os Reference Manual STTY(1-SysV)
It is transmitted to suspend input only
if ixoff is set.
susp c The susp character sends SIGTSTP to the
foreground terminal process group. It
is disabled by default, but the conven-
tional choice when enabled is Control-Z.
It is interpreted only in line discip-
lines 1 and 2, and then only if isig is
set.
dsusp c The dsusp character sends SIGTSTP to the
foreground terminal process group, when
input is next read. It is disabled by
default, but the conventional choice
when enabled is Control-Y. It is inter-
preted only in line disciplines 1 and 2,
and then only if isig is set.
rprnt c The rprnt character prints a newline and
retypes the current partial input line.
The default character is Control-R. It
is interpreted only in line disciplines
1 and 2, and then only if icanon is set.
flush c The flush character toggles whether out-
put is discarded. It is interpreted only
in line disciplines 1 and 2, and then
only if icanon is set. The default
character is Control-O. In line discip-
line 1, the discarding of output is ter-
minated when all currently buffered out-
put has been discarded.
werase c The werase character erases the previous
word (where a word is any sequence of
non-blank characters preceded one or
more blank characters, and where a blank
character is a space or TAB character).
The default character is Control-W. It
is interpreted only in line disciplines
1 and 2, and then only if icanon is set.
The manner in which the erasing is
echoed is the same as for the erase
character.
lnext c The lnext character indicates that the
next character should be taken as ordi-
nary input, without interpretation. The
default character is '\' in line discip-
line 0 and Control-V in line disciplines
1 and 2.
status c The status character causes the status
of a currently active member of the
foreground terminal process group (with
preference given first to running, then
to sleeping, and then to other
processes) to be printed on the
Page 6 Printed 1/15/91
STTY(1-SysV) RISC/os Reference Manual STTY(1-SysV)
terminal. This character is disabled by
default. It is interpreted only in line
discipline 2, and then only if icanon is
set.
line i set line discipline to i (0 < i < 127 ).
Line discipline 0 is the traditional
UNIX line discipline. Line discipline 1
adds a number of additional control
characters, as noted above. Line dis-
cipline 2 is closely comparable to the
4.3 BSD "new" terminal line discipline.
Saved Modes
The modes saved-opost (-saved-opost), saved-isig
(-saved-isig), saved-isig (-saved-isig), saved-icanon
(-saved-icanon), saved-iuclc (-saved-iuclc), saved-olcuc
(-saved-olcuc), saved-icrnl (-saved-icrnl), saved-onlcr
(-saved-onlcr), saved-xcase (-saved-xcase) saved-igncr
(-saved-igncr) saved-inlcr (-saved-inlcr) saved-brkint
(-saved-brkint) saved-raw (-saved-raw) saved-cbreak
(-saved-cbreak) saved-crmod (-saved-crmod) and saved-lcase
(-saved-lcase) are used in the emulation of 4.3 BSD terminal
ioctl operations. Ordinarily, there is no need to modify
any of them directly.
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 pro-
cessing).
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,
where term is one of tty33, tty37, vt05, tn300,
ti700, or tek.
SEE ALSO
ioctl(2) in the Programmer's Reference Manual.
termio(7) in the System Administrator's Reference Manual.
Printed 1/15/91 Page 7
STTY(1-SysV) RISC/os Reference Manual STTY(1-SysV)
kopt(8) in the System Administrator's Reference Manual.
Page 8 Printed 1/15/91