1TERMCAP(5)                 Linux Programmer's Manual                TERMCAP(5)
2
3
4

NAME

6       termcap - terminal capability database
7

DESCRIPTION

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  compatibility  with old programs; new programs should use the ter‐
12       minfo(5) database and associated libraries.
13
14       /etc/termcap is an ASCII file (the database master) that lists the  ca‐
15       pabilities  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       earlier) contain a short name consisting of two characters.  This short
28       name may consist of capital or small letters.  In 4.4BSD,  termcap  en‐
29       tries 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  ex‐
35       ample.   Usual suffixes are w (more than 80 characters wide), am (auto‐
36       matic margins), nam (no automatic margins), and rv (reverse video  dis‐
37       play).   The  third  subfield  contains a long and descriptive name for
38       this termcap entry.
39
40       Subsequent fields contain the terminal capabilities; any continued  ca‐
41       pability 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
93            hardcopy terminals
94       it   Difference between tab positions
95       lh   Height of soft labels
96       lm   Lines of memory
97       lw   Width of soft labels
98       li   Number of lines
99       Nl   Number of soft labels
100       pb   Lowest baud rate which needs padding
101       sg   Standout glitch
102       ug   Underline glitch
103       vt   virtual terminal number
104       ws   Width of status line if different from screen width
105
106   String capabilities
107       !1   shifted save key
108       !2   shifted suspend key
109       !3   shifted undo key
110       #1   shifted help key
111       #2   shifted home key
112       #3   shifted input key
113       #4   shifted cursor left key
114       %0   redo key
115       %1   help key
116       %2   mark key
117       %3   message key
118       %4   move key
119       %5   next-object key
120       %6   open key
121       %7   options key
122       %8   previous-object key
123       %9   print key
124       %a   shifted message key
125       %b   shifted move key
126       %c   shifted next key
127       %d   shifted options key
128       %e   shifted previous key
129       %f   shifted print key
130       %g   shifted redo key
131       %h   shifted replace key
132       %i   shifted cursor right key
133       %j   shifted resume key
134       &0   shifted cancel key
135       &1   reference key
136       &2   refresh key
137       &3   replace key
138       &4   restart key
139       &5   resume key
140       &6   save key
141       &7   suspend key
142       &8   undo key
143       &9   shifted begin key
144       *0   shifted find key
145       *1   shifted command key
146       *2   shifted copy key
147       *3   shifted create key
148       *4   shifted delete character
149       *5   shifted delete line
150       *6   select key
151       *7   shifted end key
152       *8   shifted clear line key
153       *9   shifted exit key
154       @0   find key
155       @1   begin key
156       @2   cancel key
157       @3   close key
158       @4   command key
159       @5   copy key
160       @6   create key
161       @7   end key
162       @8   enter/send key
163       @9   exit key
164       al   Insert one line
165       AL   Insert %1 lines
166       ac   Pairs of block graphic characters to map alternate character set
167       ae   End alternative character set
168       as   Start alternative character set for block graphic characters
169       bc   Backspace, if not ^H
170       bl   Audio bell
171       bt   Move to previous tab stop
172       cb   Clear from beginning of line to cursor
173       cc   Dummy command character
174       cd   Clear to end of screen
175       ce   Clear to end of line
176       ch   Move cursor horizontally only to column %1
177       cl   Clear screen and cursor home
178       cm   Cursor move to row %1 and column %2 (on screen)
179       CM   Move cursor to row %1 and column %2 (in memory)
180       cr   Carriage return
181       cs   Scroll region from line %1 to %2
182       ct   Clear tabs
183       cv   Move cursor vertically only to line %1
184       dc   Delete one character
185       DC   Delete %1 characters
186       dl   Delete one line
187       DL   Delete %1 lines
188       dm   Begin delete mode
189       do   Cursor down one line
190       DO   Cursor down #1 lines
191       ds   Disable status line
192       eA   Enable alternate character set
193       ec   Erase %1 characters starting at cursor
194       ed   End delete mode
195       ei   End insert mode
196       ff   Formfeed character on hardcopy terminals
197       fs   Return character to its position before going to status line
198       F1   The string sent by function key f11
199       F2   The string sent by function key f12
200       F3   The string sent by function key f13
201       ...  ...
202       F9   The string sent by function key f19
203       FA   The string sent by function key f20
204       FB   The string sent by function key f21
205       ...  ...
206       FZ   The string sent by function key f45
207       Fa   The string sent by function key f46
208       Fb   The string sent by function key f47
209       ...  ...
210       Fr   The string sent by function key f63
211       hd   Move cursor a half line down
212       ho   Cursor home
213       hu   Move cursor a half line up
214       i1   Initialization string 1 at login
215       i3   Initialization string 3 at login
216       is   Initialization string 2 at login
217       ic   Insert one character
218       IC   Insert %1 characters
219       if   Initialization file
220       im   Begin insert mode
221       ip   Insert pad time and needed special characters after insert
222       iP   Initialization program
223       K1   upper left key on keypad
224       K2   center key on keypad
225       K3   upper right key on keypad
226       K4   bottom left key on keypad
227       K5   bottom right key on keypad
228       k0   Function key 0
229       k1   Function key 1
230       k2   Function key 2
231       k3   Function key 3
232       k4   Function key 4
233       k5   Function key 5
234       k6   Function key 6
235       k7   Function key 7
236       k8   Function key 8
237       k9   Function key 9
238       k;   Function key 10
239       ka   Clear all tabs key
240       kA   Insert line key
241       kb   Backspace key
242       kB   Back tab stop
243       kC   Clear screen key
244       kd   Cursor down key
245       kD   Key for delete character under cursor
246       ke   turn keypad off
247       kE   Key for clear to end of line
248       kF   Key for scrolling forward/down
249       kh   Cursor home key
250       kH   Cursor hown down key
251       kI   Insert character/Insert mode key
252       kl   Cursor left key
253       kL   Key for delete line
254       kM   Key for exit insert mode
255       kN   Key for next page
256       kP   Key for previous page
257       kr   Cursor right key
258       kR   Key for scrolling backward/up
259       ks   Turn keypad on
260       kS   Clear to end of screen key
261       kt   Clear this tab key
262       kT   Set tab here key
263       ku   Cursor up key
264       l0   Label of zeroth function key, if not f0
265       l1   Label of first function key, if not f1
266       l2   Label of first function key, if not f2
267       ...  ...
268       la   Label of tenth function key, if not f10
269       le   Cursor left one character
270       ll   Move cursor to lower left corner
271       LE   Cursor left %1 characters
272       LF   Turn soft labels off
273       LO   Turn soft labels on
274       mb   Start blinking
275       MC   Clear soft margins
276       md   Start bold mode
277       me   End all mode like so, us, mb, md, and mr
278       mh   Start half bright mode
279       mk   Dark mode (Characters invisible)
280       ML   Set left soft margin
281       mm   Put terminal in meta mode
282       mo   Put terminal out of meta mode
283       mp   Turn on protected attribute
284       mr   Start reverse mode
285       MR   Set right soft margin
286       nd   Cursor right one character
287       nw   Carriage return command
288       pc   Padding character
289       pf   Turn printer off
290       pk   Program key %1 to send string %2 as if typed by user
291       pl   Program key %1 to execute string %2 in local mode
292       pn   Program soft label %1 to show string %2
293       po   Turn the printer on
294       pO   Turn the printer on for %1 (<256) bytes
295       ps   Print screen contents on printer
296       px   Program key %1 to send string %2 to computer
297       r1   Reset string 1 to set terminal to sane modes
298       r2   Reset string 2 to set terminal to sane modes
299       r3   Reset string 3 to set terminal to sane modes
300       RA   disable automatic margins
301       rc   Restore saved cursor position
302       rf   Reset string filename
303       RF   Request for input from terminal
304       RI   Cursor right %1 characters
305       rp   Repeat character %1 for %2 times
306       rP   Padding after character sent in replace mode
307       rs   Reset string
308       RX   Turn off XON/XOFF flow control
309       sa   Set %1 %2 %3 %4 %5 %6 %7 %8 %9 attributes
310       SA   enable automatic margins
311       sc   Save cursor position
312       se   End standout mode
313       sf   Normal scroll one line
314       SF   Normal scroll %1 lines
315       so   Start standout mode
316       sr   Reverse scroll
317       SR   scroll back %1 lines
318       st   Set tabulator stop in all rows at current column
319       SX   Turn on XON/XOFF flow control
320       ta   move to next hardware tab
321       tc   Read in terminal description from another entry
322       te   End program that uses cursor motion
323       ti   Begin program that uses cursor motion
324       ts   Move cursor to column %1 of status line
325       uc   Underline character under cursor and move cursor right
326       ue   End underlining
327       up   Cursor up one line
328       UP   Cursor up %1 lines
329       us   Start underlining
330       vb   Visible bell
331       ve   Normal cursor visible
332       vi   Cursor invisible
333       vs   Standout cursor
334       wi   Set window from line %1 to %2 and column %3 to %4
335       XF   XOFF character if not ^S
336
337       There are several ways of defining the control codes for  string  capa‐
338       bilities:
339
340       Every normal character represents itself, except '^', '\', and '%'.
341
342       A ^x means Control-x.  Control-A equals 1 decimal.
343
344       \x means a special code.  x can be one of the following characters:
345              E Escape (27)
346              n Linefeed (10)
347              r Carriage return (13)
348              t Tabulation (9)
349              b Backspace (8)
350              f Form feed (12)
351              0 Null character.  A \xxx specifies the octal character xxx.
352
353       i      Increments parameters by one.
354
355       r      Single parameter capability
356
357       +      Add value of next character to this parameter and do binary out‐
358              put
359
360       2      Do ASCII output of this parameter with a field with of 2
361
362       d      Do ASCII output of this parameter with a field with of 3
363
364       %      Print a '%'
365
366       If you use binary output, then you  should  avoid  the  null  character
367       ('\0')  because  it  terminates the string.  You should reset tabulator
368       expansion if a tabulator can be the binary output of a parameter.
369
370       Warning:
371              The above metacharacters for parameters may be wrong: they docu‐
372              ment  Minix termcap which may not be compatible with Linux term‐
373              cap.
374
375       The block graphic characters can be specified by three string capabili‐
376       ties:
377
378       as     start the alternative charset
379
380       ae     end the alternative charset
381
382       ac     pairs  of  characters.   The  first character is the name of the
383              block graphic symbol and the second characters  is  its  defini‐
384              tion.
385
386       The following names are available:
387
388       +    right arrow (>)
389       ,    left arrow (<)
390       .    down arrow (v)
391       0    full square (#)
392       I    lantern (#)
393       -    upper arrow (^)
394       '    rhombus (+)
395       a    chess board (:)
396       f    degree (')
397       g    plus-minus (#)
398       h    square (#)
399       j    right bottom corner (+)
400       k    right upper corner (+)
401       l    left upper corner (+)
402       m    left bottom corner (+)
403       n    cross (+)
404       o    upper horizontal line (-)
405       q    middle horizontal line (-)
406       s    bottom horizontal line (_)
407       t    left tee (+)
408       u    right tee (+)
409       v    bottom tee (+)
410       w    normal tee (+)
411       x    vertical line (|)
412       ~    paragraph (???)
413
414       The  values in parentheses are suggested defaults which are used by the
415       curses library, if the capabilities are missing.
416

SEE ALSO

418       ncurses(3), termcap(3), terminfo(5)
419

COLOPHON

421       This page is part of release 5.13 of the Linux  man-pages  project.   A
422       description  of  the project, information about reporting bugs, and the
423       latest    version    of    this    page,    can     be     found     at
424       https://www.kernel.org/doc/man-pages/.
425
426
427
428Linux                             2020-08-13                        TERMCAP(5)
Impressum