SYNOPSIS
tset
[
reset
[
DESCRIPTION
tset initializes terminals.
-
The terminal argument specified on the command line.
-
The value of the TERM environmental variable.
-
(BSD systems only.) The terminal type associated with the standard error output device in the /etc/ttys file. On Linux and System-V-like UNIXes, getty does this job by setting TERM according to the type passed to it by /etc/inittab.)
-
The default terminal type, "unknown".
If the terminal type was not specified on the command line,
the
Once the terminfo entry is retrieved, the window size, backspace, interrupt and line kill characters (among many other things) are set and the terminal and tab initialization strings are sent to the standard error output. Finally, if the erase, interrupt and line kill characters have changed, or are not set to their default values, their values are displayed to the standard error output.
When invoked as reset, tset sets cooked and echo modes, turns off cbreak and raw modes, turns on newline translation and resets any unset special characters to their default values before doing the terminal initialization described above. This is useful after a program dies leaving a terminal in an abnormal state. Note, you may have to type
<LF>reset<LF>
(the line-feed character is normally control-J) to get the terminal to work, as carriage-return may no longer work in the abnormal state. Also, the terminal will often not echo the command.
Options
-q displays the terminal type to the standard output, and the terminal is not initialized in any way. The option
- by itself is equivalent but archaic.-e sets the erase character to ch.
-I does not send the terminal or tab initialization strings to the terminal. sets the interrupt character to ch.
-i sets the line kill character to ch.
-m specifies a mapping from a port type to a terminal. See below for more information.
-i does not display any values for the erase, interrupt and line kill characters.
-r prints the terminal type to the standard error output.
-s prints the sequence of shell commands to initialize the environment variable TERM to the standard output. See the section below on setting the environment for details.
The arguments for the
SETTING THE ENVIRONMENT
It is often desirable to enter the terminal type and
information about the terminal's capabilities into the
shell's environment. This is done using the
When the
eval `tset-s options ... `
TERMINAL TYPE MAPPING
When the terminal is not hardwired into the system (or the current system information is incorrect) the terminal type derived from the /etc/ttys file or the TERM environmental variable is often something generic like network, dialup, or unknown. When tset is used in a startup script it is often desirable to provide information about the type of terminal used on such ports.
The purpose of the
The argument to the
If the terminal type is not specified on the command line,
the
For example, consider the following mapping: dialup>9600:vt100. The port type is dialup, the operator is >, the baud rate specification is 9600, and the terminal type is vt100. The result of this mapping is to specify that if the terminal type is dialup, and the baud rate is greater than 9600 baud, a terminal type of vt100 will be used.
If no baud rate is specified, the terminal type will match any baud rate. If no port type is specified, the terminal type will match any port type. For example,
will cause any dialup port, regardless of baud rate, to match the terminal type vt100, and any non-dialup port type to match the terminal type ?xterm. Note, because of the leading question mark, the user will be queried on a default port as to whether they are actually using an xterm terminal.-m dialup:vt100 -m :?xterm
No whitespace characters are permitted in the
HISTORY
The tset command appeared in BSD 3.0. The ncurses implementation was lightly adapted from the 4.4BSD sources for a terminfo environment by Eric S. Raymond <esr@snark.thyrsus.com>.
COMPATIBILITY
The tset utility has been provided for backward-compatibility with BSD environments (under most modern UNIXes, /etc/inittab and getty can set TERM appropriately for each dial-up line; this obviates what was tset's most important use). This implementation behaves like 4.4BSD tset, with a few exceptions specified here.
The
There was an undocumented 4.4BSD feature that invoking tset via a link named TSET (or via any other name beginning with an upper-case letter) set the terminal to use upper-case only. This feature has been omitted.
The
It is still permissible to specify the
As of 4.4BSD, executing tset as reset
no longer implies the
ENVIRONMENT
The tset command uses the SHELL and TERM environment variables.
FILES
- /etc/ttys
system port name to terminal type mapping database (BSD versions only).
- $ROOTDIR/usr/lib/terminfo
terminal capability database
AVAILABILITY
PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.4 Documentation Build 39.