Debian Codegraph @

upstream/debian-unstable/man5/termcap.5

raw
1 .\" Copyright, the authors of the Linux man-pages project
2 .\"
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
4 .\"
5 .TH termcap 5 2025-09-21 "Linux man-pages 6.18"
6 .SH NAME
7 termcap \- terminal capability database
8 .SH DESCRIPTION
9 The termcap database is an obsolete facility for describing the
10 capabilities of character-cell terminals and printers.
11 It is retained only for compatibility with old programs;
12 new programs should use the
13 .BR terminfo (5)
14 database and associated libraries.
15 .P
16 .I /etc/termcap
17 is an ASCII file (the database master)
18 that lists the capabilities of
19 many different types of terminals.
20 Programs can read termcap to find
21 the particular escape codes needed
22 to control the visual attributes of
23 the terminal actually in use.
24 (Other aspects of the terminal are handled by
25 .BR stty (1).)
26 The termcap database is indexed on the
27 .B TERM
28 environment variable.
29 .P
30 Termcap entries must be defined on a single logical line,
31 with \[aq]\[rs]\[aq] used to suppress the newline.
32 Fields are separated by \[aq]:\[aq].
33 The first field of each entry starts at the left-hand margin,
34 and contains a list of names for the terminal,
35 separated by \[aq]|\[aq].
36 .P
37 The first subfield may
38 (in BSD termcap entries from 4.3BSD and earlier)
39 contain a short name consisting of two characters.
40 This short name may consist of capital or small letters.
41 In 4.4BSD termcap entries this field is omitted.
42 .P
43 The second subfield (first, in the newer 4.4BSD format)
44 contains the name used by the environment variable
45 .BR TERM .
46 It should be spelled in lowercase letters.
47 Selectable hardware capabilities should be marked
48 by appending a hyphen and a suffix to this name.
49 See below for an example.
50 Usual suffixes are
51 w (more than 80 characters wide),
52 am (automatic margins),
53 nam (no automatic margins),
54 and
55 rv (reverse video display).
56 The third subfield contains
57 a long and descriptive name for this termcap entry.
58 .P
59 Subsequent fields contain the terminal capabilities;
60 any continued capability lines
61 must be indented one tab from the left margin.
62 .P
63 Although there is no defined order,
64 it is suggested to write
65 first boolean,
66 then numeric,
67 and then string capabilities,
68 each sorted alphabetically without looking at lower or upper spelling.
69 Capabilities of similar functions can be written in one line.
70 .P
71 Example for:
72 .nf
73 .P
74 Head line: vt|vt101|DEC VT 101 terminal in 80 character mode:\[rs]
75 Head line: Vt|vt101-w|DEC VT 101 terminal in (wide) 132 character mode:\[rs]
76 Boolean: :bs:\[rs]
77 Numeric: :co#80:\[rs]
78 String: :sr=\[rs]E[H:\[rs]
79 .fi
80 .SS Boolean capabilities
81 .nf
82 5i Printer will not echo on screen
83 am Automatic margins which means automatic line wrap
84 bs Control-H (8 dec.) performs a backspace
85 bw Backspace on left margin wraps to previous line and right margin
86 da Display retained above screen
87 db Display retained below screen
88 eo A space erases all characters at cursor position
89 es Escape sequences and special characters work in status line
90 gn Generic device
91 hc This is a hardcopy terminal
92 HC The cursor is hard to see when not on bottom line
93 hs Has a status line
94 hz Hazeltine bug, the terminal can not print tilde characters
95 in Terminal inserts null bytes, not spaces, to fill whitespace
96 km Terminal has a meta key
97 mi Cursor movement works in insert mode
98 ms Cursor movement works in standout/underline mode
99 NP No pad character
100 NR ti does not reverse te
101 nx No padding, must use XON/XOFF
102 os Terminal can overstrike
103 ul Terminal underlines although it can not overstrike
104 xb Beehive glitch, f1 sends ESCAPE, f2 sends \f[B]\[ha]C\f[]
105 xn Newline/wraparound glitch
106 xo Terminal uses xon/xoff protocol
107 xs Text typed over standout text will be displayed in standout
108 xt Teleray glitch, destructive tabs and odd standout mode
109 .fi
110 .SS Numeric capabilities
111 .nf
112 co Number of columns
113 dB Delay in milliseconds for backspace on hardcopy terminals
114 dC Delay in milliseconds for carriage return on hardcopy terminals
115 dF Delay in milliseconds for form feed on hardcopy terminals
116 dN Delay in milliseconds for new line on hardcopy terminals
117 dT Delay in milliseconds for tabulator stop on hardcopy terminals
118 dV Delay in milliseconds for vertical tabulator stop on
119 hardcopy terminals
120 it Difference between tab positions
121 lh Height of soft labels
122 lm Lines of memory
123 lw Width of soft labels
124 li Number of lines
125 Nl Number of soft labels
126 pb Lowest baud rate which needs padding
127 sg Standout glitch
128 ug Underline glitch
129 vt virtual terminal number
130 ws Width of status line if different from screen width
131 .fi
132 .SS String capabilities
133 .nf
134 !1 shifted save key
135 !2 shifted suspend key
136 !3 shifted undo key
137 #1 shifted help key
138 #2 shifted home key
139 #3 shifted input key
140 #4 shifted cursor left key
141 %0 redo key
142 %1 help key
143 %2 mark key
144 %3 message key
145 %4 move key
146 %5 next-object key
147 %6 open key
148 %7 options key
149 %8 previous-object key
150 %9 print key
151 %a shifted message key
152 %b shifted move key
153 %c shifted next key
154 %d shifted options key
155 %e shifted previous key
156 %f shifted print key
157 %g shifted redo key
158 %h shifted replace key
159 %i shifted cursor right key
160 %j shifted resume key
161 &0 shifted cancel key
162 &1 reference key
163 &2 refresh key
164 &3 replace key
165 &4 restart key
166 &5 resume key
167 &6 save key
168 &7 suspend key
169 &8 undo key
170 &9 shifted begin key
171 *0 shifted find key
172 *1 shifted command key
173 *2 shifted copy key
174 *3 shifted create key
175 *4 shifted delete character
176 *5 shifted delete line
177 *6 select key
178 *7 shifted end key
179 *8 shifted clear line key
180 *9 shifted exit key
181 @0 find key
182 @1 begin key
183 @2 cancel key
184 @3 close key
185 @4 command key
186 @5 copy key
187 @6 create key
188 @7 end key
189 @8 enter/send key
190 @9 exit key
191 al Insert one line
192 AL Insert %1 lines
193 ac Pairs of block graphic characters to map alternate character set
194 ae End alternative character set
195 as Start alternative character set for block graphic characters
196 bc Backspace, if not \f[B]\[ha]H\f[]
197 bl Audio bell
198 bt Move to previous tab stop
199 cb Clear from beginning of line to cursor
200 cc Dummy command character
201 cd Clear to end of screen
202 ce Clear to end of line
203 ch Move cursor horizontally only to column %1
204 cl Clear screen and cursor home
205 cm Cursor move to row %1 and column %2 (on screen)
206 CM Move cursor to row %1 and column %2 (in memory)
207 cr Carriage return
208 cs Scroll region from line %1 to %2
209 ct Clear tabs
210 cv Move cursor vertically only to line %1
211 dc Delete one character
212 DC Delete %1 characters
213 dl Delete one line
214 DL Delete %1 lines
215 dm Begin delete mode
216 do Cursor down one line
217 DO Cursor down #1 lines
218 ds Disable status line
219 eA Enable alternate character set
220 ec Erase %1 characters starting at cursor
221 ed End delete mode
222 ei End insert mode
223 ff Formfeed character on hardcopy terminals
224 fs Return character to its position before going to status line
225 F1 The string sent by function key f11
226 F2 The string sent by function key f12
227 F3 The string sent by function key f13
228 \&... \&...
229 F9 The string sent by function key f19
230 FA The string sent by function key f20
231 FB The string sent by function key f21
232 \&... \&...
233 FZ The string sent by function key f45
234 Fa The string sent by function key f46
235 Fb The string sent by function key f47
236 \&... \&...
237 Fr The string sent by function key f63
238 hd Move cursor a half line down
239 ho Cursor home
240 hu Move cursor a half line up
241 i1 Initialization string 1 at login
242 i3 Initialization string 3 at login
243 is Initialization string 2 at login
244 ic Insert one character
245 IC Insert %1 characters
246 if Initialization file
247 im Begin insert mode
248 ip Insert pad time and needed special characters after insert
249 iP Initialization program
250 K1 upper left key on keypad
251 K2 center key on keypad
252 K3 upper right key on keypad
253 K4 bottom left key on keypad
254 K5 bottom right key on keypad
255 k0 Function key 0
256 k1 Function key 1
257 k2 Function key 2
258 k3 Function key 3
259 k4 Function key 4
260 k5 Function key 5
261 k6 Function key 6
262 k7 Function key 7
263 k8 Function key 8
264 k9 Function key 9
265 k; Function key 10
266 ka Clear all tabs key
267 kA Insert line key
268 kb Backspace key
269 kB Back tab stop
270 kC Clear screen key
271 kd Cursor down key
272 kD Key for delete character under cursor
273 ke turn keypad off
274 kE Key for clear to end of line
275 kF Key for scrolling forward/down
276 kh Cursor home key
277 kH Cursor hown down key
278 kI Insert character/Insert mode key
279 kl Cursor left key
280 kL Key for delete line
281 kM Key for exit insert mode
282 kN Key for next page
283 kP Key for previous page
284 kr Cursor right key
285 kR Key for scrolling backward/up
286 ks Turn keypad on
287 kS Clear to end of screen key
288 kt Clear this tab key
289 kT Set tab here key
290 ku Cursor up key
291 l0 Label of zeroth function key, if not f0
292 l1 Label of first function key, if not f1
293 l2 Label of first function key, if not f2
294 \&... \&...
295 la Label of tenth function key, if not f10
296 le Cursor left one character
297 ll Move cursor to lower left corner
298 LE Cursor left %1 characters
299 LF Turn soft labels off
300 LO Turn soft labels on
301 mb Start blinking
302 MC Clear soft margins
303 md Start bold mode
304 me End all mode like so, us, mb, md, and mr
305 mh Start half bright mode
306 mk Dark mode (Characters invisible)
307 ML Set left soft margin
308 mm Put terminal in meta mode
309 mo Put terminal out of meta mode
310 mp Turn on protected attribute
311 mr Start reverse mode
312 MR Set right soft margin
313 nd Cursor right one character
314 nw Carriage return command
315 pc Padding character
316 pf Turn printer off
317 pk Program key %1 to send string %2 as if typed by user
318 pl Program key %1 to execute string %2 in local mode
319 pn Program soft label %1 to show string %2
320 po Turn the printer on
321 pO Turn the printer on for %1 (<256) bytes
322 ps Print screen contents on printer
323 px Program key %1 to send string %2 to computer
324 r1 Reset string 1 to set terminal to sane modes
325 r2 Reset string 2 to set terminal to sane modes
326 r3 Reset string 3 to set terminal to sane modes
327 RA disable automatic margins
328 rc Restore saved cursor position
329 rf Reset string filename
330 RF Request for input from terminal
331 RI Cursor right %1 characters
332 rp Repeat character %1 for %2 times
333 rP Padding after character sent in replace mode
334 rs Reset string
335 RX Turn off XON/XOFF flow control
336 sa Set %1 %2 %3 %4 %5 %6 %7 %8 %9 attributes
337 SA enable automatic margins
338 sc Save cursor position
339 se End standout mode
340 sf Normal scroll one line
341 SF Normal scroll %1 lines
342 so Start standout mode
343 sr Reverse scroll
344 SR scroll back %1 lines
345 st Set tabulator stop in all rows at current column
346 SX Turn on XON/XOFF flow control
347 ta move to next hardware tab
348 tc Read in terminal description from another entry
349 te End program that uses cursor motion
350 ti Begin program that uses cursor motion
351 ts Move cursor to column %1 of status line
352 uc Underline character under cursor and move cursor right
353 ue End underlining
354 up Cursor up one line
355 UP Cursor up %1 lines
356 us Start underlining
357 vb Visible bell
358 ve Normal cursor visible
359 vi Cursor invisible
360 vs Standout cursor
361 wi Set window from line %1 to %2 and column %3 to %4
362 XF XOFF character if not \f[B]\[ha]S\f[]
363 .fi
364 .P
365 There are several ways of defining the control codes for string capabilities:
366 .P
367 Every normal character represents itself,
368 except \[aq]\[ha]\[aq], \[aq]\[rs]\[aq], and \[aq]%\[aq].
369 .P
370 A \f[B]\[ha]x\f[] means Control-x.
371 Control-A equals 1 decimal.
372 .P
373 \[rs]x means a special code.
374 x can be one of the following characters:
375 .RS
376 E Escape (27)
377 .br
378 n Linefeed (10)
379 .br
380 r Carriage return (13)
381 .br
382 t Tabulation (9)
383 .br
384 b Backspace (8)
385 .br
386 f Form feed (12)
387 .br
388 0 Null character.
389 A \[rs]xxx specifies the octal character xxx.
390 .RE
391 .TP
392 i
393 Increments parameters by one.
394 .TP
395 r
396 Single parameter capability
397 .TP
398 +
399 Add value of next character to this parameter and do binary output
400 .TP
401 2
402 Do ASCII output of this parameter with a field with of 2
403 .TP
404 d
405 Do ASCII output of this parameter with a field with of 3
406 .TP
407 %
408 Print a \[aq]%\[aq]
409 .P
410 If you use binary output,
411 then you should avoid the null character (\[aq]\[rs]0\[aq])
412 because it terminates the string.
413 You should reset tabulator expansion
414 if a tabulator can be the binary output of a parameter.
415 .TP
416 Warning:
417 The above metacharacters for parameters may be wrong: they document Minix
418 termcap which may not be compatible with Linux termcap.
419 .P
420 The block graphic characters can be specified by three string capabilities:
421 .TP
422 as
423 start the alternative charset
424 .TP
425 ae
426 end the alternative charset
427 .TP
428 ac
429 pairs of characters.
430 The first character is the name of the block graphic
431 symbol and the second characters is its definition.
432 .P
433 The following names are available:
434 .P
435 .nf
436 + right arrow (>)
437 , left arrow (<)
438 \&. down arrow (v)
439 0 full square (#)
440 I lantern (#)
441 - upper arrow (\[ha])
442 \&' rhombus (+)
443 a chess board (:)
444 f degree (')
445 g plus-minus (#)
446 h square (#)
447 j right bottom corner (+)
448 k right upper corner (+)
449 l left upper corner (+)
450 m left bottom corner (+)
451 n cross (+)
452 o upper horizontal line (-)
453 q middle horizontal line (-)
454 s bottom horizontal line (_)
455 t left tee (+)
456 u right tee (+)
457 v bottom tee (+)
458 w normal tee (+)
459 x vertical line (|)
460 \[ti] paragraph (???)
461 .fi
462 .P
463 The values in parentheses are suggested defaults which are used by the
464 .I curses
465 library, if the capabilities are missing.
466 .SH SEE ALSO
467 .BR ncurses (3),
468 .BR termcap (3),
469 .BR terminfo (5)