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