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