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