summaryrefslogtreecommitdiff
path: root/static/v10/man5/termcap.5
blob: 6dce97cb6f7bf9617f17bc62698f5e297b94a979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
.TH TERMCAP 5
.CT 2 comm_term
.SH NAME
termcap \- terminal capability file
.SH DESCRIPTION
.I Termcap
describes terminals as used, for example, by
.IR vi (1)
and
.IR curses (3)
or in the
.B TERMCAP
environment variable.
A
.I termcap
entry is a line containing fields separated by
.LR : .
Lines may be broken;
.L \e
at the end of a line signifies continuation.
Empty fields are ignored.
.PP
The first field for each entry gives names
for a terminal separated by
.LR | .
The first name is conventionally two characters long
for the benefit of older systems; the
second name is the customary abbreviation; and
the last name fully identifies
the terminal.
.PP
There are three types of capability: Boolean for the presence of
a feature, numeric for sizes and time delays, and
strings for performing operations.
Some string fields may be preceded by a number, which
specifies padding, a time delay required with the operation.
These capabilities are marked
`P' or `P*' below.
Padding is measured in milliseconds;
P* signifies that the padding is proportional to the
number of lines (or characters) affected,
for example,
.L 3.5*
specifies 3.5 milliseconds per unit.
.de fq
\f5\\$1\fR	\\$2	\\$3	\\$4
..
.ft B
.ta \w'Name 'u +\w'Type 'u	+\w'Pad 'u
.nf
.PP
Name	Type	Pad	Description
.ftR
.fq ae str  P  "End alternate character set
.fq al str  P* "Add new blank line
.fq am bool "" "Automatic margin
.fq as str  P  "Start alternate character set
.fq bc str  "" "Backspace char if not \f5^H\fP
.fq bs bool "" "Terminal can backspace
.fq bt str  P  "Back tab
.fq bw bool "" "Backspace wraps from column 0 to last column
.fq CC str  "" "Command character in prototype if terminal settable
.fq cd str  P* "Clear to end of display
.fq ce str  P  "Clear to end of line
.fq ch str  P  "Like \f5cm\fP but horizontal motion only
.fq cl str  P* "Clear screen
.fq cm str  P  "Cursor motion
.fq co num  "" "Number of columns
.fq cr str  P* "Carriage return, default \f5^M\fR
.fq cs str  P  "Change scrolling region (vt100), like cm
.fq cv str  P  "Like ch, but vertical only
.fq da bool "" "Display may be retained above
.fq dB num  "" "Backspace delay
.fq db bool "" "Display may be retained below
.fq dC num  "" "Carriage return delay
.fq dc str  P* "Delete character
.fq dF num  "" "Form feed delay
.fq dl str  P* "Delete line
.fq dm str  "" "Enter delete mode
.fq dN num  "" "Newline delay
.fq do str  "" "Down one line
.fq dT num  "" "tab delay
.fq ed str  "" "End delete mode
.fq ei str  "" "End insert mode; give \f5:ei=:\fR if \f5ic\fR
.fq eo str  "" "Can erase overstrikes with blank
.fq ff str  P* "Hard copy page eject, default \f5^L\fR
.fq hc bool "" "Hardcopy terminal
.fq hd str  "" "Half line down
.fq ho str  "" "Home cursor if no \f5cm\fR
.fq hu str  "" "Half line up
.fq hz str  "" "Hazeltine, can't print \f5~\fR
.fq ic str  P  "Insert character
.fq if str  "" "Name of file containing initialization\f5is\fR
.fq im bool "" "Enter insert mode; give \f5:im=:\fR if \f5ic\fR
.fq in bool "" "Insert mode distinguishes nulls on display
.fq ip str  P* "Insert pad after character insert
.fq is str  "" "Terminal initialization string
.fq k0\fR-\fPk9 str  "" "Other function key codes
.fq kb str  "" "Backspace key code
.fq kd str  "" "Down arrow key code
.fq ke str  "" "Leave keypad transmit mode
.fq kh str  "" "Home key code
.fq kl str  "" "Left arrow key code
.fq kn num  "" "Number of function keys
.fq ko str  "" "Termcap entries for other non-function keys
.fq kr str  "" "Right arrow key code
.fq ks str  "" "Enter keypad transmit mode
.fq ku str  "" "Up arrow key code
.fq l0\fR-\fP9 str "" "Labels on other function keys
.fq li num  "" "Number of lines on screen or page
.fq ll str  "" "Last line, first column, if no \f5cm\fR
.fq ma str  "" "Arrow key map
.fq mi bool "" "Safe to move in insert mode
.fq ml str  "" "Memory lock above cursor
.fq ms bool "" "Safe to move in standout or underline mode
.fq mu str  "" "Turn off memory lock
.fq nc bool "" "No correctly working CR (DM2500, H2000)
.fq nd str  "" "Nondestructive space (cursor right)
.fq nl str  P* "Newline character, default \f5\en\fR
.fq ns bool "" "Nonscrolling CRT
.fq os bool "" "Terminal overstrikes
.fq pc str  "" "Pad character, default NUL
.fq pt bool "" "Has hardware tabs (possibly set by \f5is\fR)
.fq se str  "" "Leave standout mode
.fq sf str  P  "Scroll forward
.fq sg num  "" "Number of blanks left by \f5so\fR, \f5se\fR
.fq so str  "" "Enter standout mode
.fq sr str  P  "Scroll reverse (backward)
.fq ta str  P  "Tab, if not \f5^I\fR or if padded
.fq tc str  "" "Entry of similar terminal, must be last
.fq te str  "" "String to end programs that use \f5cm\fR
.fq ti str  "" "String to begin programs that use \f5cm\fR
.fq uc str  "" "Underscore one char and move past it
.fq ue str  ""  "Leave underscore mode
.fq ug num  "" "Number of blanks left by \f5us\fR, \f5ue\fR
.fq ul bool "" "Terminal underlines but doesn't overstrike
.fq up str  "" "Cursor up one line
.fq us str  "" "Enter underscore mode
.fq vb str  "" "Visible bell, (may not move cursor)
.fq ve str  "" "Leave open/visual mode
.fq vs str  "" "Enter open/visual mode
.fq xb bool "" "Beehive (\f5f1\fR=escape, \f5f2\fR=\f5^C\fR)
.fq xn bool "" "Newline ignored after wrap (Concept)
.fq xr bool "" "Return acts like \f5ce \er \en\fR (Delta Data)
.fq xs bool "" "Standout not erased by writing over (HP264?)
.fq xt bool "" "Tabs are destructive, magic \f5so\fR (Teleray 1061)
.fi
.PP
The following example is one of the
more elaborate 
.I termcap
entries.
(Do not believe it; see the file for current facts.)
.HP
.EX
co|c100|concept 100:is=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200\eEo\e47\eE:\e
:al=3*\eE^R:am:bs:cd=16*\eE^C:ce=16\eE^S:cl=2*^L:cm=\eEa%+ %+ :co#80:\e
:dc=16\eE^A:dl=3*\eE^B:ei=\eE\e200:eo:im=\eE^P:in:ip=16*:li#24:mi:\e
:nd=\eE=:se=\eEd\eE:so=\eED\eEE:ta=8\et:ul:up=\eE;vb=\eEk\eEk:xn:
.EE
.PP
Among the Boolean capabilities shown for the Concept are
automatic margins
.LR am :
automatic return and linefeed at the end of a line.
Numeric capabilities are indicated by
.LR # ;
.L co#80
means the Concept has 80 columns.
String capabilities are indicated by
.LR = ;
to clear to end of line
.RL ( ce )
on the Concept, issue <escape> <control-C> and pad
with 16 milliseconds delay.
.PP
In strings the
.SM ASCII ESC
character is represented by
.LR \eE 
and control characters are represented by 
.BI ^ c,
where character 
.I c
has
.SM ASCII
code 0100 greater than the desired control character.
Newline, return, tab, backspace, form feed,
.B \e
and
.B ^
are represented by
.BR "\en \er \et \eb \ef \e\e \e^" .
Backslash
.L \e
followed by 3 digits specifies a byte in octal.
A null character is encoded
.LR \e200 :
the routines that use
.I termcap
information mask out the high bit of all bytes.
.PP
Local cursor motions are undefined if they run off the
left or top of the screen; the
.I curses
routines refrain from issuing such motions.
It is assumed that the screen will scroll up upon running
off the bottom; this assumption is negated by
.LR ns .
Capability
.L am
(automatic margin) describes the handling of the right margin.
.PP
Cursor addressing is described by capability
.LR cm ,
which contains 
.IR printf (3)-like
format codes for line and column positions.
The leftmost column is column 0.
.IP
.nf
.fq %d "as in \fIprintf\fR
.fq %2 "like \f5%2d\fR
.fq %3 "like \f5%3d\fR
.fq %. "like \f5%c\fR
.fq %+\fIx\fR "adds \fIx\fR before converting
.fq %>\fIxy\fR "if value exceeds \fIx\fR, add \fIy\fR, no output
.fq %r "reverse order of line and column, no output
.fq %i "increment line/column (1-origin)
.fq %% "single \f5%\fR
.fq %n "exclusive or row and column with 0140 (DM2500)
.fq %B "BCD: 16\(**(\fIx/10) + (\fIx\fR%10), no output
.fq %D "Reverse coding: \fIx\fR\-2\(**(\fIx\fR%16), no output
.fi
.PP
For example, to go to line 3 column 12, a HP2645 terminal
must get
.B \eE&a12c03Y
padded for 6 milliseconds:
.L :cm=6\eE&%r%2c%2Y: .
.PP
Capability
.L al
adds an empty line before the line where the cursor is
and leaves the cursor on the new line.
This will always be done with the cursor at column 0.
Capability
.L dl
deletes the line where the cursor is and is also done
with the cursor at column 0.
Capabilities
.L da
and
.L db
warn that off-screen lines may appear at the top or bottom of
the screen upon scrolling or deleting lines.
The
.I curses
routines do not use this feature, but do guard against
its effects.
.PP
Insert-character operations usually affect only
the current line and shift
characters off the end of the line rigidly.
Some terminals, such as the Concept 100, distinguish
typed from untyped blanks on the screen, shifting upon insertion
only up to an untyped blank, i.e. a space caused by cursor motion;
these terminals have capability
.L in
(insert null).
.PP
Some terminals have an insertion mode; others require a special
sequence to open up a blank position on the current line.
Insertion mode is entered and left by
.L im
and
.LR ie ,
which should be null strings if there is no insertion mode.
String
.L ic
is sent just before each character to be inserted, and
padding
.L ip
is sent after.
Capability
.L mi
says it is possible to move around without leaving insertion
mode.
Delete mode works similarly: enter with
.LR dm ,
leave with
.LR de ,
and issue
.L dc
before each character.
.PP
Highlighting, or `standout' mode is entered by
.L so
and left by
.LR se .
Underline mode is entered by
.L us
and left by
.LR ue .
Terminals that underline characters individually have capability
.LR uc .
The visual bell capability
.L vb
flashes the screen without moving the cursor.
.PP
A terminal with a keypad that transmits cursor motions
may be described by capabilities
.L
kl kr ku kd kh
that give the codes for left, right, up, down, and home.
Up to ten function keys may be described by
.L k0
through
.LR k9 .
Special labels for the function keys may be given as
.L l0
through
.LR l9 .
.PP
The initialization string
.L is
is expected to set tabs if that is necessary.
That string may come from a file
.RL ( if );
if both are present 
.L is
is done first.
.PP
The entry for a terminal may be continued by jumping
to another entry given by
.LR tc .
Duplicate capabilities are resolved in favor of the first.
.SH FILES
.F /etc/termcap
.SH SEE ALSO
.IR curses (3),
.IR termcap (3),
.IR vi (1),
.IR ul (1)
.SH BUGS
.I Termcap
entries, including 
.L tc
continuations, are limited to 1024 characters.
.br