TSET(1)
NAME
tset − terminal dependent initialization
SYNOPSIS
tset [ options ] [ −m [ ident ] [ test baudrate ] :type ] ... [ type ]
reset ...
HP-UX COMPATIBILITY
Level: HP-UX/STANDARD
Origin: UCB
DESCRIPTION
Tset sets up your terminal when you first log in to an HP-UX
system. It does terminal dependent processing, such as setting erase and kill characters, setting or resetting delays, and sending any sequences needed to properly initialize the terminal. It first determines the type of terminal involved, and then does the necessary initializations and mode settings. The type of terminal attached to each HP-UX port is specified in the /etc/ttytype data base. Type names for terminals may be found in the termcap(5) data base. If a port is not wired permanently to a specific terminal (not hardwired), it will be given an appropriate generic identifier, such as dialup.
In the case where no arguments are specified, tset simply reads the terminal type out of the environment variable TERM and re-initializes the terminal. The rest of this manual entry concerns itself with mode and environment initialization, typically done once at login, and options used at initialization 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 which are not hardwired. These ports are identified in /etc/ttytype as dialup or plugboard, etc. To specify what terminal type you usually use on these ports, the −m (map) option flag is followed by the appropriate port type identifier, an optional baud rate specification, and the terminal type. (The effect is to "map" from some conditions to a terminal type, that is, to tell tset, "If I’m on this kind of port, then I’ll probably be on this kind of terminal".) If more than one mapping is specified, the first applicable mapping prevails. A missing port type identifier matches all identifiers. A baudrate is specified as with stty(1), and is compared with the speed of the diagnostic output (which should be the control terminal). The baud rate test may be any combination of >, =, <, @, and !; @ is a synonym for = and ! inverts the sense of the test. To avoid problems with metacharacters, it is best to place the entire argument to −m within single quotes; users of csh(1) must also put a "\" before any "!" used.
Thus,
tset −m ´dialup>300:2622´ −m ´dialup:2624´ −m ´plugboard:?2623´
causes the terminal type to be set to an HP 2622 if the port in use is a dialup at a speed greater than 300 baud, or to an HP 2624 if the port is otherwise a dialup (i.e. at 300 baud or less). If the type finally determined by tset begins with a question mark, the user is asked if he or she really wants that type. A null response means to use that type; otherwise, another type can be entered. Thus, in the above case, if the user is on a plugboard port, he or she will be asked whether or not he or she is actually using an HP 2623.
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. Otherwise, the identifier found in the /etc/ttytype data base will be taken to be the terminal type. The latter should always be the case for hardwired ports.
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 option. Using the Bourne shell (sh(1)), the command
eval `tset −s options...`
or using the C shell, csh(1):
set noglob; eval `tset −s options...`
These commands cause tset to generate as output a sequence of shell commands which place the variables TERM and TERMCAP in the environment; see environ(5).
Once the terminal type is known, tset engages in terminal mode setting. This normally involves sending an initialization sequence to the terminal, setting the single character erase (and optionally the full line erase or line-kill) characters, and setting special character delays. 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 (^H).
The options are:
−ec sets the erase character to be the named character c; c defaults to ^H (BACKSPACE). The character c can either be typed directly, or entered using the "hat" notation used here (e.g. the "hat" notation for control-H is ^H; in sh(1), the ^ character should be escaped (\^)).
−kc sets the kill character to c. The default c is ^X. If c is not specified, the kill character will remain unchanged unless the original value of the kill character is null. In this case, the kill character is set to an "at" sign (@).
− report terminal type. Whatever type is decided on is reported. If no other flags are given, the only effect is to write the terminal type on the standard output.
−s generates appropriate commands (depending on your SHELL environment variable) to set TERM and TERMCAP. This can be used with `tset −s ...`, and is preferred to the use of the "−" option because −s sets the TERMCAP variable also.
−I suppresses transmitting terminal initialization strings.
−Q suppresses printing the "Erase set to" and "Kill set to" messages.
−A asks the user for the TERM type.
−S Outputs the strings that would be assigned to TERM and TERMCAP in the environment rather than generating commands for a shell. In sh(1), the following is an alternate way of setting TERM and TERMCAP.
set -- `tset −S ...`
TERM=$1
TERMCAP=$2
For compatibility with earlier versions of tset, the following flags are accepted, but their use is discouraged:
−r report to the user in addition to other flags.
−Ec sets the erase character to c only if the terminal can backspace. C defaults to ^H.
EXAMPLES
These examples all assume the Bourne shell (sh(1)). Note that a typical use of tset in a .profile will also use the −e and −k options, and often the −n or −Q options as well. These options have not been included here to keep the examples small.
Assume, for the moment, that you are on an HP 2622. This is suitable for typing by hand but not for a .profile, unless you are always on a 2622. It also does not set TERMCAP, thus requiring programs which use termcap(5) to search /etc/termcap, a potentially time-consuming operation.
export TERM; TERM=`tset − 2622`
Now, you have an HP 2623 at home which you dial up on, but your office terminal is hardwired and known in /etc/ttytype.
export TERM; TERM=`tset − −m dialup:2623`
You have a switch which connects everything to everything, making it nearly impossible to key on what port you are coming in on. You use an HP 2622 in your office at 9600 baud, and dial up to switch ports at 1200 baud from home on an HP 2623. Sometimes you use someone else’s terminal at work, so you want it to ask you to make sure what terminal type you have at high speeds, but at 1200 baud you are always on a 2623. Note the placement of the question mark, and the quotes to protect the > and ? from interpretation by the shell.
export TERM; TERM=`tset − −m ´switch>1200:?2622´ −m ´switch<=1200:2623´`
All of the above entries will fall back on the terminal type specified in /etc/ttytype if none of the conditions hold. The following entry is appropriate if you always dial up, always at the same baud rate, on many different kinds of terminals. Your most common terminal is an HP 2622. It always asks you what kind of terminal you are on, defaulting to 2622.
export TERM; TERM=`tset − ?2622`
If the file /etc/ttytype is not properly installed and you want to key entirely on the baud rate, the following can be used:
export TERM; TERM=`tset − −m ´>1200:2624´ 2622`
If you wish to set both TERM and TERMCAP, the call to tset should appear in the following context.
export TERM TERMCAP; ‘tset -s ...‘
FILES
/etc/ttytype port name to terminal type mapping data base;
/etc/termcap terminal capability data base.
VARIABLES
SHELL if "csh" then generate csh(1) commands, otherwise generate sh(1) commands.
TERM the (canonical) terminal name.
TERMCAP
the termcap(5) string associated with TERM.
SEE ALSO
csh(1), sh(1), stty(1), ttytype(5), termcap(5), environ(7).
Hewlett-Packard — last mod. May 11, 2021