source: trunk/minix/man/man5/termcap.5@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

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