The tset utility sets up your terminal, typically when you first log in. It does terminal dependent processing such as setting erase and kill characters, setting or resetting delays,
sending any sequences needed to properly initialized the terminal, and the like. tset first determines the type of terminal involved, and then does necessary initializations
and mode settings. If a port is not wired permanently to a specific terminal (not hardwired) it is given an appropriate generic identifier such as dialup.
reset clears the terminal settings by turning off CBREAK and RAW modes, output delays and parity checking, turns on NEWLINE translation, echo and TAB expansion, and restores undefined
special characters to their default state. It then sets the modes as usual, based on the terminal type (which will probably override some of the above). See stty(1) for more information. All arguments to tset may be used with reset. reset also uses rs= and rf= to reset the initialization string and file. This is useful after a program dies and leaves the terminal in a funny state. Often in
this situation, characters will not echo as you type them. You may have to type LINEFEED reset LINEFEED since RETURN may not work.
When no arguments are specified, tset reads the terminal type from the TERM environment variable and re-initializes the terminal, and performs initialization of mode,
environment and other options at login time to determine the terminal type and set up terminal modes.
When used in a startup script (.profile for sh(1)
users or .login for csh(1) users) it is desirable
to give information about the type of terminal you will usually use on ports that are not hardwired. Any of the alternate generic names given in the file /etc/termcap are possible identifiers.
Refer to the -m option below for more information. If no mapping applies and a final type option, not preceded by a -m, is given on the command line then
that type is used.
It is usually desirable to return the terminal type, as finally determined by tset, and information about the terminal's capabilities, to a shell's environment. This can be done
using the -, -s, or -S options.
For the Bourne shell, put this command in your .profile file:
|
eval `tset -s options...`
|
or using the C shell, put these commands in your .login file:
|
set noglob
eval `tset -s options...`
unset noglob
|
With the C shell, it is also convenient to make an alias in your .cshrc file:
|
alias ts 'eval `tset -s \!*`'
|
This also allows the command:
to be invoked at any time to set the terminal and environment. It is not possible to get this aliasing effect with a Bourne shell script, because shell scripts cannot set the environment of their
parent. If a process could set its parent's environment, none of this nonsense would be necessary in the first place.
Once the terminal type is known, tset sets the terminal driver mode. This normally involves sending an initialization sequence to the terminal, setting the single character erase
(and optionally the line-kill (full line erase)) characters, and setting special character delays. TAB and NEWLINE 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 erase character is changed as if -e had been used.
|