STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
-------------------------------------------------------------------------------
stty, STTY
PURPOSE
Sets, resets, or reports work station operating parameters.
SYNTAX
+-------------------------+ +------------+
stty ---| +--- specification ---+ |---| STTY ---| one of |---|
+-| ^ | |-+ | +--------+ |
| +-----------------+ | +-| -LCASE |-+
| one of | | LCASE |
| +----+ | +--------+
+-------| -a |--------+
| -g |
+----+
DESCRIPTION
The stty command sets certain work station I/O options for the device that is
the current standard input (standard output if the bsd flag is used). If you
run it without any specifications, stty writes to standard output information
about the settings of certain options on your work station.
If you list any work station specifications, stty sets or resets the specified
work station options.
The STTY command provides support for work stations with uppercase characters
only. See the LCASE option described below.
You can find detailed information about the modes listed in the following
groups in the discussion of the termio special facility in AIX Operating System
Technical Reference.
Note: The stty command does not make compatibility checks on any parameter
combinations.
FLAGS
-a Writes the current state of all System V option settings to
standard output. This is an extended version of the output
generated when stty is run with no flags.
-g Writes option settings to standard output in a form usable by
another stty command.
Processed November 8, 1990 STTY, STTY(1,C) 1
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
all Reports normally used option settings in bsd format.
bsd Causes standard output to be used for settings; standard error is
used for the report.
Note: If the bsd flag is used, it must be the first flag.
everything Prints everything stty knows in bsd format.
size Prints the terminal (window) sizes on standard output, first rows
and then columns.
speed Prints only the terminal speed on standard output.
SPECIFICATIONS
The AIX terminal driver supports modes that are a superset of those provided by
System V and by BSD. The stty command also supports output formats that are
compatible with both systems. There are several different output formats
generated by different flags.
The stty command with no flags reports on those control modes that differ from
the system defaults.
The "stty -a" command reports on many modes in a System-V compatible format.
Control modes added by BSD do not appear in the report. The interrupt, quit,
erase, kill, eof and eol characters are displayed. The states of the modes
listed below under the headings "Control Modes", "Input Modes", "Output Modes",
"Local Modes" and "Paging Modes" are displayed. "Line = 0" indicates the old
line discipline is in use, while "Line = 2" indicates the new line is in use.
The terminal maps are also displayed.
The "stty all" command displays commonly-used terminal modes in a
BSD-compatible format. The line discipline, line speed, tab settings, paging
modes, and the state of all special characters are displayed.
The "stty everything" displays all terminal modes in a BSD-compatible format.
The line discipline, line speed, all modes listed below under the heading "Job
Control Modes", and all special characters are displayed.
Control Modes
The following options apply only when your work station connects to the system
through an asynchronous line adapter. See asy in AIX Operating System
Technical Reference for detailed information about this group.
parenb (-parenb) Enables (disables) parity generation and detection.
parodd (-parodd) Selects odd (even) parity.
Processed November 8, 1990 STTY, STTY(1,C) 2
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
cs5 cs6 cs7 cs8 Selects character size. See termio in AIX Operating System
Technical Reference for additional information on character
size.
0 Hangs up phone line immediately.
0 50 75 110 134 150 300 600 1200 1800 2400 4800 9600 19200 19.2 38400 38.4 exta
extb
Sets the work station speed to the specified number of bits
per second (exta, 19200, and 19.2 are synonyms; extb, 38400,
and 38.4 are synonyms). Regardless of the baud rate, the
software only works with terminals that generate the ASCII
character set.
hupcl (-hupcl)
hup (-hup) Hangs up (does not hang up) dial-up connection on the last
close.
cstopb (-cstopb) Selects 2 (1) stop bits per character.
The next two options apply to all work stations, regardless of the line
adapter:
cread (-cread) Enables (disables) the receiver.
clocal (-clocal) Assumes a line without (with) modem control.
Input Modes
ignbrk (-ignbrk) Ignores (does not ignore) BREAK on input.
brkint (-brkint) Signals (does not signal) INTR on break.
cbreak Makes each character available to the read system call as
received; no erase or kill processing, but all other
processing (such as interrupt and suspend) is performed.
-cbreak Makes characters available to read only when a newline is
received.
ignpar (-ignpar) Ignores (does not ignore) parity errors.
parmrk (-parmrk) Marks (does not mark) parity errors.
inpck (-inpck) Enables (disables) input parity checking.
istrip (-istrip) Strips (does not strip) input characters to 7 bits.
inlcr (-inlcr) Maps (does not map) NL to CR on input.
Processed November 8, 1990 STTY, STTY(1,C) 3
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
igncr (-igncr) Ignores (does not ignore) CR on input.
icrnl (-icrnl) Maps (does not map) CR to NL on input.
iuclc (-iuclc) Maps (does not map) uppercase alphabetic characters to
lowercase.
ixon (-ixon) Enables (disables) START/STOP output control. Once
START/STOP output control has been enabled, you can pause
output to the work station by pressing Ctrl-S and resume
output by pressing Ctrl-Q.
ixany (-ixany) Allows any character (only Ctrl-Q) to restart output.
ixoff (-ixoff) Sends (does not send) START/STOP characters when the input
queue is nearly empty/full.
Output Modes
opost (-opost) Processes output (does not process output; that is, it
ignores all other output options).
olcuc (-olcuc) Maps (does not map) lowercase alphabetic characters to
uppercase on output.
onlcr (-onlcr) Maps (does not map) NL characters to CR-NL characters.
ocrnl (-ocrnl) Maps (does not map) CR-NL characters to NL characters.
onocr (-onocr) Does not (does) output CR characters at column zero.
onlret (-onlret) On the terminal, NL performs (does not perform) the CR
function.
ofill (-ofill) Uses fill characters (uses timing) for delays.
ofdel (-ofdel) Uses DEL (NUL) characters for fill characters.
cr0 cr1 cr2 cr3 Selects style of delay for CR characters.
nl0 nl1 Selects style of delay for NL characters.
tab0 tab1 tab2 tab3
Selects style of delay for horizontal tabs.
bs0 bs1 Selects style of delay for backspaces.
ff0 ff1 Selects style of delay for form feeds.
vt0 vt1 Selects style of delay for vertical tabs.
Processed November 8, 1990 STTY, STTY(1,C) 4
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
Local Modes
isig (-isig) Enables (disables) the checking of characters against the
special control characters INTR and QUIT.
icanon (-icanon) Enables (disables) canonical input (canonical input allows
input-line editing with the ERASE and KILL characters).
xcase (-xcase) Echoes (does not echo) uppercase characters on input, and
displays uppercase characters on output with a preceding \
(backslash).
echo (-echo) Echoes (does not echo) every character typed.
echoe (-echoe) Echoes (does not echo) the ERASE character as the
backspace-space-backspace string.
Note: This mode does not keep track of column position, so
you may get unexpected results when erasing tabs and
escape sequences.
echok (-echok) Echoes (does not echo) a NL character after a KILL character.
lfkc (-lfkc) Functions the same as echok. This is an obsolete mode.
echonl (-echonl) Echoes (does not echo) the NL character.
noflsh (-noflsh) Does not clear (does clear) buffers after INTR or QUIT.
stwrap (-stwrap) Disables (enables) truncation of lines longer than 79
characters on a synchronous line.
stflush (-stflush)
Enables (disables) flush on a synchronous line after every
write.
stappl (-stappl) Uses application mode (uses line mode) on a synchronous line.
xscan (-xscan) Turns on or off scan code processing.
Control Assignments
Except for the min and time options, the following options allow you to specify
which characters you must type to perform line editing and other special
functions from your workstation. If -c is specified as -u, undef or -, the
special function is disabled. A value of x (a two-character sequence) is
interpreted as a control character. The two characters ^? can be used to
represent DEL.
The stty command displays control characters as a ^ (caret) followed by another
character. Depending on the output format selected, the character following
the caret is chosen from a set of ASCII characters which includes the uppercase
Processed November 8, 1990 STTY, STTY(1,C) 5
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
letters, or from a set of ASCII characters which includes the lowercase
letters. For instance, Ctrl-A may be displayed as either ^a or ^A. The
special case of having an undefined setting for a control function is displayed
as a blank space or as either ^@ or ^'.
erase c Sets erase character to c. (The default is ^H.)
kill c Sets kill character to c. (The default is ^U.)
intr c Sets interrupt character to c. (The default is DEL or ^?
(delete).
quit c Sets quit character to c. (The default is ^V.)
start c Sets start character to c. (The default is ^Q.)
stop c Sets stop character to c. (The default is ^S.)
eof c Sets end-of-file character to c. (The default is ^D.)
eol c Sets end-of-line character to c. (The default is undefined.)
brk c Sets break character to c. (The default is undefined). This
character is an additional character causing wakeup.
nextpg c If the page mode is enabled, resumes output when this
character is typed after the screen has filled. The default
value for this character is space. This character is
recognized as special only when output has been stopped.
pgoff c If the page mode is enabled, resumes output when this
character is typed after the screen has filled, and
temporarily disables paging mode until another input
character is typed and read. The default values for this
character is Ctrl-M (new line). Like nextpg, this character
is recognized as special only when output has been stopped.
stat c Displays the following information: (The default is Ctrl-T.)
System Name
Topology Indicates whether TCF is reconfiguring the
network topology.
Uptime Indicates how long the system has been up.
Load Average One-minute load average.
SPL Percentage of time system is running at
elevated priority level.
SVR Percentage of time system is spending servicing
TCF network messages.
Idle Percentage of time system is found no runnable
processes.
susp c Sets suspend process character to c. The default is Ctrl-Z.
Warning: If you are using the Bourne shell, entering the
suspend process character causes you to log out.
dsusp c Sets delayed suspend process character to c. (The default is
Ctrl-Y).
Warning:
The delayed suspend character is not interpreted by AIX.
Processed November 8, 1990 STTY, STTY(1,C) 6
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
rprnt c Sets reprint line character to c. (The default is Ctrl-R.)
flush c Sets flush output character to c. (The default is Ctrl-O.)
werase c Sets word erase character to c. (The default is Ctrl-W.)
lnext c Sets literal next character to c. (The default is
undefined.)
min c Used with -icanon; a read request is not satisfied until at
least c characters have been received or the timeout value
specified by time has expired since the last character was
received.
time c Used with -icanon; a read request is not satisfied until the
timeout value specified by c has expired since the last
character was received or at least min characters have been
received.
Paging Options
page (-page) Pauses (does not pause) during output after each screen
displayed. Typing any character during the pause causes
output to resume. Typing a carriage return during the pause
causes output to continue uninterrupted until the next
command is entered.
length n Sets screen length to n lines, where n is an integer from 1
through 255. An automatic pause in output occurs after n
lines if page is enabled.
row n Records the terminal size as having n rows.
columns n Records the terminal size as having n columns.
cols n Is an alias for columns.
erasbell (-erasbell)
Rings (does not ring) the terminal bell whenever a
character-erase, word-erase, or line-kill character is typed
when there is no pending input to erase.
pgcbrk (-pgcbrk) Stops (does not stop) output when the screen is full when in
cbreak mode. This option does not affect cooked mode
operation.
pgbell (-pgbell) Rings (does not ring) the terminal bell when output stops on
a full screen.
Combination Modes
Processed November 8, 1990 STTY, STTY(1,C) 7
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
evenp | parity Enables parenb and cs7.
oddp Enables parenb, cs7, and parodd.
-parity, -evenp, -oddp
Disables parenb and sets cs8.
raw (-raw | cooked) Enables (disables) raw input and output (no ERASE, KILL,
INTR, QUIT, EOT, or output processing).
nl (-nl) Unsets (sets) icrnl and onlcr. Specifying -nl sets icrnl
and onlcr and also unsets inlcr, igncr, ocrnl, and onlret.
lcase (-lcase)
LCASE (-LCASE) Sets xcase, iuclc, and olcuc. (Used for work stations
with uppercase characters only.)
tabs (-tabs | tab3) Preserve tabs (expand to spaces) when printing.
ek Sets ERASE and KILL characters to # and @, respectively.
sane Resets parameters to "reasonable" values.
term Sets all parameters according to work station type term,
where term is one of tty33, tty37, vt05, tn300, ti700, or
tek.
even (-even) Allows (disallows) even parity output.
odd(-odd) Allows (disallows) odd parity output.
tandem(-tandem) Enables (disables) flow control so that the system sends
out the stop character when its internal queue is in
danger of overflowing on input, and sends the start
character when it is ready to accept further input.
Terminal Mapping
imap mapname Loads /etc/nls/termmap/mapname.in as the terminal input map.
omap mapname Loads /etc/nls/termmap/mapname.out as the terminal output
map.
Job Control Modes
new Switches to the BSD new tty driver line discipline (switching
flushes typeahead).
old Switches to the default tty driver line discipline (switching
flushes typeahead).
Processed November 8, 1990 STTY, STTY(1,C) 8
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
The following options apply only when the new tty driver line discipline is
being used:
crt Sets options for a CRT (crtbs, ctlecho, and, if => 1200 baud,
crterase and crtkill).
crtbs Echoes backspaces on erase characters.
prterase Echoes erased characters backwards within "\" and "/" for a
printing terminal.
crterase (-crterase)
Wipes out (leaves visible) erased characters with
backspace-space-backspace.
crtkill (-crtkill)
Wipes out (leaves visible) input on kill (like crterase).
ctlecho (-ctlecho)
Echoes (does not echo) control characters as "^x" and delete
as "^?" (as themselves). Prints (does not print) two
backspaces following the EOT character (Ctrl-D).
decctlq (-decctlq)
After output is suspended, only a start character (any
character typed) will restart it.
Note: decctlq is the same as ixany; -decctlq is the same as
-ixany.
tostop (-tostop) Stops background jobs (allows background jobs to proceed) if
they attempt terminal output.
tilde (-tilde) Converts (does not convert) a tilde (~) to a
backslash-circumflex (\^) on output for Hazeltine terminals.
(Not implemented.)
flusho (-flusho) Discards (does not discard) output usually because Ctrl-D is
pressed (internal state bit).
pendin (-pendin) Input is (is not) pending after a switch from cbreak to
cooked and will be re-input when a read becomes pending or
more input arrives (internal state bit).
mdmbuf (-mdmbuf) Starts (stops) output on carrier transitions (returns error
is write attempted after carrier drops). (Not implemented.)
litout (-litout) Sends ouput characters without any processing (does normal
output processing).
Processed November 8, 1990 STTY, STTY(1,C) 9
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
nohang (-nohang) Does not send (does send) hangup signal to the control
process group when carrier drops.
etxack (-etxack) Enables (disables) Diablo type etx/ack handshaking. (Not
implemented.)
pass8 (-pass8) Passes (does not pass) all 8 bits on input, in any mode. If
-pass8 is used, the 0200 bit is stripped on input except in
raw mode.
EXAMPLES
1. To display a short listing of your work station configuration:
stty
This lists settings that differ from the defaults.
2. To display a full listing of your work station configuration:
stty -a
3. To enable a key sequence that stops listings from scrolling off the
screen:
stty ixon ixany
This sets ixon mode, which lets you stop runaway listings by pressing
Ctrl-S. The "ixany" parameter allows you to resume the listing by pressing
any key. The normal work station configuration includes "ixon" and
"-ixany", which allows you to stop a listing with Ctrl-S, but only Ctrl-Q
will restart it.
4. To prevent all listings from scrolling off the screen:
stty page length 24
This sets "page" mode with a page (screen) length of "24" lines. When a
listing is more than 24 lines long, the system pauses after each page. It
beeps, reminding you to press any key (except the carriage return) to view
the next page. Press the carriage return to let the rest of the listing
scroll off the screen and get to the end. Paging then resumes with the
next listing.
5. To reset the configuration after it has been altered:
Ctrl-J stty sane echoe -tabs Ctrl-J
Sometimes the information displayed on the screen may look strange, or the
system will not respond when you press the Enter key. This can happen when
you use stty with parameters that are incompatible or that do things you do
not understand. It can also happen when a screen-oriented text editor ends
Processed November 8, 1990 STTY, STTY(1,C) 10
STTY, STTY(1,C) AIX Commands Reference STTY, STTY(1,C)
abnormally and does not have a chance to reset the work station
configuration.
Entering "stty sane" sets a reasonable configuration, but it may differ
slightly from your normal configuration. That is why this example also
includes two commonly used parameters, "echoe" (erases characters as you
backspace over them) and "-tabs" (expand tab characters to spaces on the
display screen).
Press Ctrl-J before and after the command instead of Enter. The system
usually recognizes Ctrl-J when the parameters that control the Enter key
processing have been confused.
6. To save and restore the work station's configuration:
OLDCONFIG=`stty -g` # save configuration
stty -echo # do not display password
echo "Enter password: \c"
read PASSWD # get the password
stty $OLDCONFIG # restore configuration
This saves the work station's configuration, turns off echoing, reads a
password, and restores the original configuration. The "`...`" (grave
accents) in the first command tell the shell to insert the standard output
of "stty -g" into the "OLDCONFIG=..." command. This is called command
substitution. For more information, see "Command Substitution."
The "stty -echo" turns off echoing, which means that the password does not
appear on the screen when you type it at the keyboard. This has nothing to
do with the echo command, which displays a message on the screen.
RELATED INFORMATION
See the following command: "tabs."
See the ioctl system call and the termio special file in AIX Operating System
Technical Reference.
See the discussion of stty and the "Introduction to International Character
Support" in Managing the AIX Operating System.
Processed November 8, 1990 STTY, STTY(1,C) 11