Initializes terminals.
tset [ -e C ] [ -k C ] [ -i C ] [ - ] [ -s ] [ -I ] [ -Q ] [ -m [ Identifier ] [ TestBaudRate ] :Type ] ... [ Type ]
The tset command enables you to set the characteristics of your terminal. It performs terminal-dependent processing, such as setting erase and kill characters, setting or resetting delays, and sending any sequences needed to properly initialize the terminal.
The tset command first determines the type of terminal involved (specified by the Type parameter). It then performs necessary initializations and mode settings. The type of terminal attached to each port is specified in the Object Data Manager (ODM) database. The terminfo database contains possible type names for terminals. If a port is not wired permanently to a specific terminal (that is, it is not hardwired), the tset command gives it an appropriate generic identifier, such as dialup.
When no flags are specified, the tset command reads the terminal type out of the TERM environment variable and re-initializes the terminal.
When the tset command is used in a startup script (the .profile file for sh users or the .login file for csh users), the script should include information about the type of terminal you will usually use on ports that are not hardwired. These ports are identified in the ODM database as dialup, plugboard, or ARPANET, among others. To specify which terminal type you usually use on these ports, use the -m flag (followed by the appropriate port type identifier), an optional baud rate specification, and the terminal type. If more than one mapping is specified, the first applicable mapping prevails. A missing port type identifier matches all identifiers. Any of the alternate generic names given in the terminfo database can be used as the identifier.
You can specify the baud rate in the tset command as you would with the stty command. The baud rate is compared with the speed of the diagnostic output (which should be the control terminal). The baud rate test can be any combination of the following characters:
The @ (at sign) stands for the preposition at, and the ! (exclamation point) inverts the sense of the test. To avoid problems with metacharacters, place the -m flag argument inside '' (single quotes). Users of the csh command must also put a \ (backslash) before any ! (exclamation point).
The following example sets the terminal type to adm3a if the port in use is a dialup at a speed greater than 300 baud. It sets the terminal type to dw2 if the port is a dialup port at a speed of 300 baud or less:
tset -m 'dialup>300:adm3a' -m dialup:dw2 -m 'plugboard:?adm3a'
If the Type parameter begins with a ? (question mark), you are prompted to verify the type. To use the specified type, press Enter. To use a different type, enter the type you want. In the example given, you are prompted to verify the adm3 plugboard port type.
If no mapping applies and a final type option (not preceded by an -m flag) is given on the command line, that type is used. Otherwise, the default terminal type is the one identified in the ODM database. Hardwired ports should always be identified in the ODM database.
When the terminal type is known, the tset command engages in terminal driver mode setting. This usually involves setting:
Tab and new-line expansion are turned off during transmission of the terminal initialization sequence.
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 Backspace (Ctrl-H).
Item | Description |
---|---|
-e C | Sets the erase character to the character specified by the C parameter.The default is the backspace character. |
-I | Suppresses transmission of terminal initialization strings. |
-i C | Sets the interrupt character to the character specified by the C parameter. The C parameter defaults to ^C (caret C). The ^ (caret) character can also be used for this option. |
-k C | Sets the line-kill character to the character specified by the C parameter. The C parameter defaults to ^X (caret X). The ^ (caret) character can also be used for this option. |
-m IdentifierTestbaudRate:Type | Specifies which terminal type (in the Type parameter) is usually used on the port identified in the Identifier parameter. A missing identifier matches all identifiers. You can optionally specify the baud rate in the TestBaudRate parameter. |
-Q | Suppresses printing of the Erase set to and Kill set to messages. |
-s | Prints the sequence of csh commands that initialize the TERM environment variable, based on the name of the terminal decided upon. |
- | The name of the terminal decided upon is output to standard output. This is the TERM environment variable. |
export TERM; TERM=\'tset \- 2621\'
export TERM; TERM=\'tset \- \-m dialup:h19"'
export TERM; TERM=\'tset \- \-m 'switch>1200:?vt100' \-m
'switch<=1200:2621'
If none of the conditions hold,
the terminal type specified in the ODM database is used. export TERM; TERM=\'tset \- \?adm3a\'
export TERM; TERM=\'tset \- \-m 'switch>1200:?vt100' \-m
'switch<=1200:2621'
export TERM
TERM=\'tset \-e \-k(hat)U \-Q \- "-m 'switch<1200:concept100'
"-m 'switch:?vt100' \-m dialup:concept100 "1-m arpanet: dm2500"'
This
also prevents the tset command from printing the following
line: Erase set to Backspace, Kill set to Ctrl-U
tset -e ^Y
Item | Description |
---|---|
/usr/share/lib/terminfo | Contains the terminal capability database. |