Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | .\" Copyright (c) 1985, 1991 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms, with or without | |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
7 | .\" 1. Redistributions of source code must retain the above copyright | |
8 | .\" notice, this list of conditions and the following disclaimer. | |
9 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer in the | |
11 | .\" documentation and/or other materials provided with the distribution. | |
12 | .\" 3. All advertising materials mentioning features or use of this software | |
13 | .\" must display the following acknowledgement: | |
14 | .\" This product includes software developed by the University of | |
15 | .\" California, Berkeley and its contributors. | |
16 | .\" 4. Neither the name of the University nor the names of its contributors | |
17 | .\" may be used to endorse or promote products derived from this software | |
18 | .\" without specific prior written permission. | |
19 | .\" | |
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
30 | .\" SUCH DAMAGE. | |
31 | .\" | |
32 | .\" @(#)termcap.5 6.9 (Berkeley) 5/10/91 | |
33 | .\" | |
34 | .Dd May 10, 1991 | |
35 | .Dt TERMCAP 5 | |
36 | .Os BSD 3 | |
37 | .Sh NAME | |
38 | .Nm termcap | |
39 | .Nd terminal capability data base | |
40 | .Sh SYNOPSIS | |
41 | .Nm termcap | |
42 | .Sh DESCRIPTION | |
43 | The | |
44 | .Nm Termcap | |
45 | file | |
46 | is a data base describing terminals, | |
47 | used, | |
48 | for example, | |
49 | by | |
50 | .Xr \&vi 1 | |
51 | and | |
52 | .Xr curses 3 . | |
53 | Terminals are described in | |
54 | .Nm termcap | |
55 | by giving a set of capabilities that they have and by describing | |
56 | how operations are performed. | |
57 | Padding requirements and initialization sequences | |
58 | are included in | |
59 | .Nm termcap . | |
60 | .Pp | |
61 | Entries in | |
62 | .Nm termcap | |
63 | consist of a number of `:'-separated fields. | |
64 | The first entry for each terminal gives the names that are known for the | |
65 | terminal, separated by `|' characters. | |
66 | The first name is always two characters | |
67 | long and is used by older systems which store the terminal type | |
68 | in a 16-bit word in a system-wide data base. | |
69 | The second name given is the most common abbreviation for the terminal, | |
70 | the last name given should be a long name fully identifying the terminal, | |
71 | and all others are understood as synonyms for the terminal name. | |
72 | All names but the first and last | |
73 | should be in lower case and contain no blanks; | |
74 | the last name may well contain | |
75 | upper case and blanks for readability. | |
76 | .Pp | |
77 | Terminal names (except for the last, verbose entry) | |
78 | should be chosen using the following conventions. | |
79 | The particular piece of hardware making up the terminal | |
80 | should have a root name chosen, thus | |
81 | .Dq hp2621 | |
82 | This name should not contain hyphens. | |
83 | Modes that the hardware can be in | |
84 | or user preferences | |
85 | should be indicated by appending a hyphen and an indicator of the mode. | |
86 | Therefore, a | |
87 | .Dq vt100 | |
88 | in 132-column mode would be | |
89 | .Dq vt100-w . | |
90 | The following suffixes should be used where possible: | |
91 | .Pp | |
92 | .Bd -filled -offset indent | |
93 | .Bl -column indent "With automatic margins (usually default)xx" | |
94 | .Sy Suffix Meaning Example | |
95 | -w Wide mode (more than 80 columns) vt100-w | |
96 | -am With automatic margins (usually default) vt100-am | |
97 | -nam Without automatic margins vt100-nam | |
98 | .Pf \- Ar n Ta No "Number of lines on the screen aaa-60" | |
99 | -na No arrow keys (leave them in local) concept100-na | |
100 | .Pf \- Ar \&np Ta No "Number of pages of memory concept100-4p" | |
101 | -rv Reverse video concept100-rv | |
102 | .El | |
103 | .Ed | |
104 | .Sh CAPABILITIES | |
105 | The characters in the | |
106 | The | |
107 | .Em Notes | |
108 | function | |
109 | field in the table have the following meanings | |
110 | (more than one may apply to a capability): | |
111 | .Pp | |
112 | .Bd -unfilled -offset indent | |
113 | N indicates numeric parameter(s) | |
114 | P indicates that padding may be specified | |
115 | * indicates that padding may be based on the number of lines affected | |
116 | o indicates capability is obsolete | |
117 | .Ed | |
118 | .Pp | |
119 | .Dq Obsolete | |
120 | capabilities have no | |
121 | .Em terminfo | |
122 | equivalents, | |
123 | since they were considered useless, | |
124 | or are subsumed by other capabilities. | |
125 | New software should not rely on them at all. | |
126 | .Pp | |
127 | .Bl -column indent indent indent | |
128 | .Sy Name Type Notes Description | |
129 | functions | |
130 | .It "ae str (P) End alternate character set." | |
131 | .It AL str (NP*) Add" | |
132 | .Em n | |
133 | new blank lines | |
134 | .It "al str (P*) Add new blank line." | |
135 | .It "am bool Terminal has automatic margins." | |
136 | .It "as str (P) Start alternate character set." | |
137 | .It "bc str (o) Backspace if not." | |
138 | .Sy \&^H . | |
139 | .It "bl str (P) Audible signal (bell)." | |
140 | .It "bs bool (o) Terminal can backspace with" | |
141 | .Sy \&^H . | |
142 | .It "bt str (P) Back tab." | |
143 | .It "bw bool " Ta Sy \&le | |
144 | (backspace) wraps from column 0 to last column. | |
145 | .It "CC str Terminal settable command character in prototype." | |
146 | .It "cd str (P*) Clear to end of display." | |
147 | .It "ce str (P) Clear to end of line." | |
148 | .It "ch str (NP) Set cursor column (horizontal position)." | |
149 | .It "cl str (P*) Clear screen and home cursor." | |
150 | .It "CM str (NP) Memory-relative cursor addressing." | |
151 | .It "cm str (NP) Screen-relative cursor motion." | |
152 | .It "co num Number of columns in a line (See" | |
153 | .Sx BUGS | |
154 | section below). | |
155 | .It "cr str (P) Carriage return." | |
156 | .It "cs str (NP) Change scrolling region (VT100)." | |
157 | .It "ct str (P) Clear all tab stops." | |
158 | .It "cv str (NP) Set cursor row (vertical position)." | |
159 | .It "da bool Display may be retained above the screen." | |
160 | .It "dB num (o) Milliseconds of" | |
161 | .Sy \&bs | |
162 | delay needed (default 0). | |
163 | .It "db bool Display may be retained below the screen." | |
164 | .It "DC str (NP*) Delete" | |
165 | .Em n | |
166 | characters. | |
167 | .It "dC num (o) Milliseconds of" | |
168 | .Sy \&cr | |
169 | delay needed (default 0). | |
170 | .It "dc str (P*) Delete character." | |
171 | .It "dF num (o) Milliseconds of" | |
172 | .Sy \&ff | |
173 | delay needed (default 0). | |
174 | .It "DL str (NP*) Delete" | |
175 | .Ar n | |
176 | lines. | |
177 | .It "dl str (P*) Delete line." | |
178 | .It "dm str Enter delete mode." | |
179 | .It "dN num (o) Milliseconds of | |
180 | .Sy \&nl | |
181 | delay needed (default 0). | |
182 | .It "DO str (NP*) Move cursor down: | |
183 | .Ar n | |
184 | lines. | |
185 | .It "do str Down one line." | |
186 | .It "ds str Disable status line." | |
187 | .It "dT num (o) Milliseconds of horizontal tab delay needed (default 0)." | |
188 | .It "dV num (o) Milliseconds of vertical tab delay needed (default 0)." | |
189 | .It "ec str (NP) Erase" | |
190 | .Ar n | |
191 | characters. | |
192 | .It "ed str End delete mode." | |
193 | .It "ei str End insert mode." | |
194 | .It "eo bool Can erase overstrikes with a blank." | |
195 | .It "EP bool (o) Even parity." | |
196 | .It "es bool Escape can be used on the status line." | |
197 | .It "ff str (P*) Hardcopy terminal page eject." | |
198 | .It "fs str Return from status line." | |
199 | .It "gn bool Generic line type, for example dialup, switch)." | |
200 | .It "hc bool Hardcopy terminal." | |
201 | .It "HD bool (o) Half-duplex." | |
202 | .It "hd str Half-line down (forward 1/2 linefeed)." | |
203 | .It "ho str (P) Home cursor." | |
204 | .It "hs bool Has extra" | |
205 | .Dq status line . | |
206 | .It "hu str Half-line up (reverse 1/2 linefeed)." | |
207 | .It "hz bool Cannot print ``~'' (Hazeltine)." | |
208 | .It "i1-i3 str Terminal initialization strings" | |
209 | .Pf ( Xr terminfo | |
210 | only) | |
211 | .It "IC str (NP*) Insert" | |
212 | .Ar n | |
213 | blank characters. | |
214 | .It "ic str (P*) Insert character." | |
215 | .It "if str Name of file containing initialization string." | |
216 | .It "im str Enter insert mode." | |
217 | .It "in bool Insert mode distinguishes nulls." | |
218 | .It "iP str Pathname of program for initialization" | |
219 | .Pf ( Xr terminfo | |
220 | only). | |
221 | .It "ip str (P*) Insert pad after character inserted." | |
222 | .It "is str Terminal initialization string" | |
223 | .Pf ( Nm termcap | |
224 | only). | |
225 | .It "it num Tabs initially every" | |
226 | .Ar n | |
227 | positions. | |
228 | .It "K1 str Sent by keypad upper left." | |
229 | .It "K2 str Sent by keypad upper right." | |
230 | .It "K3 str Sent by keypad center." | |
231 | .It "K4 str Sent by keypad lower left." | |
232 | .It "K5 str Sent by keypad lower right." | |
233 | .It "k0-k9 str Sent by function keys 0-9." | |
234 | .It "kA str Sent by insert-line key." | |
235 | .It "ka str Sent by clear-all-tabs key." | |
236 | .It "kb str Sent by backspace key." | |
237 | .It "kC str Sent by clear-screen or erase key." | |
238 | .It "kD str Sent by delete-character key." | |
239 | .It "kd str Sent by down-arrow key." | |
240 | .It "kE str Sent by clear-to-end-of-line key." | |
241 | .It "ke str Out of" | |
242 | .Dq keypad transmit | |
243 | mode. | |
244 | .It "kF str Sent by scroll-forward/down key." | |
245 | .It "kH str Sent by home-down key." | |
246 | .It "kh str Sent by home key." | |
247 | .It "kI str Sent by insert-character or enter-insert-mode key." | |
248 | .It "kL str Sent by delete-line key." | |
249 | .It "kl str Sent by left-arrow key." | |
250 | .It "kM str Sent by insert key while in insert mode." | |
251 | .It "km bool Has a" | |
252 | .Dq meta | |
253 | key (shift, sets parity bit). | |
254 | .It "kN str Sent by next-page key." | |
255 | .It "kn num (o) Number of function" | |
256 | .Pq Sy \&k\&0 Ns \- Sy \&k\&9 | |
257 | keys (default 0). | |
258 | .It "ko str (o) Termcap entries for other non-function keys." | |
259 | .It "kP str Sent by previous-page key." | |
260 | .It "kR str Sent by scroll-backward/up key." | |
261 | .It "kr str Sent by right-arrow key." | |
262 | .It "kS str Sent by clear-to-end-of-screen key." | |
263 | .It "ks str Put terminal in" | |
264 | .Dq keypad transmit | |
265 | mode. | |
266 | .It "kT str Sent by set-tab key." | |
267 | .It "kt str Sent by clear-tab key." | |
268 | .It "ku str Sent by up-arrow key." | |
269 | .It "l0-l9 str Labels on function keys if not" | |
270 | .Dq \&f Ns Em n . | |
271 | .It "LC bool (o) Lower-case only." | |
272 | .It "LE str (NP) Move cursor left" | |
273 | .Ar n | |
274 | positions. | |
275 | .It "le str (P) Move cursor left one position." | |
276 | .It "li num Number of lines on screen or page (See" | |
277 | .Sx BUGS | |
278 | section below) | |
279 | .It "ll str Last line, first column | |
280 | .It "lm num Lines of memory if >" Sy \&li | |
281 | (0 means varies). | |
282 | .It "ma str (o) Arrow key map (used by" | |
283 | .Xr \&vi | |
284 | version 2 only). | |
285 | .It "mb str Turn on blinking attribute." | |
286 | .It "md str Turn on bold (extra bright) attribute." | |
287 | .It "me str Turn off all attributes." | |
288 | .It "mh str Turn on half-bright attribute." | |
289 | .It "mi bool Safe to move while in insert mode." | |
290 | .It "mk str Turn on blank attribute (characters invisible)." | |
291 | .It "ml str (o) Memory lock on above cursor." | |
292 | .It "mm str Turn on" | |
293 | .Dq meta mode | |
294 | (8th bit). | |
295 | .It "mo str Turn off" | |
296 | .Dq meta mode . | |
297 | .It "mp str Turn on protected attribute." | |
298 | .It "mr str Turn on reverse-video attibute." | |
299 | .It "ms bool Safe to move in standout modes." | |
300 | .It "mu str (o) Memory unlock (turn off memory lock)." | |
301 | .It "nc bool (o) No correctly-working" | |
302 | .Sy \&cr | |
303 | (Datamedia 2500, Hazeltine 2000). | |
304 | .It "nd str Non-destructive space (cursor right)." | |
305 | .It "NL bool (o)" Ta Sy \&\en No "is newline, not line feed." | |
306 | .It "nl str (o) Newline character if not" Sy \en . | |
307 | .It "ns bool (o) Terminal is a" Tn CRT No "but doesn't scroll." | |
308 | .It "nw str (P) Newline (behaves like" | |
309 | .Sy \&cr | |
310 | followed by | |
311 | .Sy \&do ). | |
312 | .It "OP bool (o) Odd parity." | |
313 | .It "os bool Terminal overstrikes." | |
314 | .It "pb num Lowest baud where delays are required." | |
315 | .It "pc str Pad character (default" Tn NUL ). | |
316 | .It "pf str Turn off the printer." | |
317 | .It "pk str Program function key" | |
318 | .Em n | |
319 | to type string | |
320 | .Em s | |
321 | .Pf ( Xr terminfo | |
322 | only). | |
323 | .It "pl str Program function key" | |
324 | .Em n | |
325 | to execute string | |
326 | .Em s | |
327 | .Pf ( Xr terminfo | |
328 | only). | |
329 | .It "pO str (N) Turn on the printer for" | |
330 | .Em n | |
331 | bytes. | |
332 | .It "po str Turn on the printer." | |
333 | .It "ps str Print contents of the screen." | |
334 | .It "pt bool (o) Has hardware tabs (may need to be set with" | |
335 | .Sy \&is ). | |
336 | .It "px str Program function key" | |
337 | .Em n | |
338 | to transmit string | |
339 | .Em s | |
340 | .Pf ( Xr terminfo | |
341 | only). | |
342 | .It "r1-r3 str Reset terminal completely to sane modes" | |
343 | .Pf ( Xr terminfo | |
344 | only). | |
345 | .It "rc str (P) Restore cursor to position of last" | |
346 | .Sy \&sc . | |
347 | .It "rf str Name of file containing reset codes." | |
348 | .It "RI str (NP) Move cursor right" | |
349 | .Em n | |
350 | positions. | |
351 | .It "rp str (NP*) Repeat character" | |
352 | .Em c n | |
353 | times. | |
354 | .It "rs str Reset terminal completely to sane modes" | |
355 | .Pf ( Nm termcap | |
356 | only). | |
357 | .It "sa str (NP) Define the video attributes." | |
358 | .It "sc str (P) Save cursor position." | |
359 | .It "se str End standout mode." | |
360 | .It "SF str (NP*) Scroll forward" | |
361 | .Em n | |
362 | lines. | |
363 | .It "sf str (P) Scroll text up." | |
364 | .It "sg num Number of garbage chars left by" | |
365 | .Sy \&so | |
366 | or | |
367 | .Sy \&se | |
368 | (default 0). | |
369 | .It "so str Begin standout mode." | |
370 | .It "SR str (NP*) Scroll backward" | |
371 | .Em n | |
372 | lines. | |
373 | .It "sr str (P) Scroll text down." | |
374 | .It "st str Set a tab in all rows, current column." | |
375 | .It "ta str (P) Tab to next 8-position hardware tab stop." | |
376 | .It "tc str Entry of similar terminal \- must be last." | |
377 | .It "te str String to end programs that use" | |
378 | .Nm termcap . | |
379 | .It "ti str String to begin programs that use" | |
380 | .Nm termcap . | |
381 | .It "ts str (N) Go to status line, column" | |
382 | .Em n . | |
383 | .It "UC bool (o) Upper-case only." | |
384 | .It "uc str Underscore one character and move past it." | |
385 | .It "ue str End underscore mode." | |
386 | .It "ug num Number of garbage chars left by" | |
387 | .Sy \&us | |
388 | or | |
389 | .Sy \&ue | |
390 | (default 0). | |
391 | .It "ul bool Underline character overstrikes." | |
392 | .It "UP str (NP*) Move cursor up" | |
393 | .Em n | |
394 | lines. | |
395 | .It "up str Upline (cursor up)." | |
396 | .It "us str Start underscore mode." | |
397 | .It "vb str Visible bell (must not move cursor)." | |
398 | .It "ve str Make cursor appear normal (undo" | |
399 | .Sy \&vs Ns / Sy \&vi ) . | |
400 | .It "vi str Make cursor invisible." | |
401 | .It "vs str Make cursor very visible." | |
402 | .It "vt num Virtual terminal number (not supported on all systems)." | |
403 | .It "wi str (N) Set current window." | |
404 | .It "ws num Number of columns in status line." | |
405 | .It "xb bool Beehive" | |
406 | .Pf ( "f1=" Dv ESC , | |
407 | .Pf "f2=" Sy \&^C ) . | |
408 | .It "xn bool Newline ignored after 80 cols (Concept)." | |
409 | .It "xo bool Terminal uses xoff/xon" | |
410 | .Pq Dv DC3 Ns / Ns Dv DC1 | |
411 | handshaking. | |
412 | .It "xr bool (o) Return acts like" | |
413 | .Sy "ce cr nl" | |
414 | (Delta Data). | |
415 | .It "xs bool Standout not erased by overwriting (Hewlett-Packard)." | |
416 | .It "xt bool Tabs ruin, magic" | |
417 | .SY \&so | |
418 | char (Teleray 1061). | |
419 | .It "xx bool (o) Tektronix 4025 insert-line." | |
420 | .El | |
421 | .Ss A Sample Entry | |
422 | The following entry, which describes the Concept\-100, is among the more | |
423 | complex entries in the | |
424 | .Nm termcap | |
425 | file as of this writing. | |
426 | .Pp | |
427 | .Bd -literal | |
428 | ca\||\|concept100\||\|c100\||\|concept\||\|c104\||\|concept100-4p\||\|HDS Concept\-100:\e | |
429 | :al=3*\eE^R:am:bl=^G:cd=16*\eE^C:ce=16\eE^U:cl=2*^L:cm=\eEa%+ %+ :\e | |
430 | :co#80:.cr=9^M:db:dc=16\eE^A:dl=3*\eE^B:do=^J:ei=\eE\e200:eo:im=\eE^P:in:\e | |
431 | :ip=16*:is=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200\eEo\e47\eE:k1=\eE5:\e | |
432 | :k2=\eE6:k3=\eE7:kb=^h:kd=\eE<:ke=\eEx:kh=\eE?:kl=\eE>:kr=\eE=:ks=\eEX:\e | |
433 | :ku=\eE;:le=^H:li#24:mb=\eEC:me=\eEN\e200:mh=\eEE:mi:mk=\eEH:mp=\eEI:\e | |
434 | :mr=\eED:nd=\eE=:pb#9600:rp=0.2*\eEr%.%+ :se=\eEd\eEe:sf=^J:so=\eEE\eED:\e | |
435 | :.ta=8\et:te=\eEv \e200\e200\e200\e200\e200\e200\eEp\er\en:\e | |
436 | :ti=\eEU\eEv 8p\eEp\er:ue=\eEg:ul:up=\eE;:us=\eEG:\e | |
437 | :vb=\eEk\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\eEK:\e | |
438 | :ve=\eEw:vs=\eEW:vt#8:xn:\e | |
439 | :bs:cr=^M:dC#9:dT#8:nl=^J:ta=^I:pt: | |
440 | .Ed | |
441 | .Pp | |
442 | Entries may continue onto multiple lines by giving a \e as the last | |
443 | character of a line, and empty fields | |
444 | may be included for readability (here between the last field on a line | |
445 | and the first field on the next). | |
446 | Comments may be included on lines beginning with | |
447 | .Dq # . | |
448 | .Ss Types of Capabilities | |
449 | Capabilities in | |
450 | .Nm termcap | |
451 | are of three types: Boolean capabilities, | |
452 | which indicate particular features that the terminal has; | |
453 | numeric capabilities, | |
454 | giving the size of the display or the size of other attributes; | |
455 | and string capabilities, | |
456 | which give character sequences that can be used to perform particular | |
457 | terminal operations. | |
458 | All capabilities have two-letter codes. | |
459 | For instance, the fact that | |
460 | the Concept has | |
461 | .Em automatic margins | |
462 | (an automatic return and linefeed | |
463 | when the end of a line is reached) is indicated by the Boolean capability | |
464 | .Sy \&am . | |
465 | Hence the description of the Concept includes | |
466 | .Sy \&am . | |
467 | .Pp | |
468 | Numeric capabilities are followed by the character `#' then the value. | |
469 | In the example above | |
470 | .Sy \&co , | |
471 | which indicates the number of columns the display has, | |
472 | gives the value `80' for the Concept. | |
473 | .Pp | |
474 | Finally, string-valued capabilities, such as | |
475 | .Sy \&ce | |
476 | (clear-to-end-of-line | |
477 | sequence) are given by the two-letter code, an `=', then a string | |
478 | ending at the next following `:'. | |
479 | A delay in milliseconds may appear after | |
480 | the `=' in such a capability, | |
481 | which causes padding characters to be supplied by | |
482 | .Xr tputs | |
483 | after the remainder of the string is sent to provide this delay. | |
484 | The delay can be either a number, | |
485 | such as `20', or a number followed by | |
486 | an `*', | |
487 | such as `3*'. | |
488 | An `*' indicates that the padding required is proportional | |
489 | to the number of lines affected by the operation, and the amount given is | |
490 | the per-affected-line padding required. | |
491 | (In the case of insert-character, | |
492 | the factor is still the number of | |
493 | .Em lines | |
494 | affected; | |
495 | this is always 1 unless the terminal has | |
496 | .Sy \&in | |
497 | and the software uses it.) | |
498 | When an `*' is specified, it is sometimes useful to give a delay of the form | |
499 | `3.5' to specify a delay per line to tenths of milliseconds. | |
500 | (Only one decimal place is allowed.) | |
501 | .Pp | |
502 | A number of escape sequences are provided in the string-valued capabilities | |
503 | for easy encoding of control characters there. | |
504 | .Sy \&\eE | |
505 | maps to an | |
506 | .Dv ESC | |
507 | character, | |
508 | .Sy \&^X | |
509 | maps to a control-X for any appropriate X, | |
510 | and the sequences | |
511 | .Sy \&\en | |
512 | .Sy \&\er | |
513 | .Sy \&\et | |
514 | .Sy \&\eb | |
515 | .Sy \&\ef | |
516 | map to linefeed, return, tab, backspace, and formfeed, respectively. | |
517 | Finally, characters may be given as three octal digits after a | |
518 | .Sy \&\e , | |
519 | and the characters | |
520 | .Sy \&^ | |
521 | and | |
522 | .Sy \&\e | |
523 | may be given as | |
524 | .Sy \&\e^ | |
525 | and | |
526 | .Sy \&\e\e . | |
527 | If it is necessary to place a | |
528 | .Sy \&: | |
529 | in a capability it must be escaped in | |
530 | octal as | |
531 | .Sy \&\e072 . | |
532 | If it is necessary to place a | |
533 | .Dv NUL | |
534 | character in a string capability it | |
535 | must be encoded as | |
536 | .Sy \&\e200 . | |
537 | (The routines that deal with | |
538 | .Nm termcap | |
539 | use C strings and strip the high bits of the output very late, so that | |
540 | a | |
541 | .Sy \&\e200 | |
542 | comes out as a | |
543 | .Sy \&\e000 | |
544 | would.) | |
545 | .Pp | |
546 | Sometimes individual capabilities must be commented out. | |
547 | To do this, put a period before the capability name. | |
548 | For example, see the first | |
549 | .Sy \&cr | |
550 | and | |
551 | .Sy \&ta | |
552 | in the example above. | |
553 | .Ss Preparing Descriptions | |
554 | The most effective way to prepare a terminal description is by imitating | |
555 | the description of a similar terminal in | |
556 | .Nm termcap | |
557 | and to build up a description gradually, using partial descriptions | |
558 | with | |
559 | .Xr \&vi | |
560 | to check that they are correct. | |
561 | Be aware that a very unusual terminal may expose deficiencies in | |
562 | the ability of the | |
563 | .Nm termcap | |
564 | file to describe it | |
565 | or bugs in | |
566 | .Xr \&vi . | |
567 | To easily test a new terminal description you are working on | |
568 | you can put it in your home directory in a file called | |
569 | .Pa .termcap | |
570 | and programs will look there before looking in | |
571 | .Pa /usr/share/misc/termcap . | |
572 | You can also set the environment variable | |
573 | .Ev TERMPATH | |
574 | to a list of absolute file pathnames (separated by spaces or colons), | |
575 | one of which contains the description you are working on, | |
576 | and programs will search them in the order listed, and nowhere else. | |
577 | See | |
578 | .Xr termcap 3 . | |
579 | The | |
580 | .Ev TERMCAP | |
581 | environment variable is usually set to the | |
582 | .Nm termcap | |
583 | entry itself | |
584 | to avoid reading files when starting up a program. | |
585 | .Pp | |
586 | To get the padding for insert-line right | |
587 | (if the terminal manufacturer did not document it), | |
588 | a severe test is to use | |
589 | .Xr \&vi | |
590 | to edit | |
591 | .Pa /etc/passwd | |
592 | at 9600 baud, delete roughly 16 lines from the middle of the screen, | |
593 | then hit the `u' key several times quickly. | |
594 | If the display messes up, more padding is usually needed. | |
595 | A similar test can be used for insert-character. | |
596 | .Ss Basic Capabilities | |
597 | The number of columns on each line of the display is given by the | |
598 | .Sy \&co | |
599 | numeric capability. | |
600 | If the display is a | |
601 | .Tn CRT , | |
602 | then the | |
603 | number of lines on the screen is given by the | |
604 | .Sy \&li | |
605 | capability. | |
606 | If the display wraps around to the beginning of the next line when | |
607 | the cursor reaches the right margin, then it should have the | |
608 | .Sy \&am | |
609 | capability. | |
610 | If the terminal can clear its screen, | |
611 | the code to do this is given by the | |
612 | .Sy \&cl | |
613 | string capability. | |
614 | If the terminal overstrikes | |
615 | (rather than clearing the position when a character is overwritten), | |
616 | it should have the | |
617 | .Sy \&os | |
618 | capability. | |
619 | If the terminal is a printing terminal, | |
620 | with no soft copy unit, | |
621 | give it both | |
622 | .Sy \&hc | |
623 | and | |
624 | .Sy \&os . | |
625 | .Pf ( Sy \&os | |
626 | applies to storage scope terminals, | |
627 | such as the Tektronix 4010 series, | |
628 | as well as to hard copy and | |
629 | .Tn APL | |
630 | terminals.) | |
631 | If there is a code to move the cursor to the left edge of the current row, | |
632 | give this as | |
633 | .Sy \&cr . | |
634 | (Normally this will be carriage-return, | |
635 | .Sy \&^M . ) | |
636 | If there is a code to produce an audible signal (bell, beep, | |
637 | etc. ) , | |
638 | give this as | |
639 | .Sy \&bl . | |
640 | .Pp | |
641 | If there is a code (such as backspace) | |
642 | to move the cursor one position to the left, | |
643 | that capability should be given as | |
644 | .Sy \&le . | |
645 | Similarly, | |
646 | codes to move to the right, up, and down | |
647 | should be given as | |
648 | .Sy \&nd , | |
649 | .Sy \&up , | |
650 | and | |
651 | .Sy \&do , | |
652 | respectively. | |
653 | These | |
654 | .Em local cursor motions | |
655 | should not alter the text they pass over; | |
656 | for example, you would not normally use | |
657 | .Dq nd=\ \& | |
658 | unless the terminal has the | |
659 | .Sy \&os | |
660 | capability, | |
661 | because the space would erase the character moved over. | |
662 | .Pp | |
663 | A very important point here is that the local cursor motions encoded | |
664 | in | |
665 | .Nm termcap | |
666 | have undefined behavior at the left and top edges of a | |
667 | .Tn CRT | |
668 | display. | |
669 | Programs should never attempt to backspace around the left edge, | |
670 | unless | |
671 | .Sy \&bw | |
672 | is given, and never attempt to go up off the top | |
673 | using local cursor motions. | |
674 | .Pp | |
675 | In order to scroll text up, | |
676 | a program goes to the bottom left corner of the screen and sends the | |
677 | .Sy \&sf | |
678 | (index) string. | |
679 | To scroll text down, | |
680 | a program goes to the top left corner of the screen and sends the | |
681 | .Sy \&sr | |
682 | (reverse index) string. | |
683 | The strings | |
684 | .Sy \&sf | |
685 | and | |
686 | .Sy \&sr | |
687 | have undefined behavior | |
688 | when not on their respective corners of the screen. | |
689 | Parameterized versions of the scrolling sequences are | |
690 | .Sy \&SF | |
691 | and | |
692 | .Sy \&SR , | |
693 | which have the same semantics as | |
694 | .Sy \&sf | |
695 | and | |
696 | .Sy \&sr | |
697 | except that they take one parameter | |
698 | and scroll that many lines. | |
699 | They also have undefined behavior | |
700 | except at the appropriate corner of the screen. | |
701 | .Pp | |
702 | The | |
703 | .Sy \&am | |
704 | capability tells whether the cursor sticks at the right | |
705 | edge of the screen when text is output there, | |
706 | but this does not necessarily apply to | |
707 | .Sy \&nd | |
708 | from the last column. | |
709 | Leftward local motion is defined from the left edge only when | |
710 | .Sy \&bw | |
711 | is given; then an | |
712 | .Sy \&le | |
713 | from the left edge will move to the right edge of the previous row. | |
714 | This is useful for drawing a box around the edge of the screen, | |
715 | for example. | |
716 | If the terminal has switch-selectable automatic margins, | |
717 | the | |
718 | .Nm termcap | |
719 | description usually assumes that this feature is on, | |
720 | .Em i.e . , | |
721 | .Sy \&am . | |
722 | If the terminal has a command | |
723 | that moves to the first column of the next line, | |
724 | that command can be given as | |
725 | .Sy \&nw | |
726 | (newline). | |
727 | It is permissible for this to clear the remainder of the current line, | |
728 | so if the terminal has no correctly-working | |
729 | .Tn \&CR | |
730 | and | |
731 | .Tn \&LF | |
732 | it may still be possible to craft a working | |
733 | .Sy \&nw | |
734 | out of one or both of them. | |
735 | .Pp | |
736 | These capabilities suffice to describe hardcopy and | |
737 | .Dq glass-tty | |
738 | terminals. | |
739 | Thus the Teletype model 33 is described as | |
740 | .Bd -literal -offset indent | |
741 | T3\||\|tty33\||\|33\||\|tty\||\|Teletype model 33:\e | |
742 | :bl=^G:co#72:cr=^M:do=^J:hc:os: | |
743 | .Ed | |
744 | .Pp | |
745 | and the Lear Siegler | |
746 | .Tn ADM Ns \-3 | |
747 | is described as | |
748 | .Bd -literal -offset indent | |
749 | l3\||\|adm3\||\|3\||\|LSI \s-1ADM\s0-3:\e | |
750 | :am:bl=^G:cl=^Z:co#80:cr=^M:do=^J:le=^H:li#24:sf=^J: | |
751 | .Ed | |
752 | .Ss Parameterized Strings | |
753 | Cursor addressing and other strings requiring parameters | |
754 | are described by a | |
755 | parameterized string capability, with | |
756 | .Xr printf 3 Ns \-like | |
757 | escapes | |
758 | .Sy \&%x | |
759 | in it, | |
760 | while other characters are passed through unchanged. | |
761 | For example, to address the cursor the | |
762 | .Sy \&cm | |
763 | capability is given, using two parameters: the row and column to move to. | |
764 | (Rows and columns are numbered from zero and refer to the physical screen | |
765 | visible to the user, not to any unseen memory. | |
766 | If the terminal has memory-relative cursor addressing, | |
767 | that can be indicated by an analogous | |
768 | .Sy \&CM | |
769 | capability.) | |
770 | .Pp | |
771 | The | |
772 | .Sy \&% | |
773 | encodings have the following meanings: | |
774 | .Bl -column xxxxx | |
775 | .It "%% output `%'" | |
776 | .It "%d output value as in" | |
777 | .Xr printf | |
778 | %d | |
779 | .It "%2 output value as in" | |
780 | .Xr printf | |
781 | %2d | |
782 | .It "%3 output value as in" | |
783 | .Xr printf | |
784 | %3d | |
785 | .It "%. output value as in" | |
786 | .Xr printf | |
787 | %c | |
788 | .It "%+" Ns Em x Ta No add | |
789 | .Em x | |
790 | to value, then do %. | |
791 | .It "%>" Ns Em \&xy Ta No if | |
792 | value > | |
793 | .Em x | |
794 | then add | |
795 | .Em y , | |
796 | no output | |
797 | .It "%r reverse order of two parameters, no output" | |
798 | .It "%i increment by one, no output" | |
799 | .It "%n exclusive-or all parameters with 0140 (Datamedia 2500)" | |
800 | .It "%B" Ta Tn BCD No "(16*(value/10)) + (value%10), no output" | |
801 | .It "%D Reverse coding (value \- 2*(value%16)), no output (Delta Data)." | |
802 | .El | |
803 | .Pp | |
804 | Consider the Hewlett-Packard 2645, which, to get to row 3 and column 12, needs | |
805 | to be sent | |
806 | .Dq \eE&a12c03Y | |
807 | padded for 6 milliseconds. | |
808 | Note that the order | |
809 | of the row and column coordinates is reversed here | |
810 | and that the row and column | |
811 | are sent as two-digit integers. | |
812 | Thus its | |
813 | .Sy \&cm | |
814 | capability is | |
815 | .Dq Li cm=6\eE&%r%2c%2Y . | |
816 | .Pp | |
817 | The Datamedia 2500 needs the current row and column sent | |
818 | encoded in binary using | |
819 | .Dq \&%. . | |
820 | Terminals that use | |
821 | .Dq \&%. | |
822 | need to be able to | |
823 | backspace the cursor | |
824 | .Po Sy \&le Pc | |
825 | and to move the cursor up one line on the screen | |
826 | .Po Sy \&up Pc . | |
827 | This is necessary because it is not always safe to transmit | |
828 | .Sy \&\en , | |
829 | .Sy \&^D , | |
830 | and | |
831 | .Sy \&\er , | |
832 | as the system may change or discard them. | |
833 | (Programs using | |
834 | .Nm termcap | |
835 | must set terminal modes so that tabs are not expanded, so | |
836 | .Sy \&\et | |
837 | is safe to send. | |
838 | This turns out to be essential for the Ann Arbor 4080.) | |
839 | .Pp | |
840 | A final example is the Lear Siegler | |
841 | .Tn ADM Ns \-3a, | |
842 | which offsets row and column | |
843 | by a blank character, thus | |
844 | .Dq Li cm=\eE=%+ %+\ \& . | |
845 | .Pp | |
846 | Row or column absolute cursor addressing | |
847 | can be given as single parameter capabilities | |
848 | .Sy \&ch | |
849 | (horizontal position absolute) and | |
850 | .Sy \&cv | |
851 | (vertical position absolute). | |
852 | Sometimes these are shorter than the more general two-parameter sequence | |
853 | (as with the Hewlett-Packard 2645) and can be used in preference to | |
854 | .Sy \&cm . | |
855 | If there are parameterized local motions | |
856 | .Pf ( Em e.g . , | |
857 | move | |
858 | .Ar n | |
859 | positions to the right) | |
860 | these can be given as | |
861 | .Sy \&DO , | |
862 | .Sy \&LE , | |
863 | .Sy \&RI , | |
864 | and | |
865 | .Sy \&UP | |
866 | with a single parameter indicating how many positions to move. | |
867 | These are primarily useful if the terminal does not have | |
868 | .Sy \&cm , | |
869 | such as the Tektronix 4025. | |
870 | .Ss Cursor Motions | |
871 | .Pp | |
872 | If the terminal has a fast way to home the cursor | |
873 | (to the very upper left corner of the screen), this can be given as | |
874 | .Sy \&ho . | |
875 | Similarly, a fast way of getting to the lower left-hand corner | |
876 | can be given as | |
877 | .Sy \&ll ; | |
878 | this may involve going up with | |
879 | .Sy \&up | |
880 | from the home position, | |
881 | but a program should never do this itself (unless | |
882 | .Sy \&ll | |
883 | does), because it can | |
884 | make no assumption about the effect of moving up from the home position. | |
885 | Note that the home position is the same as | |
886 | cursor address (0,0): to the top left corner of the screen, not of memory. | |
887 | (Therefore, the | |
888 | .Dq \eEH | |
889 | sequence on Hewlett-Packard terminals | |
890 | cannot be used for | |
891 | .Sy \&ho . ) | |
892 | .Ss Area Clears | |
893 | If the terminal can clear from the current position to the end of the | |
894 | line, leaving the cursor where it is, this should be given as | |
895 | .Sy \&ce . | |
896 | If the terminal can clear from the current position to the end of the | |
897 | display, this should be given as | |
898 | .Sy \&cd . | |
899 | .Sy \&cd | |
900 | must only be invoked from the first column of a line. | |
901 | (Therefore, | |
902 | it can be simulated by a request to delete a large number of lines, | |
903 | if a true | |
904 | .Sy \&cd | |
905 | is not available.) | |
906 | .Ss Insert/Delete Line | |
907 | If the terminal can open a new blank line | |
908 | before the line containing the cursor, | |
909 | this should be given as | |
910 | .Sy \&al ; | |
911 | this must be invoked only from the first | |
912 | position of a line. | |
913 | The cursor must then appear at the left of the newly blank line. | |
914 | If the terminal can delete the line that the cursor is on, this | |
915 | should be given as | |
916 | .Sy \&dl ; | |
917 | this must only be used from the first position on | |
918 | the line to be deleted. | |
919 | Versions of | |
920 | .Sy \&al | |
921 | and | |
922 | .Sy \&dl | |
923 | which take a single parameter | |
924 | and insert or delete that many lines | |
925 | can be given as | |
926 | .Sy \&AL | |
927 | and | |
928 | .Sy \&DL . | |
929 | If the terminal has a settable scrolling region | |
930 | (like the VT100), | |
931 | the command to set this can be described with the | |
932 | .Sy \&cs | |
933 | capability, | |
934 | which takes two parameters: the top and bottom lines of the scrolling region. | |
935 | The cursor position is, alas, undefined after using this command. | |
936 | It is possible to get the effect of insert or delete line | |
937 | using this command \(em the | |
938 | .Sy \&sc | |
939 | and | |
940 | .Sy \&rc | |
941 | (save and restore cursor) commands are also useful. | |
942 | Inserting lines at the top or bottom of the screen can also be done using | |
943 | .Sy \&sr | |
944 | or | |
945 | .Sy \&sf | |
946 | on many terminals without a true insert/delete line, | |
947 | and is often faster even on terminals with those features. | |
948 | .Pp | |
949 | If the terminal has the ability to define a window as part of memory | |
950 | which all commands affect, it should be given as the parameterized string | |
951 | .Sy \&wi . | |
952 | The four parameters are the starting and ending lines in memory | |
953 | and the starting and ending columns in memory, in that order. | |
954 | (This | |
955 | .Xr terminfo | |
956 | capability is described for completeness. | |
957 | It is unlikely that any | |
958 | .Nm termcap Ns \- using | |
959 | program will support it.) | |
960 | .Pp | |
961 | If the terminal can retain display memory above the screen, then the | |
962 | .Sy \&da | |
963 | capability should be given; | |
964 | if display memory can be retained | |
965 | below, then | |
966 | .Sy \&db | |
967 | should be given. | |
968 | These indicate | |
969 | that deleting a line or scrolling may bring non-blank lines up from below | |
970 | or that scrolling back with | |
971 | .Sy \&sr | |
972 | may bring down non-blank lines. | |
973 | .Ss Insert/Delete Character | |
974 | There are two basic kinds of intelligent terminals with respect to | |
975 | insert/delete character that can be described using | |
976 | .Nm termcap . | |
977 | The most common insert/delete character operations affect only the characters | |
978 | on the current line and shift characters off the end of the line rigidly. | |
979 | Other terminals, such as the Concept\-100 and the Perkin Elmer Owl, make | |
980 | a distinction between typed and untyped blanks on the screen, shifting | |
981 | upon an insert or delete only to an untyped blank on the screen which is | |
982 | either eliminated or expanded to two untyped blanks. | |
983 | You can determine | |
984 | the kind of terminal you have by clearing the screen then typing | |
985 | text separated by cursor motions. | |
986 | Type | |
987 | .Dq Li abc\ \ \ \ def | |
988 | using local | |
989 | cursor motions (not spaces) between the | |
990 | .Dq abc | |
991 | and the | |
992 | .Dq def . | |
993 | Then position the cursor before the | |
994 | .Dq abc | |
995 | and put the terminal in insert | |
996 | mode. | |
997 | If typing characters causes the rest of the line to shift | |
998 | rigidly and characters to fall off the end, then your terminal does | |
999 | not distinguish between blanks and untyped positions. | |
1000 | If the | |
1001 | .Dq abc | |
1002 | shifts over to the | |
1003 | .Dq def | |
1004 | which then move together around the end of the | |
1005 | current line and onto the next as you insert, then you have the second type of | |
1006 | terminal and should give the capability | |
1007 | .Sy \&in , | |
1008 | which stands for | |
1009 | .Dq insert null . | |
1010 | While these are two logically separate attributes | |
1011 | (one line | |
1012 | .Em \&vs . | |
1013 | multi-line insert mode, | |
1014 | and special treatment of untyped spaces), | |
1015 | we have seen no terminals whose insert | |
1016 | mode cannot be described with the single attribute. | |
1017 | .Pp | |
1018 | .Nm Termcap | |
1019 | can describe both terminals that have an insert mode and terminals | |
1020 | that send a simple sequence to open a blank position on the current line. | |
1021 | Give as | |
1022 | .Sy \&im | |
1023 | the sequence to get into insert mode. | |
1024 | Give as | |
1025 | .Sy \&ei | |
1026 | the sequence to leave insert mode. | |
1027 | Now give as | |
1028 | .Sy \&ic | |
1029 | any sequence that needs to be sent just before | |
1030 | each character to be inserted. | |
1031 | Most terminals with a true insert mode | |
1032 | will not give | |
1033 | .Sy \&ic ; | |
1034 | terminals that use a sequence to open a screen | |
1035 | position should give it here. | |
1036 | (If your terminal has both, | |
1037 | insert mode is usually preferable to | |
1038 | .Sy \&ic . | |
1039 | Do not give both unless the terminal actually requires both to be used | |
1040 | in combination.) | |
1041 | If post-insert padding is needed, give this as a number of milliseconds | |
1042 | in | |
1043 | .Sy \&ip | |
1044 | (a string option). | |
1045 | Any other sequence that may need to be | |
1046 | sent after insertion of a single character can also be given in | |
1047 | .Sy \&ip . | |
1048 | If your terminal needs to be placed into an `insert mode' | |
1049 | and needs a special code preceding each inserted character, | |
1050 | then both | |
1051 | .Sy \&im Ns / Sy \&ei | |
1052 | and | |
1053 | .Sy \&ic | |
1054 | can be given, and both will be used. | |
1055 | The | |
1056 | .Sy \&IC | |
1057 | capability, with one parameter | |
1058 | .Em n , | |
1059 | will repeat the effects of | |
1060 | .Sy \&ic | |
1061 | .Em n | |
1062 | times. | |
1063 | .Pp | |
1064 | It is occasionally necessary to move around while in insert mode | |
1065 | to delete characters on the same line | |
1066 | .Pf ( Em e.g . , | |
1067 | if there is a tab after | |
1068 | the insertion position). | |
1069 | If your terminal allows motion while in | |
1070 | insert mode, you can give the capability | |
1071 | .Sy \&mi | |
1072 | to speed up inserting | |
1073 | in this case. | |
1074 | Omitting | |
1075 | .Sy \&mi | |
1076 | will affect only speed. | |
1077 | Some terminals | |
1078 | (notably Datamedia's) must not have | |
1079 | .Sy \&mi | |
1080 | because of the way their | |
1081 | insert mode works. | |
1082 | .Pp | |
1083 | Finally, you can specify | |
1084 | .Sy \&dc | |
1085 | to delete a single character, | |
1086 | .Sy \&DC | |
1087 | with one parameter | |
1088 | .Em n | |
1089 | to delete | |
1090 | .Em n | |
1091 | characters, | |
1092 | and delete mode by giving | |
1093 | .Sy \&dm | |
1094 | and | |
1095 | .Sy \&ed | |
1096 | to enter and exit delete mode | |
1097 | (which is any mode the terminal needs to be placed in for | |
1098 | .Sy \&dc | |
1099 | to work). | |
1100 | .Ss Highlighting, Underlining, and Visible Bells | |
1101 | If your terminal has one or more kinds of display attributes, | |
1102 | these can be represented in a number of different ways. | |
1103 | You should choose one display form as | |
1104 | .Em standout mode , | |
1105 | representing a good high-contrast, easy-on-the-eyes format | |
1106 | for highlighting error messages and other attention getters. | |
1107 | (If you have a choice, reverse video plus half-bright is good, | |
1108 | or reverse video alone.) | |
1109 | The sequences to enter and exit standout mode | |
1110 | are given as | |
1111 | .Sy \&so | |
1112 | and | |
1113 | .Sy \&se , | |
1114 | respectively. | |
1115 | If the code to change into or out of standout | |
1116 | mode leaves one or even two blank spaces or garbage characters on the screen, | |
1117 | as the | |
1118 | .Tn TVI | |
1119 | 912 and Teleray 1061 do, | |
1120 | then | |
1121 | .Sy \&sg | |
1122 | should be given to tell how many characters are left. | |
1123 | .Pp | |
1124 | Codes to begin underlining and end underlining can be given as | |
1125 | .Sy \&us | |
1126 | and | |
1127 | .Sy \&ue , | |
1128 | respectively. | |
1129 | Underline mode change garbage is specified by | |
1130 | .Sy \&ug , | |
1131 | similar to | |
1132 | .Sy \&sg . | |
1133 | If the terminal has a code to underline the current character and move | |
1134 | the cursor one position to the right, | |
1135 | such as the Microterm Mime, | |
1136 | this can be given as | |
1137 | .Sy \&uc . | |
1138 | .Pp | |
1139 | Other capabilities to enter various highlighting modes include | |
1140 | .Sy \&mb | |
1141 | (blinking), | |
1142 | .Sy \&md | |
1143 | (bold or extra bright), | |
1144 | .Sy \&mh | |
1145 | (dim or half-bright), | |
1146 | .Sy \&mk | |
1147 | (blanking or invisible text), | |
1148 | .Sy \&mp | |
1149 | (protected), | |
1150 | .Sy \&mr | |
1151 | (reverse video), | |
1152 | .Sy \&me | |
1153 | (turn off | |
1154 | .Em all | |
1155 | attribute modes), | |
1156 | .Sy \&as | |
1157 | (enter alternate character set mode), and | |
1158 | .Sy \&ae | |
1159 | (exit alternate character set mode). | |
1160 | Turning on any of these modes singly may or may not turn off other modes. | |
1161 | .Pp | |
1162 | If there is a sequence to set arbitrary combinations of mode, | |
1163 | this should be given as | |
1164 | .Sy \&sa | |
1165 | (set attributes), taking 9 parameters. | |
1166 | Each parameter is either 0 or 1, | |
1167 | as the corresponding attributes is on or off. | |
1168 | The 9 parameters are, in order: standout, underline, reverse, blink, | |
1169 | dim, bold, blank, protect, and alternate character set. | |
1170 | Not all modes need be supported by | |
1171 | .Sy \&sa , | |
1172 | only those for which corresponding attribute commands exist. | |
1173 | (It is unlikely that a | |
1174 | .Nm termcap Ns \-using | |
1175 | program will support this capability, which is defined for compatibility | |
1176 | with | |
1177 | .Xr terminfo . ) | |
1178 | .Pp | |
1179 | Terminals with the | |
1180 | .Dq magic cookie | |
1181 | glitches | |
1182 | .Pf ( Sy \&sg | |
1183 | and | |
1184 | .Sy \&ug ) , | |
1185 | rather than maintaining extra attribute bits for each character cell, | |
1186 | instead deposit special | |
1187 | .Dq cookies , | |
1188 | or | |
1189 | .Dq garbage characters ,, | |
1190 | when they receive mode-setting sequences, | |
1191 | which affect the display algorithm. | |
1192 | .Pp | |
1193 | Some terminals, | |
1194 | such as the Hewlett-Packard 2621, | |
1195 | automatically leave standout | |
1196 | mode when they move to a new line or when the cursor is addressed. | |
1197 | Programs using standout mode | |
1198 | should exit standout mode on such terminals | |
1199 | before moving the cursor or sending a newline. | |
1200 | On terminals where this is not a problem, | |
1201 | the | |
1202 | .Sy \&ms | |
1203 | capability should be present | |
1204 | to say that this overhead is unnecessary. | |
1205 | .Pp | |
1206 | If the terminal has | |
1207 | a way of flashing the screen to indicate an error quietly | |
1208 | (a bell replacement), | |
1209 | this can be given as | |
1210 | .Sy \&vb ; | |
1211 | it must not move the cursor. | |
1212 | .Pp | |
1213 | If the cursor needs to be made more visible than normal | |
1214 | when it is not on the bottom line | |
1215 | (to change, for example, a non-blinking underline into an easier-to-find | |
1216 | block or blinking underline), | |
1217 | give this sequence as | |
1218 | .Sy \&vs . | |
1219 | If there is a way to make the cursor completely invisible, give that as | |
1220 | .Sy \&vi . | |
1221 | The capability | |
1222 | .Sy \&ve , | |
1223 | which undoes the effects of both of these modes, | |
1224 | should also be given. | |
1225 | .Pp | |
1226 | If your terminal correctly displays underlined characters | |
1227 | (with no special codes needed) | |
1228 | even though it does not overstrike, | |
1229 | then you should give the capability | |
1230 | .Sy \&ul . | |
1231 | If overstrikes are erasable with a blank, | |
1232 | this should be indicated by giving | |
1233 | .Sy \&eo . | |
1234 | .Ss Keypad | |
1235 | If the terminal has a keypad that transmits codes when the keys are pressed, | |
1236 | this information can be given. | |
1237 | Note that it is not possible to handle | |
1238 | terminals where the keypad only works in local mode | |
1239 | (this applies, for example, to the unshifted Hewlett-Packard 2621 keys). | |
1240 | If the keypad can be set to transmit or not transmit, | |
1241 | give these codes as | |
1242 | .Sy \&ks | |
1243 | and | |
1244 | .Sy \&ke . | |
1245 | Otherwise the keypad is assumed to always transmit. | |
1246 | The codes sent by the left-arrow, right-arrow, up-arrow, down-arrow, | |
1247 | and home keys can be given as | |
1248 | .Sy \&kl , | |
1249 | .Sy \&kr , | |
1250 | .Sy \&ku , | |
1251 | .Sy \&kd , | |
1252 | and | |
1253 | .Sy \&kh , | |
1254 | respectively. | |
1255 | If there are function keys such as f0, f1, ..., f9, the codes they send | |
1256 | can be given as | |
1257 | .Sy \&k0 , | |
1258 | .Sy \&k1 , | |
1259 | ..., | |
1260 | .Sy \&k9 . | |
1261 | If these keys have labels other than the default f0 through f9, the labels | |
1262 | can be given as | |
1263 | .Sy \&l0 , | |
1264 | .Sy \&l1 , | |
1265 | ..., | |
1266 | .Sy \&l9 . | |
1267 | The codes transmitted by certain other special keys can be given: | |
1268 | .Sy \&kH | |
1269 | (home down), | |
1270 | .Sy \&kb | |
1271 | (backspace), | |
1272 | .Sy \&ka | |
1273 | (clear all tabs), | |
1274 | .Sy \&kt | |
1275 | (clear the tab stop in this column), | |
1276 | .Sy \&kC | |
1277 | (clear screen or erase), | |
1278 | .Sy \&kD | |
1279 | (delete character), | |
1280 | .Sy \&kL | |
1281 | (delete line), | |
1282 | .Sy \&kM | |
1283 | (exit insert mode), | |
1284 | .Sy \&kE | |
1285 | (clear to end of line), | |
1286 | .Sy \&kS | |
1287 | (clear to end of screen), | |
1288 | .Sy \&kI | |
1289 | (insert character or enter insert mode), | |
1290 | .Sy \&kA | |
1291 | (insert line), | |
1292 | .Sy \&kN | |
1293 | (next page), | |
1294 | .Sy \&kP | |
1295 | (previous page), | |
1296 | .Sy \&kF | |
1297 | (scroll forward/down), | |
1298 | .Sy \&kR | |
1299 | (scroll backward/up), and | |
1300 | .Sy \&kT | |
1301 | (set a tab stop in this column). | |
1302 | In addition, if the keypad has a 3 by 3 array of keys | |
1303 | including the four arrow keys, then the other five keys can be given as | |
1304 | .Sy \&K1 , | |
1305 | .Sy \&K2 , | |
1306 | .Sy \&K3 , | |
1307 | .Sy \&K4 , | |
1308 | and | |
1309 | .Sy \&K5 . | |
1310 | These keys are useful when the effects of a 3 by 3 directional pad are needed. | |
1311 | The obsolete | |
1312 | .Sy \&ko | |
1313 | capability formerly used to describe | |
1314 | .Dq other | |
1315 | function keys has been | |
1316 | completely supplanted by the above capabilities. | |
1317 | .Pp | |
1318 | The | |
1319 | .Sy \&ma | |
1320 | entry is also used to indicate arrow keys on terminals that have | |
1321 | single-character arrow keys. | |
1322 | It is obsolete but still in use in | |
1323 | version 2 of | |
1324 | .Sy \&vi | |
1325 | which must be run on some minicomputers due to | |
1326 | memory limitations. | |
1327 | This field is redundant with | |
1328 | .Sy \&kl , | |
1329 | .Sy \&kr , | |
1330 | .Sy \&ku , | |
1331 | .Sy \&kd , | |
1332 | and | |
1333 | .Sy \&kh . | |
1334 | It consists of groups of two characters. | |
1335 | In each group, the first character is what an arrow key sends, and the | |
1336 | second character is the corresponding | |
1337 | .Sy \&vi | |
1338 | command. | |
1339 | These commands are | |
1340 | .Ar h | |
1341 | for | |
1342 | .Sy \&kl , | |
1343 | .Ar j | |
1344 | for | |
1345 | .Sy \&kd , | |
1346 | .Ar k | |
1347 | for | |
1348 | .Sy \&ku , | |
1349 | .Ar l | |
1350 | for | |
1351 | .Sy \&kr , | |
1352 | and | |
1353 | .Ar H | |
1354 | for | |
1355 | .Sy \&kh . | |
1356 | For example, the Mime would have | |
1357 | .Dq Li ma=^Hh^Kj^Zk^Xl | |
1358 | indicating arrow keys left (^H), down (^K), up (^Z), and right (^X). | |
1359 | (There is no home key on the Mime.) | |
1360 | .Ss Tabs and Initialization | |
1361 | If the terminal needs to be in a special mode when running | |
1362 | a program that uses these capabilities, | |
1363 | the codes to enter and exit this mode can be given as | |
1364 | .Sy \&ti | |
1365 | and | |
1366 | .Sy \&te . | |
1367 | This arises, for example, from terminals like the Concept with more than | |
1368 | one page of memory. | |
1369 | If the terminal has only memory-relative cursor addressing and not | |
1370 | screen-relative cursor addressing, | |
1371 | a screen-sized window must be fixed into | |
1372 | the display for cursor addressing to work properly. | |
1373 | This is also used for the Tektronix 4025, where | |
1374 | .Sy \&ti | |
1375 | sets the command character to be the one used by | |
1376 | .Nm termcap . | |
1377 | .Pp | |
1378 | Other capabilities | |
1379 | include | |
1380 | .Sy \&is , | |
1381 | an initialization string for the terminal, | |
1382 | and | |
1383 | .Sy \&if , | |
1384 | the name of a file containing long initialization strings. | |
1385 | These strings are expected to set the terminal into modes | |
1386 | consistent with the rest of the | |
1387 | .Nm termcap | |
1388 | description. | |
1389 | They are normally sent to the terminal by the | |
1390 | .Xr tset | |
1391 | program each time the user logs in. | |
1392 | They will be printed in the following order: | |
1393 | .Sy \&is ; | |
1394 | setting tabs using | |
1395 | .Sy \&ct | |
1396 | and | |
1397 | .Sy \&st ; | |
1398 | and finally | |
1399 | .Sy \&if . | |
1400 | .Pf ( Xr Terminfo | |
1401 | uses | |
1402 | .Sy \&i\&1-i2 | |
1403 | instead of | |
1404 | .Sy \&is | |
1405 | and runs the program | |
1406 | .Sy \&iP | |
1407 | and prints | |
1408 | .Sy "\&i\&3" | |
1409 | after the other initializations.) | |
1410 | A pair of sequences that does a harder reset from a totally unknown state | |
1411 | can be analogously given as | |
1412 | .Sy \&rs | |
1413 | and | |
1414 | .Sy \&if . | |
1415 | These strings are output by the | |
1416 | .Xr reset | |
1417 | program, which is used when the terminal gets into a wedged state. | |
1418 | .Pf ( Xr Terminfo | |
1419 | uses | |
1420 | .Sy "\&r1-r3" | |
1421 | instead of | |
1422 | .Sy \&rs . ) | |
1423 | Commands are normally placed in | |
1424 | .Sy \&rs | |
1425 | and | |
1426 | .Sy \&rf | |
1427 | only if they produce annoying effects on the screen and are not necessary | |
1428 | when logging in. | |
1429 | For example, the command to set the VT100 into 80-column mode | |
1430 | would normally be part of | |
1431 | .Sy \&is , | |
1432 | but it causes an annoying glitch of the screen and is not normally needed | |
1433 | since the terminal is usually already in 80-column mode. | |
1434 | .Pp | |
1435 | If the terminal has hardware tabs, | |
1436 | the command to advance to the next tab stop can be given as | |
1437 | .Sy \&ta | |
1438 | (usually | |
1439 | .Sy \&^I ) . | |
1440 | A | |
1441 | .Dq backtab | |
1442 | command which moves leftward to the previous tab stop | |
1443 | can be given as | |
1444 | .Sy \&bt . | |
1445 | By convention, | |
1446 | if the terminal driver modes indicate that tab stops are being expanded | |
1447 | by the computer rather than being sent to the terminal, | |
1448 | programs should not use | |
1449 | .Sy \&ta | |
1450 | or | |
1451 | .Sy \&bt | |
1452 | even if they are present, | |
1453 | since the user may not have the tab stops properly set. | |
1454 | If the terminal has hardware tabs that are initially set every | |
1455 | .Ar n | |
1456 | positions when the terminal is powered up, then the numeric parameter | |
1457 | .Sy \&it | |
1458 | is given, showing the number of positions between tab stops. | |
1459 | This is normally used by the | |
1460 | .Xr tset | |
1461 | command to determine whether to set the driver mode for hardware tab | |
1462 | expansion, and whether to set the tab stops. | |
1463 | If the terminal has tab stops that can be saved in nonvolatile memory, the | |
1464 | .Nm termcap | |
1465 | description can assume that they are properly set. | |
1466 | .Pp | |
1467 | If there are commands to set and clear tab stops, they can be given as | |
1468 | .Sy \&ct | |
1469 | (clear all tab stops) and | |
1470 | .Sy \&st | |
1471 | (set a tab stop in the current column of every row). | |
1472 | If a more complex sequence is needed to set the tabs than can be | |
1473 | described by this, the sequence can be placed in | |
1474 | .Sy \&is | |
1475 | or | |
1476 | .Sy \&if . | |
1477 | .Ss Delays | |
1478 | Certain capabilities control padding in the terminal driver. | |
1479 | These are primarily needed by hardcopy terminals and are used by the | |
1480 | .Xr tset | |
1481 | program to set terminal driver modes appropriately. | |
1482 | Delays embedded in the capabilities | |
1483 | .Sy \&cr , | |
1484 | .Sy \&sf , | |
1485 | .Sy \&le , | |
1486 | .Sy \&ff , | |
1487 | and | |
1488 | .Sy \&ta | |
1489 | will cause the appropriate delay bits to be set in the terminal driver. | |
1490 | If | |
1491 | .Sy \&pb | |
1492 | (padding baud rate) is given, these values can be ignored at baud rates | |
1493 | below the value of | |
1494 | .Sy \&pb . | |
1495 | For | |
1496 | .Bx 4.2 | |
1497 | .Xr tset , | |
1498 | the delays are given as numeric capabilities | |
1499 | .Sy \&dC , | |
1500 | .Sy \&dN , | |
1501 | .Sy \&dB , | |
1502 | .Sy \&dF , | |
1503 | and | |
1504 | .Sy \&dT | |
1505 | instead. | |
1506 | .Ss Miscellaneous | |
1507 | If the terminal requires other than a | |
1508 | .Dv NUL | |
1509 | (zero) character as a pad, | |
1510 | this can be given as | |
1511 | .Sy \&pc . | |
1512 | Only the first character of the | |
1513 | .Sy \&pc | |
1514 | string is used. | |
1515 | .Pp | |
1516 | If the terminal has commands to save and restore the position of the | |
1517 | cursor, give them as | |
1518 | .Sy \&sc | |
1519 | and | |
1520 | .Sy \&rc . | |
1521 | .Pp | |
1522 | If the terminal has an extra | |
1523 | .Dq status line | |
1524 | that is not normally used by | |
1525 | software, this fact can be indicated. | |
1526 | If the status line is viewed as an extra line below the bottom line, | |
1527 | then the capability | |
1528 | .Sy \&hs | |
1529 | should be given. | |
1530 | Special strings to go to a position in the status line and to return | |
1531 | from the status line can be given as | |
1532 | .Sy \&ts | |
1533 | and | |
1534 | .Sy \&fs . | |
1535 | .Pf ( Xr \&fs | |
1536 | must leave the cursor position in the same place that it was before | |
1537 | .Sy \&ts . | |
1538 | If necessary, the | |
1539 | .Sy \&sc | |
1540 | and | |
1541 | .Sy \&rc | |
1542 | strings can be included in | |
1543 | .Sy \&ts | |
1544 | and | |
1545 | .Sy \&fs | |
1546 | to get this effect.) | |
1547 | The capability | |
1548 | .Sy \&ts | |
1549 | takes one parameter, which is the column number of the status line | |
1550 | to which the cursor is to be moved. | |
1551 | If escape sequences and other special commands such as tab work while in | |
1552 | the status line, the flag | |
1553 | .Sy \&es | |
1554 | can be given. | |
1555 | A string that turns off the status line (or otherwise erases its contents) | |
1556 | should be given as | |
1557 | .Sy \&ds . | |
1558 | The status line is normally assumed to be the same width as the | |
1559 | rest of the screen, | |
1560 | .Em i.e . , | |
1561 | .Sy \&co . | |
1562 | If the status line is a different width (possibly because the terminal | |
1563 | does not allow an entire line to be loaded), then its width in columns | |
1564 | can be indicated with the numeric parameter | |
1565 | .Sy \&ws . | |
1566 | .Pp | |
1567 | If the terminal can move up or down half a line, this can be | |
1568 | indicated with | |
1569 | .Sy \&hu | |
1570 | (half-line up) and | |
1571 | .Sy \&hd | |
1572 | (half-line down). | |
1573 | This is primarily useful for superscripts and subscripts on hardcopy | |
1574 | terminals. | |
1575 | If a hardcopy terminal can eject to the next page (form feed), | |
1576 | give this as | |
1577 | .Sy \&ff | |
1578 | (usually | |
1579 | .Sy \&^L ) . | |
1580 | .Pp | |
1581 | If there is a command to repeat a given character a given number of times | |
1582 | (to save time transmitting a large number of identical characters), | |
1583 | this can be indicated with the parameterized string | |
1584 | .Sy \&rp . | |
1585 | The first parameter is the character to be repeated and the second is | |
1586 | the number of times to repeat it. | |
1587 | (This is a | |
1588 | .Xr terminfo | |
1589 | feature that is unlikely to be supported by a program that uses | |
1590 | .Nm termcap . ) | |
1591 | .Pp | |
1592 | If the terminal has a settable command character, such as the | |
1593 | Tektronix 4025, this can be indicated with | |
1594 | .Sy \&CC . | |
1595 | A prototype command character is chosen which is used in all capabilities. | |
1596 | This character is given in the | |
1597 | .Sy \&CC | |
1598 | capability to identify it. | |
1599 | The following convention is supported on some | |
1600 | .Ux | |
1601 | systems: | |
1602 | The environment is to be searched for a | |
1603 | .Ev \&CC | |
1604 | variable, | |
1605 | and if found, | |
1606 | all occurrences of the prototype character are replaced by the character | |
1607 | in the environment variable. | |
1608 | This use of the | |
1609 | .Ev \&CC | |
1610 | environment variable | |
1611 | is a very bad idea, as it conflicts with | |
1612 | .Xr make 1 . | |
1613 | .Pp | |
1614 | Terminal descriptions that do not represent a specific kind of known | |
1615 | terminal, such as | |
1616 | .Em switch , | |
1617 | .Em dialup , | |
1618 | .Em patch , | |
1619 | and | |
1620 | .Xr network , | |
1621 | should include the | |
1622 | .Sy \&gn | |
1623 | (generic) capability so that programs can complain that they do not know | |
1624 | how to talk to the terminal. | |
1625 | (This capability does not apply to | |
1626 | .Em virtual | |
1627 | terminal descriptions for which the escape sequences are known.) | |
1628 | .Pp | |
1629 | If the terminal uses xoff/xon | |
1630 | .Pq Tn DC3 Ns / Ns Tn DC1 | |
1631 | handshaking for flow control, give | |
1632 | .Sy \&xo . | |
1633 | Padding information should still be included so that routines can make | |
1634 | better decisions about costs, but actual pad characters will not be | |
1635 | transmitted. | |
1636 | .Pp | |
1637 | If the terminal has a | |
1638 | .Dq meta key | |
1639 | which acts as a shift key, setting the | |
1640 | 8th bit of any character transmitted, then this fact can be indicated with | |
1641 | .Sy \&km . | |
1642 | Otherwise, software will assume that the 8th bit is parity and it will | |
1643 | usually be cleared. | |
1644 | If strings exist to turn this | |
1645 | .Dq meta mode | |
1646 | on and off, they can be given as | |
1647 | .Sy \&mm | |
1648 | and | |
1649 | .Sy \&mo . | |
1650 | .Pp | |
1651 | If the terminal has more lines of memory than will fit on the screen at once, | |
1652 | the number of lines of memory can be indicated with | |
1653 | .Sy \&lm . | |
1654 | An explicit value of 0 indicates that the number of lines is not fixed, | |
1655 | but that there is still more memory than fits on the screen. | |
1656 | .Pp | |
1657 | If the terminal is one of those supported by the | |
1658 | .Ux | |
1659 | system virtual | |
1660 | terminal protocol, the terminal number can be given as | |
1661 | .Sy \&vt . | |
1662 | .Pp | |
1663 | Media copy strings which control an auxiliary printer | |
1664 | connected to the terminal can be given as | |
1665 | .Sy \&ps : | |
1666 | print the contents of the screen; | |
1667 | .Sy \&pf : | |
1668 | turn off the printer; and | |
1669 | .Sy \&po : | |
1670 | turn on the printer. | |
1671 | When the printer is on, all text sent to the terminal will be sent to the | |
1672 | printer. | |
1673 | It is undefined whether the text is also displayed on the terminal screen | |
1674 | when the printer is on. | |
1675 | A variation | |
1676 | .Sy \&pO | |
1677 | takes one parameter and leaves the printer on for as many characters as the | |
1678 | value of the parameter, then turns the printer off. | |
1679 | The parameter should not exceed 255. | |
1680 | All text, including | |
1681 | .Sy \&pf , | |
1682 | is transparently passed to the printer while | |
1683 | .Sy \&pO | |
1684 | is in effect. | |
1685 | .Pp | |
1686 | Strings to program function keys can be given as | |
1687 | .Sy \&pk , | |
1688 | .Sy \&pl , | |
1689 | and | |
1690 | .Sy \&px . | |
1691 | Each of these strings takes two parameters: the function key number | |
1692 | to program (from 0 to 9) and the string to program it with. | |
1693 | Function key numbers out of this range may program undefined keys | |
1694 | in a terminal-dependent manner. | |
1695 | The differences among the capabilities are that | |
1696 | .Sy \&pk | |
1697 | causes pressing the given key to be the same as the user typing the given | |
1698 | string; | |
1699 | .Sy \&pl | |
1700 | causes the string to be executed by the terminal in local mode; | |
1701 | and | |
1702 | .Sy \&px | |
1703 | causes the string to be transmitted to the computer. | |
1704 | Unfortunately, due to lack of a definition for string parameters in | |
1705 | .Nm termcap , | |
1706 | only | |
1707 | .Xr terminfo | |
1708 | supports these capabilities. | |
1709 | .Ss Glitches and Braindamage | |
1710 | Hazeltine terminals, which do not allow `~' characters to be displayed, | |
1711 | should indicate | |
1712 | .Sy \&hz . | |
1713 | .Pp | |
1714 | The | |
1715 | .Sy \&nc | |
1716 | capability, now obsolete, formerly indicated Datamedia terminals, | |
1717 | which echo | |
1718 | .Sy \&\er \en | |
1719 | for | |
1720 | carriage return then ignore a following linefeed. | |
1721 | .Pp | |
1722 | Terminals that ignore a linefeed immediately after an | |
1723 | .Sy \&am | |
1724 | wrap, such as the Concept, should indicate | |
1725 | .Sy \&xn . | |
1726 | .Pp | |
1727 | If | |
1728 | .Sy \&ce | |
1729 | is required to get rid of standout | |
1730 | (instead of merely writing normal text on top of it), | |
1731 | .Sy \&xs | |
1732 | should be given. | |
1733 | .Pp | |
1734 | Teleray terminals, where tabs turn all characters moved over to blanks, | |
1735 | should indicate | |
1736 | .Sy \&xt | |
1737 | (destructive tabs). | |
1738 | This glitch is also taken to mean that it is not possible | |
1739 | to position the cursor on top of a \*(lqmagic cookie\*(rq, and that | |
1740 | to erase standout mode it is necessary to use delete and insert line. | |
1741 | .Pp | |
1742 | The Beehive Superbee, which is unable to correctly transmit the | |
1743 | .Dv ESC | |
1744 | or | |
1745 | .Sy \&^C | |
1746 | characters, has | |
1747 | .Sy \&xb , | |
1748 | indicating that the | |
1749 | .Dq \&f\&1 | |
1750 | key is used for | |
1751 | .Dv ESC | |
1752 | and | |
1753 | .Dq \&f\&2 | |
1754 | for ^C. | |
1755 | (Only certain Superbees have this problem, depending on the | |
1756 | .Tn ROM . ) | |
1757 | .Pp | |
1758 | Other specific terminal problems may be corrected by adding more | |
1759 | capabilities of the form | |
1760 | .Sy x Em x . | |
1761 | .Ss Similar Terminals | |
1762 | If there are two very similar terminals, | |
1763 | one can be defined as being just like the other with certain exceptions. | |
1764 | The string capability | |
1765 | .Sy \&tc | |
1766 | can be given | |
1767 | with the name of the similar terminal. | |
1768 | This capability must be | |
1769 | .Em last , | |
1770 | and the combined length of the entries | |
1771 | must not exceed 1024. | |
1772 | The capabilities given before | |
1773 | .Sy \&tc | |
1774 | override those in the terminal type invoked by | |
1775 | .Sy \&tc . | |
1776 | A capability can be canceled by placing | |
1777 | .Sy \&xx@ | |
1778 | to the left of the | |
1779 | .Sy \&tc | |
1780 | invocation, where | |
1781 | .Sy \&xx | |
1782 | is the capability. | |
1783 | For example, the entry | |
1784 | .Bd -literal -offset indent | |
1785 | hn\||\|2621\-nl:ks@:ke@:tc=2621: | |
1786 | .Ed | |
1787 | .Pp | |
1788 | defines a | |
1789 | .Dq 2621\-nl | |
1790 | that does not have the | |
1791 | .Sy \&ks | |
1792 | or | |
1793 | .Sy \&ke | |
1794 | capabilities, | |
1795 | hence does not turn on the function key labels when in visual mode. | |
1796 | This is useful for different modes for a terminal, or for different | |
1797 | user preferences. | |
1798 | .Sh FILES | |
1799 | .Bl -tag -width /usr/share/misc/termcap -compact | |
1800 | .It Pa /usr/share/misc/termcap | |
1801 | File containing terminal descriptions. | |
1802 | .El | |
1803 | .Sh SEE ALSO | |
1804 | .Xr \&ex 1 , | |
1805 | .Xr more 1 , | |
1806 | .Xr tset 1 , | |
1807 | .Xr \&ul 1 , | |
1808 | .Xr vi 1 , | |
1809 | .Xr curses 3 , | |
1810 | .Xr printf 3 , | |
1811 | .Xr termcap 3 , | |
1812 | .Xr term 7 | |
1813 | .Sh CAVEATS AND BUGS | |
1814 | The | |
1815 | .Em Note : | |
1816 | .Nm termcap | |
1817 | functions | |
1818 | were replaced by | |
1819 | .Xr terminfo | |
1820 | in | |
1821 | .At V | |
1822 | Release 2.0. | |
1823 | The transition will be relatively painless if capabilities flagged as | |
1824 | .Dq obsolete | |
1825 | are avoided. | |
1826 | .Pp | |
1827 | Lines and columns are now stored by the kernel as well as in the termcap | |
1828 | entry. | |
1829 | Most programs now use the kernel information primarily; the information | |
1830 | in this file is used only if the kernel does not have any information. | |
1831 | .Pp | |
1832 | .Xr \&Vi | |
1833 | allows only 256 characters for string capabilities, and the routines | |
1834 | in | |
1835 | .Xr termlib 3 | |
1836 | do not check for overflow of this buffer. | |
1837 | The total length of a single entry (excluding only escaped newlines) | |
1838 | may not exceed 1024. | |
1839 | .Pp | |
1840 | Not all programs support all entries. | |
1841 | .Sh HISTORY | |
1842 | The | |
1843 | .Nm | |
1844 | file format appeared in | |
1845 | .Bx 3 . |