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