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