Imported upstream version 1.5
[manpages-zh.git] / raw / man5 / termcap.5
blob4883fba57b4ffaf0eb21117721596a1311f596c7
1 .\" Copyright (c) 1993 Michael Haardt (michael@moria.de), Fri Apr  2 11:32:09 MET DST 1993
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
12 .\"
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\" GNU General Public License for more details.
17 .\"
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
21 .\" USA.
22 .\"
23 .\" Modified formatting Sat Jul 24 17:13:38 1993, Rik Faith (faith@cs.unc.edu)
24 .\" Modified (extensions and corrections) Sun May  1 14:21:25 MET DST 1994 Michael Haardt
25 .\"   If mistakes in the capabilities are found, please send a bug report to:
26 .\"   michael@moria.de
27 .\" Modified Mon Oct 21 17:47:19 EDT 1996 by Eric S. Raymond (esr@thyrsus.com)
28 .TH TERMCAP 5 "" "Linux" "Linux Programmer's Manual"
29 .SH NAME
30 termcap \- terminal capability database
31 .SH DESCRIPTION
32 The termcap database is an obsolete facility for describing the
33 capabilities of character-cell terminals and printers.  It is retained
34 only for capability with old programs; new ones should use the 
35 .BR terminfo (5)
36 database and associated libraries.
37 .LP
38 .B /etc/termcap
39 is an ASCII file (the database master) that lists the capabilities of
40 many different types of terminals.  Programs can read termcap to find
41 the particular escape codes needed to control the visual attributes of
42 the terminal actually in use.  (Other aspects of the terminal are
43 handled by stty.)  The termcap database is indexed on the TERM
44 environment variable.
45 .LP
46 Termcap entries must be defined on a single logical line, with `\\'
47 used to suppress the newline.  Fields are separated by `:'.  The first
48 field of each entry starts at the left-hand margin, and contains a list
49 of names for the terminal, separated by '|'.
50 .LP
51 The first subfield may (in BSD termcap entries from versions 4.3 and
52 prior) contain a short name consisting of two characters.  This short
53 name may consist of capital or small letters.  In 4.4BSD termcap
54 entries this field is omitted.
55 .LP
56 The second subfield (first, in the newer 4.4BSD format) contains the
57 name used by the environment variable TERM.  It should be spelled in
58 lowercase letters.  Selectable hardware capabilities should be marked
59 by appending a hyphen and a suffix to this name.  See below for an
60 example.  Usual suffixes are w (more than 80 characters wide), am
61 (automatic margins), nam (no automatic margins), and rv (reverse video
62 display).  The third subfield contains a long and descriptive name for
63 this termcap entry.
64 .LP
65 Subsequent fields contain the terminal capabilities; any continued
66 capability lines must be indented one tab from the left margin.
67 .LP
68 Although there is no defined order, it is suggested to write first
69 boolean, then numeric, and then string capabilities, each sorted
70 alphabetically without looking at lower or upper spelling.  Capabilities
71 of similar functions can be written in one line.
72 .LP
73 .nf
74 Example for:
75 .sp
76 Head line: vt|vt101|DEC VT 101 terminal in 80 character mode:\e
77 Head line: Vt|vt101-w|DEC VT 101 terminal in (wide) 132 character mode:\e
78 Boolean: :bs:\e
79 Numeric: :co#80:\e
80 String: :sr=\eE[H:\e
81 .SS "Boolean Capabilities"
82 .nf
83 5i      Printer will not echo on screen
84 am      Automatic margins which means automatic line wrap
85 bs      Control-H (8 dec.) performs a backspace
86 bw      Backspace on left margin wraps to previous line and right margin
87 da      Display retained above screen
88 db      Display retained below screen
89 eo      A space erases all characters at cursor position
90 es      Escape sequences and special characters work in status line
91 gn      Generic device
92 hc      This is a hardcopy terminal
93 HC      The cursor is hard to see when not on bottom line
94 hs      Has a status line
95 hz      Hazeltine bug, the terminal can not print tilde characters
96 in      Terminal inserts nulls, not spaces, to fill whitespace
97 km      Terminal has a meta key
98 mi      Cursor movement works in insert mode
99 ms      Cursor movement works in standout/underline mode
100 NP      No pad character
101 NR      ti does not reverse te
102 nx      No padding, must use XON/XOFF
103 os      Terminal can overstrike
104 ul      Terminal underlines although it can not overstrike
105 xb      Beehive glitch, f1 sends ESCAPE, f2 sends ^C
106 xn      Newline/wraparound glitch
107 xo      Terminal uses xon/xoff protocol
108 xs      Text typed over standout text will be displayed in standout
109 xt      Teleray glitch, destructive tabs and odd standout mode
111 .SS "Numeric Capabilities"
113 co      Number of columns
114 dB      Delay in milliseconds for backspace on hardcopy terminals
115 dC      Delay in milliseconds for carriage return on hardcopy terminals
116 dF      Delay in milliseconds for form feed on hardcopy terminals
117 dN      Delay in milliseconds for new line on hardcopy terminals
118 dT      Delay in milliseconds for tabulator stop on hardcopy terminals
119 dV      Delay in milliseconds for vertical tabulator stop on 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
132 .SS "String Capabilities"
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 cusor 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      Indert %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 ^H
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 scolling 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 scolling 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 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 file name
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 unvisible
360 vs      Standout cursor
361 wi      Set window from line %1 to %2 and column %3 to %4
362 XF      XOFF character if not ^S
365 There are several ways of defining the control codes for string capabilities:
367 Normal Characters except '^','\e' and '%' repesent themself.
369 A '^x' means Control-x.  Control-A equals 1 decimal.
371 \ex means a special code.  x can be one of the following charaters:
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.  A \exxx specifies the octal character xxx.
387 .IP i
388 Increments paramters by one.
389 .IP r
390 Single parameter capability
391 .IP +
392 Add value of next character to this parameter and do binary output
393 .IP 2
394 Do ASCII output of this parameter with a field with of 2
395 .IP d
396 Do ASCII output of this parameter with a field with of 3
397 .IP %
398 Print a '%'
400 If you use binary output, then you should avoid the null character
401 because it terminates the string.  You should reset tabulator expansion
402 if a tabulator can be the binary output of a parameter.
403 .IP Warning:
404 The above metacharacters for parameters may be wrong, they document Minix
405 termcap which may not be compatible with Linux termcap.
407 The block graphic characters can be specified by three string capabilities:
408 .IP as
409 start the alternative charset
410 .IP ae
411 end it
412 .IP ac
413 pairs of characters.  The first character is the name of the block graphic
414 symbol and the second characters is its definition.
416 The following names are available:
419 +       right arrow (>)
420 ,       left arrow (<)
421 \&.     down arrow (v)
422 0       full square (#)
423 I       latern (#)
424 -       upper arrow (^)
425 \&'     rhombus (+)
426 a       chess board (:)
427 f       degree (')
428 g       plus-minus (#)
429 h       square (#)
430 j       right bottom corner (+)
431 k       right upper corner (+)
432 l       left upper corner (+)
433 m       left bottom corner (+)
434 n       cross (+)
435 o       upper horizontal line (-)
436 q       middle horizontal line (-)
437 s       bottom horizontal line (_)
438 t       left tee (+)
439 u       right tee (+)
440 v       bottom tee (+)
441 w       normal tee (+)
442 x       vertical line (|)
443 ~       paragraph (???)
446 The values in parentheses are suggested defaults which are used by curses,
447 if the capabilities are missing.
448 .SH "SEE ALSO"
449 .BR termcap (3),
450 .BR curses (3),
451 .BR terminfo (5)