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