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