Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tset(1) — UNIX 2.8BSD

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

setenv(1)

ttytype(5)

termcap(5)

stty(1)

TSET(1)  —  UNIX Programmer’s Manual

NAME

tset − set terminal modes

SYNOPSIS

tset [ − ] [ −hrsuIQS ] [ −e[c] ] [ −E[c] ] [ −k[c] ]
[ −m [ident][test baudrate]:type ] [ type ]

DESCRIPTION

Tset causes terminal dependent processing such as setting erase and kill characters, setting or resetting delays, and the like.  It is driven by the /etc/ttytype and /etc/termcap files. 

The type of terminal is specified by the type argument.  The type may be any type given in /etc/termcap.  If type is not specified, the terminal type is read from /etc/htmp (the home directory and terminal type database), or the environment TERM, unless the −h flag is set or any −m argument was given.  In this case the type is read from /etc/ttytype (the port name to terminal type database).  The port name is determined by a ttyname(3) call on the diagnostic output. If the port is not found in /etc/ttytype the terminal type is set to unknown. 

Ports for which the terminal type is indeterminate are identified in /etc/ttytype as dialup, plugboard, etc.  The user can specify how these identifiers should map to an actual terminal type.  The mapping flag, −m, is followed by the appropriate identifier (a 4 character or longer substring is adequate), an optional test for baud rate, and the terminal type to be used if the mapping conditions are satisfied.  If more than one mapping is specified, the first correct mapping prevails.  A missing identifier matches all identifiers.  Baud rates are specified as with stty(1), and are compared with the speed of the diagnostic output.  The test may be any combination of: >, =, <, @, and !.  (Note: @ is a synonym for = and !  inverts the sense of the test. Remember to escape characters meaningful to the shell.) 

If the type as determined above begins with a question mark, the user is asked if s/he really wants that type.  A null response means to use that type; otherwise, another type can be entered which will be used instead.  (The question mark must be escaped to prevent filename expansion by the shell.) 

On terminals that can backspace but not overstrike (such as a CRT), and when the erase character is the default erase character (‘#’ on standard systems), the erase character is changed to a Control-H (backspace).  The −e flag sets the erase character to be the named character c on all terminals, so to override this option one can say −e#.  The default for c is the backspace character on the terminal, usually Control-H.  The −E flag is identical to −e except that it only operates on terminals that can backspace; it might be used if you had the misfortune to be stuck with an ASR33.  The −k option works similarly, with c defaulting to Control-X.  No kill processing is done if −k is not specified.  In all of these flags, “^X” where X is any character is equivalent to control-X. 

On version 6 systems, the terminal type specified in htmp is updated unless −u is specified. 

The − option prints the terminal type on the standard output; this can be used to get the terminal type by saying:
set termtype = `tset -`
If no other options are given, tset operates in “fast mode” and only outputs the terminal type, bypassing all other processing.  The −s option outputs “setenv” commands (if your default shell is csh) or “export” and assignment commands (if your default shell is the Bourne shell); the −S option only outputs the strings to be placed in the environment variables.  The −s option can be used as:
`tset -s ...`
Actually, this is not possible because of a problem in the shell. Instead, if you are using the Bourne shell, use:

tset -s ... > /tmp/tset$$
/tmp/tset$$
rm /tmp/tset$$

If you are using csh, use:

set noglob
set term=(‘tset -S ....‘)
setenv TERM $term[1]
setenv TERMCAP "$term[2]"
unset term
unset noglob

The −r option prints the terminal type on the diagnostic output.  The −Q option supresses printing the “Erase set to” and “Kill set to” messages.  The −I option supresses outputting the terminal initialization strings. 

Tset is most useful when included in the .login (for csh(1)) or .profile (for sh(1)) file executed automatically at login, with −m mapping used to specify the terminal type you most frequently dial in on. 

EXAMPLES

tset gt42
tset −mdialup\>300:adm3a −mdialup:dw2 −Qr −e#
tset −m dial:ti733 −m plug:\?hp2621 −m unknown:\? −e −k^U

FILES

/etc/htmpTerminal type database (version 6 only)
/etc/ttytypePort name to terminal type map database
/etc/termcapTerminal capability database

SEE ALSO

setenv(1), ttytype(5), termcap(5), stty(1)

AUTHOR

Eric P. Allman

NOTES

For compatibility with earlier versions of tset, the following flags are accepted and mapped internally as shown:

-d type   ->   -m dialup:type
-p type   ->   -m plugboard:type
-a type   ->   -m arpanet:type

These flags will disappear eventually. 

7th Edition  —  7/11/80

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026