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