University of Southern California

ITS Information Technology Services

A division of the Office of the Chief Information Officer

Setting Your Terminal Type

Logging in to UNIX requires setting your terminal type. As part of this process, UNIX retrieves the capabilities for your terminal from a database and puts them in your TERMCAP environment variable. The system database for terminal capabilities is the file /etc/termcap. The database is divided into entries for each terminal model or terminal mode for a given model. Fields in the entry are separated by colons (:). The first field is a list of alternate names for the terminal, which are separated by pipe characters (|). Here is an example of a name field:

The meanings of the entries are as follows:

If a program absolutely MUST check for a specific terminal (this is discouraged) make it check for the second entry (the standard form) since all other codes are subject to change. In particular, the two-letter codes are extremely subject to change.

If you are unsure of which termcap entry is correct for your terminal and application, check /etc/termcap for possible comments. Comments begin with a # and normally appear above the entry.

If you cannot find an entry for your terminal, here are some suggestions to follow in the order given:

  1. Look for a termcap entry in /etc/termcap by typing:

      grep my_terminal_type /etc/termcap

    If the grep command finds many termcap entries for the terminal but with different suffixes, look at /etc/termcap using view to see if there are any comments in the file which explain the difference between similar entries.

    If the grep command is unsuccessful, you may want to repeat the search with an abbreviated name in case there are entries for other models with similar capabilities. For example, if grep vt220x /etc/termcap fails, try grep vt2 /etc/termcap.

    Grep may turn up many termcap entries for the same terminal,

  2. If you can find an entry for a terminal which is similar to yours, try it with a command such as vi to see how it behaves.

  3. Many terminals can operate in 'VT100 mode'. If your terminal can, set it to VT100 mode and use vt100.

  4. If all else fails, use dumb but contact the terminal's manufacturer for a possible termcap entry.

NEW TERMCAP ENTRIES

Last updated:
February 03, 2011

UNIX Documentation

The use of all USC computing resources is governed by the USC Computing Policies.