United States-English |
|
|
HP-UX Reference > Tttytype(1)HP-UX 11i Version 3: February 2007 |
|
NAMEttytype — terminal identification program DESCRIPTIONttytype 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 terminfo(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. Optionsttytype recognizes the following options:
NotesUse 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:
ttytype may skip one or more of the first three steps, depending on the presence of -t options. The HP ID request sequence can switch some ANSI terminals into an unexpected operating mode. Recovery from such a condition sometimes requires cycling power on the terminal. To avoid this problem, ttytype always sends the HP identification sequence last. EXAMPLESttytype is most commonly used as part of the login sequence. The following shell script fragment can be used during login shell initialization: # # If TERM is not set, see if our port is listed in /etc/ttytype. # If /etc/ttytype doesn't have information for our port, run # ttytype(1) to try to determine the type of terminal we have. # # To have ttytype(1) prompt for the terminal type before trying # to automatically identify the terminal, add the "-p" option # to the "ttytype -s" command below. # if [ -z "$TERM" -o "$TERM" = network ]; then unset TERM eval `tset -s -Q` if [ -z "$TERM" -o "$TERM" = unknown ]; then eval `ttytype -s` tset -Q -e ${ERASE:-\^h} $TERM fi fi WARNINGSThe terminal identification sequences sent by ttytype can cause unexpected behavior on terminals other than the Wyse 30/50/60, standard ANSI or HP terminals. If you have such terminals in your configuration, use the -t or -p options to prevent ttytype from sending sequences that cause unexpected behavior. |
Printable version | ||
|