Bourne | Ash |  #!  | find | ARG_MAX | Shells | whatshell | portability | permissions | UUOC | ancient | - | ../Various | HOME
"$@" | echo/printf | set -e | test | tty defs | tty chars | $() vs ) | IFS | using siginfo | nanosleep | line charset | locale


stty defaults on various unix flavours

2011-02-27 (see recent changes)

motivation: curiosity and interest in historical correlations

In the following, ^X means <Ctrl-X>. The article <62097@bbn.BBN.COM> in alt.folklore.computers
explains a possible origin of the "^"-notation.

You can find out stty defaults by looking into <sys/ttydefaults.h>, <sys/termios.h> and alike.

On some system you can do that also with stty(1):
Historically, stty didn't know -a. But in many later implementations, calling it without arguments
shows the differences from the defaults. This doesn't apply to GNU stty, though.
"stty sane" restores a few settings to the default, but not necessarily all.

When logged in remotely with ssh(1) (instead of e.g. telnet(1)), you might not see the defaults.
ssh(1)/sshd(8) try to "export" your local settings to the remote session.
Also pay attention to shell profiles (login scripts).

Historically, the defaults are related to early teletype and video terminals.
"@" for "kill" was used before this character was introduced in mail adresses,
and "#" for "erase" was used before it became the comment character in shells.

The defaults we are used to nowadays are from 4BSD in turn.

See an article from Christian Weisgerber with some background about the BackSpace vs. Delete issue.

The (unusual) defaults on HP-UX are in accordance to the SVID3
("3. System V Interface Definition"), as mentioned in termio(7).
The SVID is an earlier standard, which obviously inherited from Version 7.

Sometimes you can explicitly unset a value by using "undef" or "\^-" as argument.
Keep in mind that an unprotected ^ is considered as a pipe symbol in traditional Bourne shells.
(Explicitly unsetting is sometimes helpful for changing "nasty" setting.)

A table with various defaults:

  
OS stty capability: intrerasesuspkilllnextquiteofcs8istripparenbstty-a
arbitrary choice: ^C DEL ^Z ^U ^V ^\ ^| ^D + + - +
6th edition (V6) <tty.h> DEL # n/a @ n/a n/a n/a n/a -
7th edition (V7) <sys/tty.h> DEL # n/a @ n/a n/a n/a n/a -
System III <termio.h> DEL # n/a @ n/a -
System V R1 <sys/tty.h> DEL # n/a @ n/a - ?
3BSD <sys/tty.h>, 4.0BSD <sys/tty.h> DEL # n/a @ n/a n/a n/a n/a -
4.1c/4.2/4.3 BSD <sys/ttychars.h> n/a n/a n/a -
4.4BSD <sys/ttydefaults.h> - +
HP-UX A.08.07-B.09.03 [hpux] DEL # ( ) @ n/a - ?
HP-UX B.10.10-B.11.22 [hpux] DEL # ( ) @ ( ) - +
SINIX V5.2 DEL ^H n/a ^X n/a ^| - +
MUNIX 3.2 (SVR3.2? ^B ^X n/a ^Y ^Z - +
FreeBSD 4.3 [freebsd] -
Linux 2.2.9 -
NetBSD 1.5 -
OpenBSD 2.9/3.1 ? - +
SunOS 3.5, 4.1.4 - +
SunOS 5.x ^| - +
Unicos 9.0.2.2 ^|
EP/IX 2.2.1AA DEL ^H ^|
IRIX 4.0.5 / 5.3 / 6.5 DEL ^H
OpenServer 5.0.6 DEL ^H ( )
UnixWare 7.1.4 DEL ^H
OSF1 V4.0, V5.1 ^H
Minix 3.1.1 ^H
AIX 3.2.5 ^H
AIX 4.3.2 ^H +
intr erasesusp kill lnext quit eof cs8 istripparenbstty -a

About the table:

Footnotes


<http://www.in-ulm.de/~mascheck/various/stty/>

Sven Mascheck