.\" Copyright (c) 1990, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\" %sccs.include.redist.man%
.\" @(#)stty.1 8.3 (Berkeley) %G%
.Nd set the options for a terminal device interface
utility sets or reports on terminal
characteristics for the device that is its standard input.
If no options or operands are specified, it reports the settings of a subset
of characteristics as well as additional ones if they differ from their
the terminal state according to the specified arguments.
Some combinations of arguments are mutually
exclusive on some terminal types.
The following options are available:
Display all the current settings for the terminal to standard output
Display all the current settings for the terminal to standard output
``all'' and ``everything'' formats.
Open and use the terminal named by
rather than using standard input. The file is opened
set or display settings on a terminal that might otherwise
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
to restore the current terminal state as per
The following arguments are available to set the terminal
Control mode flags affect hardware characteristics associated with the
terminal. This corresponds to the c_cflag in the termios structure.
.It Cm parenb Pq Fl parenb
Enable (disable) parity generation
.It Cm parodd Pq Fl parodd
Select odd (even) parity.
Select character size, if possible.
Set terminal baud rate to the
number given, if possible.
baud rate is set to zero, modem
Set terminal input baud rate to the
number given, if possible.
input baud rate is set to zero, the
input baud rate is set to the
Set terminal output baud rate to
the number given, if possible.
the output baud rate is set to
Stop asserting modem control
(do not stop asserting modem control) on last close.
.It Cm cstopb Pq Fl cstopb
Use two (one) stop bits per character.
Enable (disable) the receiver.
.It Cm clocal Pq Fl clocal
Assume a line without (with) modem
.It Cm crtscts Pq Fl crtscts
Enable RTS/CTS flow control.
This corresponds to the c_iflag in the termios structure.
.It Cm ignbrk Pq Fl ignbrk
Ignore (do not ignore) break on
.It Cm brkint Pq Fl brkint
.It Cm ignpar Pq Fl ignpar
Ignore (do not ignore) parity
.It Cm parmrk Pq Fl parmrk
Mark (do not mark) parity errors.
Enable (disable) input parity
.It Cm istrip Pq Fl istrip
Strip (do not strip) input characters
Output from the system is
stopped when the system receives
and started when the system
is set, any character restarts output.
Request that the system send (not
the input queue is nearly
Allow any character (allow only
.It Cm imaxbel Pq Fl imaxbel
The system imposes a limit of
(currently 255) characters in the input queue. If
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,
is unset and the input queue is full, the next input character causes
the entire input and output queues to be discarded.
This corresponds to the c_oflag of the termios structure.
Post-process output (do not
post-process output; ignore all other
.It Cm oxtabs Pq Fl oxtabs
Expand (do not expand) tabs to spaces on output.
Local mode flags (lflags) affect various and sundry characteristics of terminal
Historically the term "local" pertained to new job control features
implemented by Jim Kulp on a
Later the driver ran on the first
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
Enable (disable) the checking of
characters against the special control
.It Cm icanon Pq Fl icanon
Enable (disable) canonical input
.It Cm iexten Pq Fl iexten
Enable (disable) any implementation
defined special control characters
not currently controlled by icanon,
Echo back (do not echo back) every
not) visually erase the last character
in the current line from the
.It Cm echoke Pq Fl echoke
the current line from the
.It Cm echonl Pq Fl echonl
.It Cm echoctl Pq Fl echoctl
is set, echo control characters as ^X. Otherwise control characters
.It Cm echoprt Pq Fl echoprt
For printing terminals. If set, echo erased characters backwards within ``\\''
and ``/''. Otherwise, disable this feature.
.It Cm noflsh Pq Fl noflsh
Disable (enable) flush after
.It Cm tostop Pq Fl tostop
for background output. This causes background jobs to stop if they attempt
.It Cm altwerase Pq Fl altwerase
Use (do not use) an alternate word erase algorithm when processing
This alternate algorithm considers 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
.It Cm mdmbuf Pq Fl mdmbuf
If set, flow control output based on condition of Carrier Detect. Otherwise
writes return an error if Carrier Detect is low (and Carrier is not being
.It Cm flusho Pq Fl flusho
Indicates output is (is not) being discarded.
.It Cm pendin Pq Fl pendin
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
.It Ar control-character Ar string
If string is a single character,
the control character is set to
two character sequence "^-" or the
string "undef" the control character
.Pf { Dv _POSIX_VDISABLE Ns } . )
Recognized control-characters:
.Bd -ragged -offset indent
.Bl -column character Subscript
.It character Subscript Description
.It _________ _________ _______________
.It eof Ta Tn VEOF EOF No character
.It eol Ta Tn VEOL EOL No character
.It eol2 Ta Tn VEOL2 EOL2 No character
.It erase Ta Tn VERASE ERASE No character
.It werase Ta Tn VWERASE WERASE No character
.It intr Ta Tn VINTR INTR No character
.It kill Ta Tn VKILL KILL No character
.It quit Ta Tn VQUIT QUIT No character
.It susp Ta Tn VSUSP SUSP No character
.It start Ta Tn VSTART START No character
.It stop Ta Tn VSTOP STOP No character
.It dsusp Ta Tn VDSUSP DSUSP No character
.It lnext Ta Tn VLNEXT LNEXT No character
.It reprint Ta Tn VREPRINT REPRINT No character
.It status Ta Tn VSTATUS STATUS No character
Set the value of min or time to
Non-Canonical mode input processing
characteristics to the saved settings
.It Cm evenp No or Cm parity
Enable parenb and cs7; disable
Enable parenb, cs7, and parodd.
.It Fl parity , evenp , oddp
Disable parenb, and set cs8.
-nl unsets inlcr and igncr.
Resets all modes to reasonable values for interactive terminal use.
Set the line discipline to the standard terminal line discipline
Set (disable) all modes suitable for a CRT display device.
.It Cm kerninfo Pq Fl kerninfo
Enable (disable) the system generated status line associated with
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 waiting on (or the status of the process), the user
and system times, percent cpu, and current memory usage.
The terminal size is recorded as having
The terminal size is recorded as having
Set modes suitable for users of Digital Equipment Corporation systems (
characters are set to ^?, ^U, and ^C;
.It Cm extproc Pq Fl extproc
If set, this flag indicates that some amount of terminal processing is being
performed by either the terminal hardware or by the remote side connected
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
bit, it is not possible to intuit what flags were set prior to setting
This means that unsetting
may not put back all the setting that were previously in effect.
To set the terminal into a raw state and then accurately restore it, the following
shell code is recommended:
The size of the terminal is printed as two numbers on a single line,
first rows, then columns.
These modes remain for compatability with the previous version of
Reports all the terminal modes as with
except that the control characters are printed in a columnar format.
.Cm brkint , ixon , imaxbel , opost ,
.It Cm newcrt Pq Fl newcrt
.It Cm tandem Pq Fl tandem
.It Cm decctlq Pq Fl decctlq
.It Cm crterase Pq Fl crterase
.It Cm crtkill Pq Fl crtkill
.It Cm ctlecho Pq Fl ctlecho
.It Cm prterase Pq Fl prterase
.It Cm litout Pq Fl litout
Same as the control character
Same as the control character
Same as the control character
utility exits with a value of 0 if successful, and >0 if an error occurs.
function is expected to be
extensions to the standard.