]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/term.7
ncurses 6.4 - patch 20240414
[ncurses.git] / man / term.7
1 .\"***************************************************************************
2 .\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
3 .\" Copyright 1998-2011,2017 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: term.7,v 1.28 2020/02/02 23:34:34 tom Exp $
31 .TH term 7
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .ds n 5
37 .ds d @TERMINFO@
38 .SH NAME
39 term \- conventions for naming terminal types
40 .SH DESCRIPTION
41 .PP
42 The environment variable \fBTERM\fR should normally contain the type name of
43 the terminal, console or display-device type you are using.
44 This information
45 is critical for all screen-oriented programs, including your editor and mailer.
46 .PP
47 A default \fBTERM\fR value will be set on a per-line basis by either
48 \fB/etc/inittab\fR (e.g., System\-V-like UNIXes)
49 or \fB/etc/ttys\fR (BSD UNIXes).
50 This will nearly always suffice for workstation and microcomputer consoles.
51 .PP
52 If you use a dialup line, the type of device attached to it may vary.
53 Older UNIX systems pre-set a very dumb terminal type
54 like \*(``dumb\*('' or \*(``dialup\*('' on dialup lines.
55 Newer ones may pre-set \*(``vt100\*('', reflecting the prevalence of DEC
56 VT100-compatible terminals and personal-computer emulators.
57 .PP
58 Modern telnets pass your \fBTERM\fR environment variable from the local side to
59 the remote one.
60 There can be problems if the remote terminfo or termcap entry
61 for your type is not compatible with yours, but this situation is rare and
62 can almost always be avoided by explicitly exporting \*(``vt100\*(''
63 (assuming you are in fact using a VT100-superset console,
64 terminal, or terminal emulator.)
65 .PP
66 In any case, you are free to override the system \fBTERM\fR setting to your
67 taste in your shell profile.
68 The \fB@TSET@\fP(1) utility may be of assistance;
69 you can give it a set of rules for deducing or requesting a terminal type based
70 on the tty device and baud rate.
71 .PP
72 Setting your own \fBTERM\fR value may also be useful if you have created a
73 custom entry incorporating options (such as visual bell or reverse-video)
74 which you wish to override the system default type for your line.
75 .PP
76 Terminal type descriptions are stored as files of capability data underneath
77 \*d.
78 To browse a list of all terminal names recognized by the system, do
79 .sp
80         @TOE@ | more
81 .sp
82 from your shell.
83 These capability files are in a binary format optimized for
84 retrieval speed (unlike the old text-based \fBtermcap\fR format they replace);
85 to examine an entry, you must use the \fB@INFOCMP@\fR(1M) command.
86 Invoke it as follows:
87 .sp
88         @INFOCMP@ \fIentry_name\fR
89 .sp
90 where \fIentry_name\fR is the name of the type you wish to examine (and the
91 name of its capability file the subdirectory of \*d named for its first
92 letter).
93 This command dumps a capability file in the text format described by
94 \fBterminfo\fR(\*n).
95 .PP
96 The first line of a \fBterminfo\fR(\*n) description gives the names by which
97 terminfo knows a terminal,
98 separated by \*(``|\*('' (pipe-bar) characters with the last
99 name field terminated by a comma.
100 The first name field is the type's
101 \fIprimary name\fR, and is the one to use when setting \fBTERM\fR.  The last
102 name field (if distinct from the first) is actually a description of the
103 terminal type (it may contain blanks; the others must be single words).
104 Name
105 fields between the first and last (if present) are aliases for the terminal,
106 usually historical names retained for compatibility.
107 .PP
108 There are some conventions for how to choose terminal primary names that help
109 keep them informative and unique.
110 Here is a step-by-step guide to naming
111 terminals that also explains how to parse them:
112 .PP
113 First, choose a root name.
114 The root will consist of a lower-case letter
115 followed by up to seven lower-case letters or digits.
116 You need to avoid using
117 punctuation characters in root names, because they are used and interpreted as
118 filenames and shell meta-characters (such as !, $, *, ?, etc.) embedded in them
119 may cause odd and unhelpful behavior.
120 The slash (/), or any other character
121 that may be interpreted by anyone's file system (\e, $, [, ]), is especially
122 dangerous (terminfo is platform-independent, and choosing names with special
123 characters could someday make life difficult for users of a future port).
124 The
125 dot (.) character is relatively safe as long as there is at most one per root
126 name; some historical terminfo names use it.
127 .PP
128 The root name for a terminal or workstation console type should almost always
129 begin with a vendor prefix (such as \fBhp\fR for Hewlett-Packard, \fBwy\fR for
130 Wyse, or \fBatt\fR for AT&T terminals), or a common name of the terminal line
131 (\fBvt\fR for the VT series of terminals from DEC, or \fBsun\fR for Sun
132 Microsystems workstation consoles, or \fBregent\fR for the ADDS Regent series.
133 You can list the terminfo tree to see what prefixes are already in common use.
134 The root name prefix should be followed when appropriate by a model number;
135 thus \fBvt100\fR, \fBhp2621\fR, \fBwy50\fR.
136 .PP
137 The root name for a PC-Unix console type should be the OS name,
138 i.e., \fBlinux\fR, \fBbsdos\fR, \fBfreebsd\fR, \fBnetbsd\fR.  It should
139 \fInot\fR be \fBconsole\fR or any other generic that might cause confusion in a
140 multi-platform environment!  If a model number follows, it should indicate
141 either the OS release level or the console driver release level.
142 .PP
143 The root name for a terminal emulator (assuming it does not fit one of the
144 standard ANSI or vt100 types) should be the program name or a readily
145 recognizable abbreviation of it (i.e., \fBversaterm\fR, \fBctrm\fR).
146 .PP
147 Following the root name, you may add any reasonable number of hyphen-separated
148 feature suffixes.
149 .TP 5
150 2p
151 Has two pages of memory.
152 Likewise 4p, 8p, etc.
153 .TP 5
154 mc
155 Magic-cookie.
156 Some terminals (notably older Wyses) can only support one
157 attribute without magic-cookie lossage.
158 Their base entry is usually paired
159 with another that has this suffix and uses magic cookies to support multiple
160 attributes.
161 .TP 5
162 \-am
163 Enable auto-margin (right-margin wraparound).
164 .TP 5
165 \-m
166 Mono mode \- suppress color support.
167 .TP 5
168 \-na
169 No arrow keys \- termcap ignores arrow keys which are actually there on the
170 terminal, so the user can use the arrow keys locally.
171 .TP 5
172 \-nam
173 No auto-margin \- suppress am capability.
174 .TP 5
175 \-nl
176 No labels \- suppress soft labels.
177 .TP 5
178 \-nsl
179 No status line \- suppress status line.
180 .TP 5
181 \-pp
182 Has a printer port which is used.
183 .TP 5
184 \-rv
185 Terminal in reverse video mode (black on white).
186 .TP 5
187 \-s
188 Enable status line.
189 .TP 5
190 \-vb
191 Use visible bell (flash) rather than beep.
192 .TP 5
193 \-w
194 Wide; terminal is in 132-column mode.
195 .PP
196 Conventionally, if your terminal type is a variant intended to specify a
197 line height, that suffix should go first.
198 So, for a hypothetical FuBarCo
199 model 2317 terminal in 30-line mode with reverse video, best form would be
200 \fBfubar\-30\-rv\fR (rather than, say, \*(``fubar\-rv\-30\*('').
201 .PP
202 Terminal types that are written not as standalone entries, but rather as
203 components to be plugged into other entries via \fBuse\fP capabilities,
204 are distinguished by using embedded plus signs rather than dashes.
205 .PP
206 Commands which use a terminal type to control display often accept a \-T
207 option that accepts a terminal name argument.
208 Such programs should fall back
209 on the \fBTERM\fR environment variable when no \-T option is specified.
210 .SH PORTABILITY
211 For maximum compatibility with older System V UNIXes, names and aliases
212 should be unique within the first 14 characters.
213 .SH FILES
214 .TP 5
215 \*d/?/*
216 compiled terminal capability data base
217 .TP 5
218 /etc/inittab
219 tty line initialization (AT&T-like UNIXes)
220 .TP 5
221 /etc/ttys
222 tty line initialization (BSD-like UNIXes)
223 .SH SEE ALSO
224 \fBcurses\fR(3X), \fBterminfo\fR(\*n), \fBterm\fR(\*n).