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