1term(7) Miscellaneous Information Manual term(7)
2
3
4
6 term - conventions for naming terminal types
7
9 The environment variable TERM should normally contain the type name of
10 the terminal, console or display-device type you are using. This
11 information is critical for all screen-oriented programs, including
12 your editor and mailer.
13
14 A default TERM value will be set on a per-line basis by either
15 /etc/inittab (Linux and System-V-like UNIXes) or /etc/ttys (BSD
16 UNIXes). This will nearly always suffice for workstation and microcom‐
17 puter consoles.
18
19 If you use a dialup line, the type of device attached to it may vary.
20 Older UNIX systems pre-set a very dumb terminal type like `dumb' or
21 `dialup' on dialup lines. Newer ones may pre-set `vt100', reflecting
22 the prevalence of DEC VT100-compatible terminals and personal-computer
23 emulators.
24
25 Modern telnets pass your TERM environment variable from the local side
26 to the remote one. There can be problems if the remote terminfo or
27 termcap entry for your type is not compatible with yours, but this sit‐
28 uation is rare and can almost always be avoided by explicitly exporting
29 `vt100' (assuming you are in fact using a VT100-superset console, ter‐
30 minal, or terminal emulator.)
31
32 In any case, you are free to override the system TERM setting to your
33 taste in your shell profile. The tset(1) utility may be of assistance;
34 you can give it a set of rules for deducing or requesting a terminal
35 type based on the tty device and baud rate.
36
37 Setting your own TERM value may also be useful if you have created a
38 custom entry incorporating options (such as visual bell or reverse-
39 video) which you wish to override the system default type for your
40 line.
41
42 Terminal type descriptions are stored as files of capability data
43 underneath /usr/share/terminfo. To browse a list of all terminal names
44 recognized by the system, do
45
46 toe | more
47
48 from your shell. These capability files are in a binary format opti‐
49 mized for retrieval speed (unlike the old text-based termcap format
50 they replace); to examine an entry, you must use the infocmp(1M) com‐
51 mand. Invoke it as follows:
52
53 infocmp entry-name
54
55 where entry-name is the name of the type you wish to examine (and the
56 name of its capability file the subdirectory of /usr/share/terminfo
57 named for its first letter). This command dumps a capability file in
58 the text format described by terminfo(5).
59
60 The first line of a terminfo(5) description gives the names by which
61 terminfo knows a terminal, separated by `|' (pipe-bar) characters with
62 the last name field terminated by a comma. The first name field is the
63 type's primary name, and is the one to use when setting TERM. The last
64 name field (if distinct from the first) is actually a description of
65 the terminal type (it may contain blanks; the others must be single
66 words). Name fields between the first and last (if present) are
67 aliases for the terminal, usually historical names retained for compat‐
68 ibility.
69
70 There are some conventions for how to choose terminal primary names
71 that help keep them informative and unique. Here is a step-by-step
72 guide to naming terminals that also explains how to parse them:
73
74 First, choose a root name. The root will consist of a lower-case let‐
75 ter followed by up to seven lower-case letters or digits. You need to
76 avoid using punctuation characters in root names, because they are used
77 and interpreted as filenames and shell meta-characters (such as !, $,
78 *, ?, etc.) embedded in them may cause odd and unhelpful behavior. The
79 slash (/), or any other character that may be interpreted by anyone's
80 file system (\, $, [, ]), is especially dangerous (terminfo is plat‐
81 form-independent, and choosing names with special characters could
82 someday make life difficult for users of a future port). The dot (.)
83 character is relatively safe as long as there is at most one per root
84 name; some historical terminfo names use it.
85
86 The root name for a terminal or workstation console type should almost
87 always begin with a vendor prefix (such as hp for Hewlett-Packard, wy
88 for Wyse, or att for AT&T terminals), or a common name of the terminal
89 line (vt for the VT series of terminals from DEC, or sun for Sun
90 Microsystems workstation consoles, or regent for the ADDS Regent
91 series. You can list the terminfo tree to see what prefixes are
92 already in common use. The root name prefix should be followed when
93 appropriate by a model number; thus vt100, hp2621, wy50.
94
95 The root name for a PC-Unix console type should be the OS name, i.e.
96 linux, bsdos, freebsd, netbsd. It should not be console or any other
97 generic that might cause confusion in a multi-platform environment! If
98 a model number follows, it should indicate either the OS release level
99 or the console driver release level.
100
101 The root name for a terminal emulator (assuming it does not fit one of
102 the standard ANSI or vt100 types) should be the program name or a read‐
103 ily recognizable abbreviation of it (i.e. versaterm, ctrm).
104
105 Following the root name, you may add any reasonable number of hyphen-
106 separated feature suffixes.
107
108 2p Has two pages of memory. Likewise 4p, 8p, etc.
109
110 mc Magic-cookie. Some terminals (notably older Wyses) can only sup‐
111 port one attribute without magic-cookie lossage. Their base entry
112 is usually paired with another that has this suffix and uses magic
113 cookies to support multiple attributes.
114
115 -am Enable auto-margin (right-margin wraparound).
116
117 -m Mono mode - suppress color support.
118
119 -na No arrow keys - termcap ignores arrow keys which are actually
120 there on the terminal, so the user can use the arrow keys locally.
121
122 -nam No auto-margin - suppress am capability.
123
124 -nl No labels - suppress soft labels.
125
126 -nsl No status line - suppress status line.
127
128 -pp Has a printer port which is used.
129
130 -rv Terminal in reverse video mode (black on white).
131
132 -s Enable status line.
133
134 -vb Use visible bell (flash) rather than beep.
135
136 -w Wide; terminal is in 132 column mode.
137
138 Conventionally, if your terminal type is a variant intended to specify
139 a line height, that suffix should go first. So, for a hypothetical
140 FuBarCo model 2317 terminal in 30-line mode with reverse video, best
141 form would be fubar-30-rv (rather than, say, `fubar-rv-30').
142
143 Terminal types that are written not as standalone entries, but rather
144 as components to be plugged into other entries via use capabilities,
145 are distinguished by using embedded plus signs rather than dashes.
146
147 Commands which use a terminal type to control display often accept a -T
148 option that accepts a terminal name argument. Such programs should
149 fall back on the TERM environment variable when no -T option is speci‐
150 fied.
151
153 For maximum compatibility with older System V UNIXes, names and aliases
154 should be unique within the first 14 characters.
155
157 /usr/share/terminfo/?/*
158 compiled terminal capability data base
159
160 /etc/inittab
161 tty line initialization (AT&T-like UNIXes)
162
163 /etc/ttys
164 tty line initialization (BSD-like UNIXes)
165
167 curses(3X), terminfo(5), term(5).
168
169
170
171 term(7)