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