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