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