Commit | Line | Data |
---|---|---|
c4737001 KM |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
c007a4d8 | 5 | .\" @(#)termcap.5 6.2 (Berkeley) %G% |
c4737001 KM |
6 | .\" |
7 | .tr || | |
21a6ebf7 | 8 | .TH TERMCAP 5 "" |
c4737001 KM |
9 | .UC 3 |
10 | .SH NAME | |
11 | termcap \- terminal capability data base | |
12 | .SH SYNOPSIS | |
13 | /etc/termcap | |
14 | .SH DESCRIPTION | |
15 | .I Termcap | |
16 | is a data base describing terminals, | |
17 | used, | |
18 | .IR e.g. , | |
19 | by | |
20 | .IR vi (1) | |
21 | and | |
773db9bd | 22 | .IR curses (3X). |
c4737001 KM |
23 | Terminals are described in |
24 | .I termcap | |
25 | by giving a set of capabilities which they have, and by describing | |
26 | how operations are performed. | |
27 | Padding requirements and initialization sequences | |
28 | are included in | |
29 | .I termcap. | |
30 | .PP | |
31 | Entries in | |
32 | .I termcap | |
33 | consist of a number of `:' separated fields. | |
34 | The first entry for each terminal gives the names which are known for the | |
35 | terminal, separated by `|' characters. The first name is always 2 characters | |
36 | long and is used by older version 6 systems which store the terminal type | |
37 | in a 16 bit word in a systemwide data base. | |
38 | The second name given is the most common abbreviation for the terminal, and the | |
39 | last name given should be a long name fully identifying the terminal. | |
40 | The second name should contain no blanks; the last name may well contain | |
41 | blanks for readability. | |
42 | .SH CAPABILITIES | |
43 | .nf | |
44 | (P) indicates padding may be specified | |
45 | (P*) indicates that padding may be based on no. lines affected | |
46 | ||
47 | .ta \w'k0-k9 'u +\w'Type 'u +\w'Pad? 'u | |
48 | \fBName Type Pad? Description\fR | |
49 | ae str (P) End alternate character set | |
50 | al str (P*) Add new blank line | |
51 | am bool Terminal has automatic margins | |
52 | as str (P) Start alternate character set | |
53 | bc str Backspace if not \fB^H\fR | |
21a6ebf7 | 54 | bl str Bell if not \fB^G\fR |
c4737001 KM |
55 | bs bool Terminal can backspace with \fB^H\fR |
56 | bt str (P) Back tab | |
57 | bw bool Backspace wraps from column 0 to last column | |
58 | CC str Command character in prototype if terminal settable | |
59 | cd str (P*) Clear to end of display | |
60 | ce str (P) Clear to end of line | |
61 | ch str (P) Like cm but horizontal motion only, line stays same | |
62 | cl str (P*) Clear screen | |
63 | cm str (P) Cursor motion | |
64 | co num Number of columns in a line | |
65 | cr str (P*) Carriage return, (default \fB^M\fR) | |
66 | cs str (P) Change scrolling region (vt100), like cm | |
67 | cv str (P) Like ch but vertical only. | |
68 | da bool Display may be retained above | |
69 | dB num Number of millisec of bs delay needed | |
70 | db bool Display may be retained below | |
71 | dC num Number of millisec of cr delay needed | |
72 | dc str (P*) Delete character | |
73 | dF num Number of millisec of ff delay needed | |
74 | dl str (P*) Delete line | |
75 | dm str Delete mode (enter) | |
76 | dN num Number of millisec of nl delay needed | |
77 | do str Down one line | |
78 | dT num Number of millisec of tab delay needed | |
79 | ed str End delete mode | |
80 | ei str End insert mode; give \*(lq:ei=:\*(rq if \fBic\fR | |
81 | eo str Can erase overstrikes with a blank | |
82 | ff str (P*) Hardcopy terminal page eject (default \fB^L\fR) | |
83 | hc bool Hardcopy terminal | |
84 | hd str Half-line down (forward 1/2 linefeed) | |
c007a4d8 | 85 | ho str Home cursor |
c4737001 KM |
86 | hu str Half-line up (reverse 1/2 linefeed) |
87 | hz str Hazeltine; can't print ~'s | |
88 | ic str (P) Insert character | |
89 | if str Name of file containing \fBis\fR | |
90 | im bool Insert mode (enter); give \*(lq:im=:\*(rq if \fBic\fR | |
91 | in bool Insert mode distinguishes nulls on display | |
92 | ip str (P*) Insert pad after character inserted | |
93 | is str Terminal initialization string | |
94 | k0-k9 str Sent by \*(lqother\*(rq function keys 0-9 | |
95 | kb str Sent by backspace key | |
96 | kd str Sent by terminal down arrow key | |
97 | ke str Out of \*(lqkeypad transmit\*(rq mode | |
98 | kh str Sent by home key | |
99 | kl str Sent by terminal left arrow key | |
100 | kn num Number of \*(lqother\*(rq keys | |
101 | ko str Termcap entries for other non-function keys | |
102 | kr str Sent by terminal right arrow key | |
103 | ks str Put terminal in \*(lqkeypad transmit\*(rq mode | |
104 | ku str Sent by terminal up arrow key | |
105 | l0-l9 str Labels on \*(lqother\*(rq function keys | |
106 | li num Number of lines on screen or page | |
c007a4d8 | 107 | ll str Last line, first column |
c4737001 KM |
108 | ma str Arrow key map, used by vi version 2 only |
109 | mi bool Safe to move while in insert mode | |
110 | ml str Memory lock on above cursor. | |
111 | ms bool Safe to move while in standout and underline mode | |
112 | mu str Memory unlock (turn off memory lock). | |
113 | nc bool No correctly working carriage return (DM2500,H2000) | |
114 | nd str Non-destructive space (cursor right) | |
115 | nl str (P*) Newline character (default \fB\en\fR) | |
116 | ns bool Terminal is a \s-2CRT\s+2 but doesn't scroll. | |
117 | os bool Terminal overstrikes | |
118 | pc str Pad character (rather than null) | |
119 | pt bool Has hardware tabs (may need to be set with \fBis\fR) | |
120 | se str End stand out mode | |
121 | sf str (P) Scroll forwards | |
122 | sg num Number of blank chars left by so or se | |
123 | so str Begin stand out mode | |
124 | sr str (P) Scroll reverse (backwards) | |
125 | ta str (P) Tab (other than \fB^I\fR or with padding) | |
126 | tc str Entry of similar terminal - must be last | |
127 | te str String to end programs that use \fBcm\fP | |
128 | ti str String to begin programs that use \fBcm\fR | |
129 | uc str Underscore one char and move past it | |
130 | ue str End underscore mode | |
131 | ug num Number of blank chars left by us or ue | |
132 | ul bool Terminal underlines even though it doesn't overstrike | |
133 | up str Upline (cursor up) | |
134 | us str Start underscore mode | |
135 | vb str Visible bell (may not move cursor) | |
136 | ve str Sequence to end open/visual mode | |
137 | vs str Sequence to start open/visual mode | |
138 | xb bool Beehive (f1=escape, f2=ctrl C) | |
139 | xn bool A newline is ignored after a wrap (Concept) | |
140 | xr bool Return acts like \fBce\fP \er \en (Delta Data) | |
141 | xs bool Standout not erased by writing over it (HP 264?) | |
142 | xt bool Tabs are destructive, magic so char (Teleray 1061) | |
143 | .fi | |
144 | .PP | |
145 | .B A Sample Entry | |
146 | .PP | |
147 | The following entry, which describes the Concept\-100, is among the more | |
148 | complex entries in the | |
149 | .I termcap | |
150 | file as of this writing. | |
151 | (This particular concept entry is outdated, | |
152 | and is used as an example only.) | |
153 | .PP | |
154 | .nf | |
155 | c1\||\|c100\||\|concept100:is=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200:\e | |
156 | :al=3*\eE^R:am:bs:cd=16*\eE^C:ce=16\eE^S:cl=2*^L:cm=\eEa%+ %+ :co#80:\e | |
157 | :dc=16\eE^A:dl=3*\eE^B:ei=\eE\e200:eo:im=\eE^P:in:ip=16*:li#24:mi:nd=\eE=:\e | |
158 | :se=\eEd\eEe:so=\eED\eEE:ta=8\et:ul:up=\eE;:vb=\eEk\eEK:xn: | |
159 | .fi | |
160 | .PP | |
161 | Entries may continue onto multiple lines by giving a \e as the last | |
162 | character of a line, and that empty fields | |
163 | may be included for readability (here between the last field on a line | |
164 | and the first field on the next). | |
165 | Capabilities in | |
166 | .I termcap | |
167 | are of three types: | |
168 | Boolean capabilities which indicate that the terminal has | |
169 | some particular feature, numeric capabilities giving the size of the terminal | |
170 | or the size of particular delays, and string | |
171 | capabilities, which give a sequence which can be used to perform particular | |
172 | terminal operations. | |
173 | .PP | |
174 | .B Types of Capabilities | |
175 | .PP | |
176 | All capabilities have two letter codes. For instance, the fact that | |
177 | the Concept has \*(lqautomatic margins\*(rq (i.e. an automatic return and linefeed | |
178 | when the end of a line is reached) is indicated by the capability \fBam\fR. | |
179 | Hence the description of the Concept includes \fBam\fR. | |
180 | Numeric capabilities are followed by the character `#' and then the value. | |
181 | Thus \fBco\fR which indicates the number of columns the terminal has | |
182 | gives the value `80' for the Concept. | |
183 | .PP | |
184 | Finally, string valued capabilities, such as \fBce\fR (clear to end of line | |
185 | sequence) are given by the two character code, an `=', and then a string | |
186 | ending at the next following `:'. A delay in milliseconds may appear after | |
187 | the `=' in such a capability, and padding characters are supplied by the | |
188 | editor after the remainder of the string is sent to provide this delay. | |
189 | The delay can be either a integer, e.g. `20', or an integer followed by | |
190 | an `*', i.e. `3*'. A `*' indicates that the padding required is proportional | |
191 | to the number of lines affected by the operation, and the amount given is | |
192 | the per-affected-unit padding required. | |
193 | When a `*' is specified, it is sometimes useful to give a delay of the form | |
194 | `3.5' specify a delay per unit to tenths of milliseconds. | |
195 | .PP | |
196 | A number of escape sequences are provided in the string valued capabilities | |
197 | for easy encoding of characters there. A \fB\eE\fR maps to an \s-2ESCAPE\s0 | |
198 | character, \fB^x\fR maps to a control-x for any appropriate x, and the sequences | |
199 | \fB\en \er \et \eb \ef\fR give a newline, return, tab, backspace and formfeed. | |
200 | Finally, characters may be given as three octal digits after a \fB\e\fR, | |
201 | and the characters \fB^\fR and \fB\e\fR may be given as \fB\e^\fR and \fB\e\e\fR. | |
202 | If it is necessary to place a \fB:\fR in a capability it must be escaped in | |
203 | octal as \fB\e072\fR. | |
204 | If it is necessary to place a null character in a string capability it | |
205 | must be encoded as \fB\e200\fR. The routines which deal with | |
206 | .I termcap | |
207 | use C strings, and strip the high bits of the output very late so that | |
208 | a \fB\e200\fR comes out as a \fB\e000\fR would. | |
209 | .br | |
210 | .ne 5 | |
211 | .PP | |
212 | .B Preparing Descriptions | |
213 | .PP | |
214 | We now outline how to prepare descriptions of terminals. | |
215 | The most effective way to prepare a terminal description is by imitating | |
216 | the description of a similar terminal in | |
217 | .I termcap | |
218 | and to build up a description gradually, using partial descriptions | |
219 | with | |
220 | .I ex | |
221 | to check that they are correct. | |
222 | Be aware that a very unusual terminal may expose deficiencies in | |
223 | the ability of the | |
224 | .I termcap | |
225 | file to describe it | |
226 | or bugs in | |
227 | .I ex. | |
228 | To easily test a new terminal description you can set the environment variable | |
229 | TERMCAP to a pathname of a file containing the description you are working | |
230 | on and the editor will look there rather than in | |
231 | .I /etc/termcap. | |
232 | TERMCAP can also be set to the termcap entry itself | |
233 | to avoid reading the file when starting up the editor. | |
234 | (This only works on version 7 systems.) | |
235 | .PP | |
236 | .B Basic capabilities | |
237 | .PP | |
238 | The number of columns on each line for the terminal is given by the | |
239 | \fBco\fR numeric capability. If the terminal is a \s-2CRT\s0, then the | |
240 | number of lines on the screen is given by the \fBli\fR capability. | |
241 | If the terminal wraps around to the beginning of the next line when | |
242 | it reaches the right margin, then it should have the \fBam\fR capability. | |
243 | If the terminal can clear its screen, then this is given by the | |
244 | \fBcl\fR string capability. If the terminal can backspace, then it | |
245 | should have the \fBbs\fR capability, unless a backspace is accomplished | |
246 | by a character other than \fB^H\fR (ugh) in which case you should give | |
247 | this character as the \fBbc\fR string capability. If it overstrikes | |
248 | (rather than clearing a position when a character is struck over) | |
249 | then it should have the \fBos\fR capability. | |
250 | .PP | |
251 | A very important point here is that the local cursor motions encoded | |
252 | in | |
253 | .I termcap | |
254 | are undefined at the left and top edges of a \s-2CRT\s0 terminal. | |
255 | The editor will never attempt to backspace around the left edge, nor | |
256 | will it attempt to go up locally off the top. The editor assumes that | |
257 | feeding off the bottom of the screen will cause the screen to scroll up, | |
258 | and the \fBam\fR capability tells whether the cursor sticks at the right | |
259 | edge of the screen. If the terminal has switch selectable automatic margins, | |
260 | the | |
261 | .I termcap | |
262 | file usually assumes that this is on, i.e. \fBam\fR. | |
263 | .PP | |
264 | These capabilities suffice to describe hardcopy and \*(lqglass-tty\*(rq terminals. | |
265 | Thus the model 33 teletype is described as | |
266 | .PP | |
267 | .DT | |
268 | t3\||\|33\||\|tty33:co#72:os | |
269 | .PP | |
270 | while the Lear Siegler \s-2ADM\-3\s0 is described as | |
271 | .PP | |
272 | .DT | |
273 | cl\||\|adm3|3|lsi adm3:am:bs:cl=^Z:li#24:co#80 | |
274 | .PP | |
275 | .B Cursor addressing | |
276 | .PP | |
277 | Cursor addressing in the terminal is described by a | |
278 | \fBcm\fR string capability, with | |
773db9bd | 279 | .IR printf (3S) |
c4737001 KM |
280 | like escapes \fB%x\fR in it. |
281 | These substitute to encodings of the current line or column position, | |
282 | while other characters are passed through unchanged. | |
283 | If the \fBcm\fR string is thought of as being a function, then its | |
284 | arguments are the line and then the column to which motion is desired, | |
285 | and the \fB%\fR encodings have the following meanings: | |
286 | .PP | |
287 | .DT | |
288 | .nf | |
289 | %d as in \fIprintf\fR, 0 origin | |
290 | %2 like %2d | |
291 | %3 like %3d | |
292 | %. like %c | |
293 | %+x adds \fIx\fR to value, then %. | |
294 | %>xy if value > x adds y, no output. | |
295 | %r reverses order of line and column, no output | |
296 | %i increments line/column (for 1 origin) | |
297 | %% gives a single % | |
298 | %n exclusive or row and column with 0140 (DM2500) | |
299 | %B BCD (16*(x/10)) + (x%10), no output. | |
300 | %D Reverse coding (x-2*(x%16)), no output. (Delta Data). | |
301 | .fi | |
302 | .PP | |
303 | Consider the HP2645, which, to get to row 3 and column 12, needs | |
304 | to be sent \eE&a12c03Y padded for 6 milliseconds. Note that the order | |
305 | of the rows and columns is inverted here, and that the row and column | |
306 | are printed as two digits. Thus its \fBcm\fR capability is \*(lqcm=6\eE&%r%2c%2Y\*(rq. | |
307 | The Microterm \s-2ACT-IV\s0 needs the current row and column sent | |
308 | preceded by a \fB^T\fR, with the row and column simply encoded in binary, | |
309 | \*(lqcm=^T%.%.\*(rq. Terminals which use \*(lq%.\*(rq need to be able to | |
310 | backspace the cursor (\fBbs\fR or \fBbc\fR), | |
311 | and to move the cursor up one line on the screen (\fBup\fR introduced below). | |
312 | This is necessary because it is not always safe to transmit \fB\et\fR, \fB\en\fR | |
313 | \fB^D\fR and \fB\er\fR, as the system may change or discard them. | |
314 | .PP | |
315 | A final example is the \s-2LSI ADM\s0-3a, which uses row and column | |
316 | offset by a blank character, thus \*(lqcm=\eE=%+ %+ \*(rq. | |
317 | .PP | |
318 | .B Cursor motions | |
319 | .PP | |
320 | If the terminal can move the cursor one position to the right, leaving | |
321 | the character at the current position unchanged, then this sequence should | |
322 | be given as \fBnd\fR (non-destructive space). If it can move the cursor | |
323 | up a line | |
324 | on the screen in the same column, this should be given as \fBup\fR. | |
325 | If the terminal has no cursor addressing capability, but can home the cursor | |
326 | (to very upper left corner of screen) then this can be given as | |
327 | \fBho\fR; similarly a fast way of getting to the lower left hand corner | |
328 | can be given as \fBll\fR; this may involve going up with \fBup\fR | |
329 | from the home position, | |
330 | but the editor will never do this itself (unless \fBll\fR does) because it | |
331 | makes no assumption about the effect of moving up from the home position. | |
332 | .PP | |
333 | .B Area clears | |
334 | .PP | |
335 | If the terminal can clear from the current position to the end of the | |
336 | line, leaving the cursor where it is, this should be given as \fBce\fR. | |
337 | If the terminal can clear from the current position to the end of the | |
338 | display, then this should be given as \fBcd\fR. | |
339 | The editor only uses | |
340 | \fBcd\fR from the first column of a line. | |
341 | .PP | |
342 | .B Insert/delete line | |
343 | .PP | |
344 | If the terminal can open a new blank line before the line where the cursor | |
345 | is, this should be given as \fBal\fR; this is done only from the first | |
346 | position of a line. The cursor must then appear on the newly blank line. | |
347 | If the terminal can delete the line which the cursor is on, then this | |
348 | should be given as \fBdl\fR; this is done only from the first position on | |
349 | the line to be deleted. | |
350 | If the terminal can scroll the screen backwards, then this can be given as | |
351 | \fBsb\fR, but just \fBal\fR suffices. | |
352 | If the terminal can retain display memory above then the | |
353 | \fBda\fR capability should be given; if display memory can be retained | |
354 | below then \fBdb\fR should be given. These let the editor understand | |
355 | that deleting a line on the screen may bring non-blank lines up from below | |
356 | or that scrolling back with \fBsb\fR may bring down non-blank lines. | |
357 | .PP | |
358 | .B Insert/delete character | |
359 | .PP | |
360 | There are two basic kinds of intelligent terminals with respect to | |
361 | insert/delete character which can be described using | |
362 | .I termcap. | |
363 | The most common insert/delete character operations affect only the characters | |
364 | on the current line and shift characters off the end of the line rigidly. | |
365 | Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make | |
366 | a distinction between typed and untyped blanks on the screen, shifting | |
367 | upon an insert or delete only to an untyped blank on the screen which is | |
368 | either eliminated, or expanded to two untyped blanks. You can find out | |
369 | which kind of terminal you have by clearing the screen and then typing | |
370 | text separated by cursor motions. Type \*(lqabc\ \ \ \ def\*(rq using local | |
371 | cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq. | |
372 | Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert | |
373 | mode. If typing characters causes the rest of the line to shift | |
374 | rigidly and characters to fall off the end, then your terminal does | |
375 | not distinguish between blanks and untyped positions. If the \*(lqabc\*(rq | |
376 | shifts over to the \*(lqdef\*(rq which then move together around the end of the | |
377 | current line and onto the next as you insert, you have the second type of | |
378 | terminal, and should give the capability \fBin\fR, which stands for | |
379 | \*(lqinsert null\*(rq. If your terminal does something different and unusual | |
380 | then you may have to modify the editor to get it to use the insert | |
381 | mode your terminal defines. We have seen no terminals which have an insert | |
382 | mode not not falling into one of these two classes. | |
383 | .PP | |
384 | The editor can handle both terminals which have an insert mode, and terminals | |
385 | which send a simple sequence to open a blank position on the current line. | |
386 | Give as \fBim\fR the sequence to get into insert mode, or give it an | |
387 | empty value if your terminal uses a sequence to insert a blank position. | |
388 | Give as \fBei\fR the sequence to leave insert mode (give this, with | |
389 | an empty value also if you gave \fBim\fR so). | |
390 | Now give as \fBic\fR any sequence needed to be sent just before sending | |
391 | the character to be inserted. Most terminals with a true insert mode | |
392 | will not give \fBic\fR, terminals which send a sequence to open a screen | |
393 | position should give it here. (Insert mode is preferable to the sequence | |
394 | to open a position on the screen if your terminal has both.) | |
395 | If post insert padding is needed, give this as a number of milliseconds | |
396 | in \fBip\fR (a string option). Any other sequence which may need to be | |
397 | sent after an insert of a single character may also be given in \fBip\fR. | |
398 | .PP | |
399 | It is occasionally necessary to move around while in insert mode | |
400 | to delete characters on the same line (e.g. if there is a tab after | |
401 | the insertion position). If your terminal allows motion while in | |
402 | insert mode you can give the capability \fBmi\fR to speed up inserting | |
403 | in this case. Omitting \fBmi\fR will affect only speed. Some terminals | |
404 | (notably Datamedia's) must not have \fBmi\fR because of the way their | |
405 | insert mode works. | |
406 | .PP | |
407 | Finally, you can specify delete mode by giving \fBdm\fR and \fBed\fR | |
408 | to enter and exit delete mode, and \fBdc\fR to delete a single character | |
409 | while in delete mode. | |
410 | .PP | |
411 | .B "Highlighting, underlining, and visible bells" | |
412 | .PP | |
413 | If your terminal has sequences to enter and exit standout mode these | |
414 | can be given as \fBso\fR and \fBse\fR respectively. | |
415 | If there are several flavors of standout mode | |
416 | (such as inverse video, blinking, or underlining \- | |
417 | half bright is not usually an acceptable \*(lqstandout\*(rq mode | |
418 | unless the terminal is in inverse video mode constantly) | |
419 | the preferred mode is inverse video by itself. | |
420 | If the code to change into or out of standout | |
421 | mode leaves one or even two blank spaces on the screen, | |
422 | as the TVI 912 and Teleray 1061 do, | |
423 | then \fBug\fR should be given to tell how many spaces are left. | |
424 | .PP | |
425 | Codes to begin underlining and end underlining can be given as \fBus\fR | |
426 | and \fBue\fR respectively. | |
427 | If the terminal has a code to underline the current character and move | |
428 | the cursor one space to the right, | |
429 | such as the Microterm Mime, | |
430 | this can be given as \fBuc\fR. | |
431 | (If the underline code does not move the cursor to the right, | |
432 | give the code followed by a nondestructive space.) | |
433 | .PP | |
434 | Many terminals, such as the HP 2621, automatically leave standout | |
435 | mode when they move to a new line or the cursor is addressed. | |
436 | Programs using standout mode should exit standout mode before | |
437 | moving the cursor or sending a newline. | |
438 | .PP | |
439 | If the terminal has | |
440 | a way of flashing the screen to indicate an error quietly (a bell replacement) | |
441 | then this can be given as \fBvb\fR; it must not move the cursor. | |
442 | If the terminal should be placed in a different mode during | |
443 | open and visual modes of | |
444 | .I ex, | |
445 | this can be given as | |
446 | \fBvs\fR and \fBve\fR, sent at the start and end of these modes | |
447 | respectively. These can be used to change, e.g., from a underline | |
448 | to a block cursor and back. | |
449 | .PP | |
450 | If the terminal needs to be in a special mode when running | |
451 | a program that addresses the cursor, | |
452 | the codes to enter and exit this mode can be given as \fBti\fR and \fBte\fR. | |
453 | This arises, for example, from terminals like the Concept with more than | |
454 | one page of memory. | |
455 | If the terminal has only memory relative cursor addressing and not screen | |
456 | relative cursor addressing, a one screen-sized window must be fixed into | |
457 | the terminal for cursor addressing to work properly. | |
458 | .PP | |
459 | If your terminal correctly generates underlined characters | |
460 | (with no special codes needed) | |
461 | even though it does not overstrike, | |
462 | then you should give the capability \fBul\fR. | |
463 | If overstrikes are erasable with a blank, | |
464 | then this should be indicated by giving \fBeo\fR. | |
465 | .PP | |
466 | .B Keypad | |
467 | .PP | |
468 | If the terminal has a keypad that transmits codes when the keys are pressed, | |
469 | this information can be given. Note that it is not possible to handle | |
470 | terminals where the keypad only works in local (this applies, for example, | |
471 | to the unshifted HP 2621 keys). | |
472 | If the keypad can be set to transmit or not transmit, | |
473 | give these codes as \fBks\fR and \fBke\fR. | |
474 | Otherwise the keypad is assumed to always transmit. | |
475 | The codes sent by the left arrow, right arrow, up arrow, down arrow, | |
476 | and home keys can be given as \fBkl, kr, ku, kd, \fRand\fB kh\fR respectively. | |
477 | If there are function keys such as f0, f1, ..., f9, the codes they send | |
478 | can be given as \fBk0, k1, ..., k9\fR. | |
479 | If these keys have labels other than the default f0 through f9, the labels | |
480 | can be given as \fBl0, l1, ..., l9\fR. | |
481 | If there are other keys that transmit the same code as the terminal expects | |
482 | for the corresponding function, such as clear screen, the \fItermcap\fP | |
483 | 2 letter codes can be given in the \fBko\fR capability, | |
484 | for example, \*(lq:ko=cl,ll,sf,sb:\*(rq, which says that the terminal has | |
485 | clear, home down, scroll down, and scroll up keys that transmit | |
486 | the same thing as the cl, ll, sf, and sb entries. | |
487 | .PP | |
488 | The | |
489 | .B ma | |
490 | entry is also used to indicate arrow keys on terminals which have | |
491 | single character arrow keys. It is obsolete but still in use in | |
492 | version 2 of vi, which must be run on some minicomputers due to | |
493 | memory limitations. | |
494 | This field is redundant with | |
495 | .BR "kl, kr, ku, kd, " and " kh" . | |
496 | It consists of groups of two characters. | |
497 | In each group, the first character is what an arrow key sends, the | |
498 | second character is the corresponding vi command. | |
499 | These commands are | |
500 | .B h | |
501 | for | |
502 | .BR kl , | |
503 | .B j | |
504 | for | |
505 | .BR kd , | |
506 | .B k | |
507 | for | |
508 | .BR ku , | |
509 | .B l | |
510 | for | |
511 | .BR kr , | |
512 | and | |
513 | .B H | |
514 | for | |
515 | .BR kh . | |
516 | For example, the mime would be | |
517 | .B ":ma=^Kj^Zk^Xl:" | |
518 | indicating arrow keys left (^H), down (^K), up (^Z), and right (^X). | |
519 | (There is no home key on the mime.) | |
520 | .PP | |
521 | .B Miscellaneous | |
522 | .PP | |
523 | If the terminal requires other than a null (zero) character as a pad, | |
524 | then this can be given as \fBpc\fR. | |
525 | .PP | |
526 | If tabs on the terminal require padding, or if the terminal uses a | |
527 | character other than \fB^I\fR to tab, then this can be given as \fBta\fR. | |
528 | .PP | |
529 | Hazeltine terminals, which don't allow `~' characters to be printed should | |
530 | indicate \fBhz\fR. | |
531 | Datamedia terminals, which echo carriage-return linefeed for carriage return | |
532 | and then ignore a following linefeed should indicate \fBnc\fR. | |
533 | Early Concept terminals, which ignore a linefeed immediately after an \fBam\fR | |
534 | wrap, should indicate \fBxn\fR. | |
535 | If an erase-eol is required to get rid of standout | |
536 | (instead of merely writing on top of it), | |
537 | \fBxs\fP should be given. | |
538 | Teleray terminals, where tabs turn all characters moved over to blanks, | |
539 | should indicate \fBxt\fR. | |
540 | Other specific terminal problems may be corrected by adding more | |
541 | capabilities of the form \fBx\fIx\fR. | |
542 | .PP | |
543 | Other capabilities | |
544 | include \fBis\fR, an initialization string for the terminal, | |
545 | and \fBif\fR, the name of a file containing long initialization strings. | |
546 | These strings are expected to properly clear and then set the tabs | |
547 | on the terminal, if the terminal has settable tabs. | |
548 | If both are given, \fBis\fR will be printed before \fBif\fR. | |
549 | This is useful where \fBif\fR is | |
550 | .I /usr/lib/tabset/std | |
551 | but \fBis\fR | |
552 | clears the tabs first. | |
553 | .PP | |
554 | .B Similar Terminals | |
555 | .PP | |
556 | If there are two very similar terminals, | |
557 | one can be defined as being just like the other with certain exceptions. | |
558 | The string capability \fBtc\fR can be given | |
559 | with the name of the similar terminal. | |
560 | This capability must be \fIlast\fP and the combined length of the two entries | |
561 | must not exceed 1024. Since | |
562 | .I termlib | |
563 | routines search the entry from left to right, and since the tc capability is | |
564 | replaced by the corresponding entry, the capabilities given at the left | |
565 | override the ones in the similar terminal. | |
773db9bd | 566 | A capability can be canceled with \fBxx@\fR where xx is the capability. |
c4737001 KM |
567 | For example, the entry |
568 | .PP | |
569 | hn\||\|2621nl:ks@:ke@:tc=2621: | |
570 | .PP | |
571 | defines a 2621nl that does not have the \fBks\fR or \fBke\fR capabilities, | |
572 | and hence does not turn on the function key labels when in visual mode. | |
573 | This is useful for different modes for a terminal, or for different | |
574 | user preferences. | |
575 | .SH FILES | |
576 | .DT | |
577 | /etc/termcap file containing terminal descriptions | |
578 | .SH SEE ALSO | |
773db9bd | 579 | ex(1), curses(3X), termcap(3X), tset(1), vi(1), ul(1), more(1) |
c4737001 KM |
580 | .SH AUTHOR |
581 | William Joy | |
582 | .br | |
583 | Mark Horton added underlining and keypad support | |
584 | .SH BUGS | |
585 | .I Ex | |
586 | allows only 256 characters for string capabilities, and the routines | |
587 | in | |
773db9bd | 588 | .IR termcap (3X) |
c4737001 KM |
589 | do not check for overflow of this buffer. |
590 | The total length of a single entry (excluding only escaped newlines) | |
591 | may not exceed 1024. | |
592 | .PP | |
593 | The | |
594 | .BR ma , | |
595 | .BR vs , | |
596 | and | |
597 | .B ve | |
598 | entries are specific to the | |
599 | .I vi | |
600 | program. | |
601 | .PP | |
602 | Not all programs support all entries. | |
603 | There are entries that are not supported by any program. |