HP-UX Reference (11i v3 07/02) - 1 User Commands N-Z (vol 2)
t
ttytype(1) ttytype(1)
NAME
ttytype - terminal identification program
SYNOPSIS
ttytype [-apsv][-t
type]
DESCRIPTION
ttytype automatically identifies the current terminal type by sending an identification request sequence
to the terminal. This method works for local, modem, and remote terminal connections, as well as for the
hpterm and xterm terminal emulators.
Once the terminal has been identified,
ttytype prints the terminal’s type to the standard output (see ter-
minfo(4)). This string is usually used as the value for the
TERM environment variable.
If
ttytype is unable to determine the correct terminal type, it prompts the user for the correct terminal
identification string.
Options
ttytype recognizes the following options:
-a Causes ttytype to return an ID of "unknown" instead of prompting for the terminal type
if auto-identification fails. If this option is not present, ttytype interactively prompts the
user for the terminal type if it is unable to determine the correct type automatically.
-p Causes ttytype to prompt for the terminal type before it sends the terminal
identification request sequence. If the user responds with only a carriage return,
ttytype proceeds with the automatic terminal identification process. Any other response
is taken as the correct terminal type. Note that the LINES and COLUMNS variables are
not set if the user manually enters a terminal type.
The -p option is normally used only for terminals that do not behave well when presented
with ttytype’s terminal identification request sequence. It gives the user a chance to
respond with the correct terminal type before any escape sequences are sent that could
have an adverse effect on the terminal.
The -a option can be used in conjunction with the -p option. The -a
option only inhibits
interactive prompting after
ttytype has failed to identify the terminal by other means.
-s Tells ttytype to print a series of shell commands to set the
TERM, LINES, and
COLUMNS environment variables to appropriate values. In addition, the variable ERASE is
set to the two-character sequence representing the appropriate erase character for the ter-
minal (DEL for ANSI terminals, backspace for all others). This two-character sequence can
then be used as an argument to stty or tset (see stty(1) and tset(1)).
The
SHELL environment variable is consulted to see which shell syntax to use for setting
the environment variables. This output is normally used with a command of the form:
eval ‘ttytype -s‘
-t
type ttytype normally attempts identification of Wyse, ANSI and HP terminals. The
-t type
argument can be used to restrict the inquiry to that required for terminals of the specified
type. The accepted types are
ansi, hp, and wyse. Multiple -t options can be specified.
-v Enable verbose messages to standard error.
Notes
Use of the -s option is highly recommended because many terminals support variable-size displays. This
option provides the only means for automatically configuring the user environment in such a manner that
applications can handle these terminals correctly. Note that LINES and COLUMNS are not set if the -p
option is used and the user manually enters a terminal type.
The following steps are performed in the order indicated when identifying a terminal:
1. ttytype tries the Wyse 30/50/60 id request sequence.
2. ttytype tries the standard ANSI ID request sequence. If a response is received, it is converted to a
string according to an internal table.
3. ttytype tries the HP id request sequence.
HP-UX 11i Version 3: February 2007 − 1 − Hewlett-Packard Company 353