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.
5 .\" @(#)termcap.5 6.4 (Berkeley) 5/15/86
9 .TH TERMCAP 5 "1 November 1985"
12 termcap \- terminal capability data base
17 is a data base describing terminals,
24 Terminals are described in
26 by giving a set of capabilities that they have and by describing
27 how operations are performed.
28 Padding requirements and initialization sequences
34 consist of a number of `:'-separated fields.
35 The first entry for each terminal gives the names that are known for the
36 terminal, separated by `|' characters.
37 The first name is always two characters
38 long and is used by older systems which store the terminal type
39 in a 16-bit word in a system-wide data base.
40 The second name given is the most common abbreviation for the terminal,
41 the last name given should be a long name fully identifying the terminal,
42 and all others are understood as synonyms for the terminal name.
43 All names but the first and last
44 should be in lower case and contain no blanks;
45 the last name may well contain
46 upper case and blanks for readability.
48 Terminal names (except for the last, verbose entry)
49 should be chosen using the following conventions.
50 The particular piece of hardware making up the terminal
51 should have a root name chosen, thus \*(lqhp2621\*(rq.
52 This name should not contain hyphens.
53 Modes that the hardware can be in
55 should be indicated by appending a hyphen and an indicator of the mode.
56 Therefore, a \*(lqvt100\*(rq in 132-column mode would be \*(lqvt100-w\*(rq.
57 The following suffixes should be used where possible:
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
63 .if t .nr Xx \n(.lu-\n(.i-\w'\fBSuffix\fP\ \ \ With automatic margins (usually default)\ \ vt100-am'u
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
78 field in the table have the following meanings
79 (more than one may apply to a capability):
86 N indicates numeric parameter(s)
88 P indicates that padding may be specified
90 * indicates that padding may be based on the number of lines affected
92 o indicates capability is obsolete
95 \*(lqObsolete\*(rq capabilities have no
98 since they were considered useless,
99 or are subsumed by other capabilities.
100 New software should not rely on them at all.
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 '
108 \fBName Type Notes Description\fP
110 ae str (P) End alternate character set
112 AL str (NP*) Add \fIn\^\fP new blank lines
114 al str (P*) Add new blank line
116 am bool Terminal has automatic margins
118 as str (P) Start alternate character set
120 bc str (o) Backspace if not \fB^H\fP
122 bl str (P) Audible signal (bell)
124 bs bool (o) Terminal can backspace with \fB^H\fP
128 bw bool \fBle\fP (backspace) wraps from column 0 to last column
130 CC str Terminal settable command character in prototype
132 cd str (P*) Clear to end of display
134 ce str (P) Clear to end of line
136 ch str (NP) Set cursor column (horizontal position)
138 cl str (P*) Clear screen and home cursor
140 CM str (NP) Memory-relative cursor addressing
142 cm str (NP) Screen-relative cursor motion
144 co num Number of columns in a line (See BUGS section below)
146 cr str (P) Carriage return
148 cs str (NP) Change scrolling region (VT100)
150 ct str (P) Clear all tab stops
152 cv str (NP) Set cursor row (vertical position)
154 da bool Display may be retained above the screen
156 dB num (o) Milliseconds of \fBbs\fP delay needed (default 0)
158 db bool Display may be retained below the screen
160 DC str (NP*) Delete \fIn\^\fP characters
162 dC num (o) Milliseconds of \fBcr\fP delay needed (default 0)
164 dc str (P*) Delete character
166 dF num (o) Milliseconds of \fBff\fP delay needed (default 0)
168 DL str (NP*) Delete \fIn\^\fP lines
170 dl str (P*) Delete line
172 dm str Enter delete mode
174 dN num (o) Milliseconds of \fBnl\fP delay needed (default 0)
176 DO str (NP*) Move cursor down \fIn\^\fP lines
180 ds str Disable status line
182 dT num (o) Milliseconds of horizontal tab delay needed (default 0)
184 dV num (o) Milliseconds of vertical tab delay needed (default 0)
186 ec str (NP) Erase \fIn\^\fP characters
188 ed str End delete mode
190 ei str End insert mode
192 eo bool Can erase overstrikes with a blank
194 EP bool (o) Even parity
196 es bool Escape can be used on the status line
198 ff str (P*) Hardcopy terminal page eject
200 fs str Return from status line
202 gn bool Generic line type (\fIe.g.\fP dialup, switch)
204 hc bool Hardcopy terminal
206 HD bool (o) Half-duplex
208 hd str Half-line down (forward 1/2 linefeed)
210 ho str (P) Home cursor
212 hs bool Has extra \*(lqstatus line\*(rq
214 hu str Half-line up (reverse 1/2 linefeed)
216 hz bool Cannot print ~s (Hazeltine)
218 i1-i3 str Terminal initialization strings (\fBterminfo\^\fP only)
220 IC str (NP*) Insert \fIn\^\fP blank characters
222 ic str (P*) Insert character
224 if str Name of file containing initialization string
226 im str Enter insert mode
228 in bool Insert mode distinguishes nulls
230 iP str Pathname of program for initialization (\fBterminfo\^\fP only)
232 ip str (P*) Insert pad after character inserted
234 is str Terminal initialization string (\fBtermcap\^\fP only)
236 it num Tabs initially every \fIn\^\fP positions
238 K1 str Sent by keypad upper left
240 K2 str Sent by keypad upper right
242 K3 str Sent by keypad center
244 K4 str Sent by keypad lower left
246 K5 str Sent by keypad lower right
248 k0-k9 str Sent by function keys 0-9
250 kA str Sent by insert-line key
252 ka str Sent by clear-all-tabs key
254 kb str Sent by backspace key
256 kC str Sent by clear-screen or erase key
258 kD str Sent by delete-character key
260 kd str Sent by down-arrow key
262 kE str Sent by clear-to-end-of-line key
264 ke str Out of \*(lqkeypad transmit\*(rq mode
266 kF str Sent by scroll-forward/down key
268 kH str Sent by home-down key
270 kh str Sent by home key
272 kI str Sent by insert-character or enter-insert-mode key
274 kL str Sent by delete-line key
276 kl str Sent by left-arrow key
278 kM str Sent by insert key while in insert mode
280 km bool Has a \*(lqmeta\*(rq key (shift, sets parity bit)
282 kN str Sent by next-page key
284 kn num (o) Number of function (\fBk0\fP\-\fBk9\fP) keys (default 0)
286 ko str (o) Termcap entries for other non-function keys
288 kP str Sent by previous-page key
290 kR str Sent by scroll-backward/up key
292 kr str Sent by right-arrow key
294 kS str Sent by clear-to-end-of-screen key
296 ks str Put terminal in \*(lqkeypad transmit\*(rq mode
298 kT str Sent by set-tab key
300 kt str Sent by clear-tab key
302 ku str Sent by up-arrow key
304 l0-l9 str Labels on function keys if not \*(lqf\fIn\^\fP\*(rq
306 LC bool (o) Lower-case only
308 LE str (NP) Move cursor left \fIn\^\fP positions
310 le str (P) Move cursor left one position
312 li num Number of lines on screen or page (See BUGS section below)
314 ll str Last line, first column
316 lm num Lines of memory if > \fBli\fP (0 means varies)
318 ma str (o) Arrow key map (used by \fBvi\^\fP version 2 only)
320 mb str Turn on blinking attribute
322 md str Turn on bold (extra bright) attribute
324 me str Turn off all attributes
326 mh str Turn on half-bright attribute
328 mi bool Safe to move while in insert mode
330 mk str Turn on blank attribute (characters invisible)
332 ml str (o) Memory lock on above cursor
334 mm str Turn on \*(lqmeta mode\*(rq (8th bit)
336 mo str Turn off \*(lqmeta mode\*(rq
338 mp str Turn on protected attribute
340 mr str Turn on reverse-video attibute
342 ms bool Safe to move in standout modes
344 mu str (o) Memory unlock (turn off memory lock)
346 nc bool (o) No correctly-working \fBcr\fP (Datamedia 2500, Hazeltine 2000)
348 nd str Non-destructive space (cursor right)
350 NL bool (o) \fB\\n\fP is newline, not line feed
352 nl str (o) Newline character if not \fB\\n\fP
354 ns bool (o) Terminal is a \s-1CRT\s0 but doesn't scroll
356 nw str (P) Newline (behaves like \fBcr\fP followed by \fBdo\fP)
358 OP bool (o) Odd parity
360 os bool Terminal overstrikes
362 pb num Lowest baud where delays are required
364 pc str Pad character (default \s-2NUL\s0)
366 pf str Turn off the printer
368 pk str Program function key \fIn\^\fP to type string \fIs\fP (\fBterminfo\^\fP only)
370 pl str Program function key \fIn\^\fP to execute string \fIs\fP (\fBterminfo\^\fP only)
372 pO str (N) Turn on the printer for \fIn\^\fP bytes
374 po str Turn on the printer
376 ps str Print contents of the screen
378 pt bool (o) Has hardware tabs (may need to be set with \fBis\fP)
380 px str Program function key \fIn\^\fP to transmit string \fIs\fP (\fBterminfo\^\fP only)
382 r1-r3 str Reset terminal completely to sane modes (\fBterminfo\^\fP only)
384 rc str (P) Restore cursor to position of last \fBsc\fP
386 rf str Name of file containing reset codes
388 RI str (NP) Move cursor right \fIn\^\fP positions
390 rp str (NP*) Repeat character \fIc n\^\fP times
392 rs str Reset terminal completely to sane modes (\fBtermcap\^\fP only)
394 sa str (NP) Define the video attributes
396 sc str (P) Save cursor position
398 se str End standout mode
400 SF str (NP*) Scroll forward \fIn\^\fP lines
402 sf str (P) Scroll text up
404 sg num Number of garbage chars left by \fBso\fP or \fBse\fP (default 0)
406 so str Begin standout mode
408 SR str (NP*) Scroll backward \fIn\^\fP lines
410 sr str (P) Scroll text down
412 st str Set a tab in all rows, current column
414 ta str (P) Tab to next 8-position hardware tab stop
416 tc str Entry of similar terminal \- must be last
418 te str String to end programs that use \fBtermcap\fP
420 ti str String to begin programs that use \fBtermcap\fP
422 ts str (N) Go to status line, column \fIn\^\fP
424 UC bool (o) Upper-case only
426 uc str Underscore one character and move past it
428 ue str End underscore mode
430 ug num Number of garbage chars left by \fBus\fP or \fBue\fP (default 0)
432 ul bool Underline character overstrikes
434 UP str (NP*) Move cursor up \fIn\^\fP lines
436 up str Upline (cursor up)
438 us str Start underscore mode
440 vb str Visible bell (must not move cursor)
442 ve str Make cursor appear normal (undo \fBvs\fP/\fBvi\fP)
444 vi str Make cursor invisible
446 vs str Make cursor very visible
448 vt num Virtual terminal number (not supported on all systems)
450 wi str (N) Set current window
452 ws num Number of columns in status line
454 xb bool Beehive (f1=\s-2ESC\s0, f2=^C)
456 xn bool Newline ignored after 80 cols (Concept)
458 xo bool Terminal uses xoff/xon (\s-2DC3\s0/\s-2DC1\s0) handshaking
460 xr bool (o) Return acts like \fBce cr nl\fP (Delta Data)
462 xs bool Standout not erased by overwriting (Hewlett-Packard)
464 xt bool Tabs ruin, magic \fBso\fP char (Teleray 1061)
466 xx bool (o) Tektronix 4025 insert-line
471 The following entry, which describes the Concept\-100, is among the more
472 complex entries in the
474 file as of this writing.
479 ca\||\|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:
493 Entries may continue onto multiple lines by giving a \e as the last
494 character of a line, and empty fields
495 may be included for readability (here between the last field on a line
496 and the first field on the next).
497 Comments may be included on lines beginning with \*(lq#\*(rq.
501 .B Types of Capabilities
505 are of three types: Boolean capabilities,
506 which indicate particular features that the terminal has;
507 numeric capabilities,
508 giving the size of the display or the size of other attributes;
509 and string capabilities,
510 which give character sequences that can be used to perform particular
512 All capabilities have two-letter codes.
513 For instance, the fact that
517 an automatic return and linefeed
518 when the end of a line is reached) is indicated by the Boolean capability
520 Hence the description of the Concept includes
523 Numeric capabilities are followed by the character `#' then the value.
526 which indicates the number of columns the display has,
527 gives the value `80' for the Concept.
529 Finally, string-valued capabilities, such as
531 (clear-to-end-of-line
532 sequence) are given by the two-letter code, an `=', then a string
533 ending at the next following `:'.
534 A delay in milliseconds may appear after
535 the `=' in such a capability,
536 which causes padding characters to be supplied by
538 after the remainder of the string is sent to provide this delay.
539 The delay can be either a number,
541 `20', or a number followed by
545 An `*' indicates that the padding required is proportional
546 to the number of lines affected by the operation, and the amount given is
547 the per-affected-line padding required.
548 (In the case of insert-character,
549 the factor is still the number of
552 this is always 1 unless the terminal has
554 and the software uses it.)
555 When 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.)
559 A number of escape sequences are provided in the string-valued capabilities
560 for easy encoding of control characters there.
562 maps to an \s-2ESC\s0
565 maps to a control-X for any appropriate X,
572 map to linefeed, return, tab, backspace, and formfeed, respectively.
573 Finally, characters may be given as three octal digits after a
583 If it is necessary to place a
585 in a capability it must be escaped in
588 If it is necessary to place a \s-2NUL\s0
589 character in a string capability it
592 (The routines that deal with
594 use C strings and strip the high bits of the output very late, so that
601 Sometimes individual capabilities must be commented out.
602 To do this, put a period before the capability name.
603 For example, see the first
607 in the example above.
611 .B Preparing Descriptions
613 We now outline how to prepare descriptions of terminals.
614 The most effective way to prepare a terminal description is by imitating
615 the description of a similar terminal in
617 and to build up a description gradually, using partial descriptions
620 to check that they are correct.
621 Be aware that a very unusual terminal may expose deficiencies in
627 To easily test a new terminal description you can set the environment variable
630 to the absolute pathname of a file containing the description you are working
631 on and programs will look there rather than in
635 can also be set to the
638 to avoid reading the file when starting up a program.
640 To get the padding for insert-line right
641 (if the terminal manufacturer did not document it),
642 a severe test is to use
646 at 9600 baud, delete roughly 16 lines from the middle of the screen,
647 then hit the `u' key several times quickly.
648 If the display messes up, more padding is usually needed.
649 A similar test can be used for insert-character.
653 .B Basic Capabilities
655 The number of columns on each line of the display is given by the
658 If the display is a \s-1CRT\s0, then the
659 number of lines on the screen is given by the
662 If the display wraps around to the beginning of the next line when
663 the cursor reaches the right margin, then it should have the
666 If the terminal can clear its screen,
667 the code to do this is given by the
670 If the terminal overstrikes
671 (rather than clearing the position when a character is overwritten),
675 If the terminal is a printing terminal,
676 with no soft copy unit,
682 applies to storage scope terminals,
683 such as the Tektronix 4010 series,
684 as well as to hard copy and
687 If there is a code to move the cursor to the left edge of the current row,
690 (Normally this will be carriage-return,
692 If there is a code to produce an audible signal (bell, beep,
697 If there is a code (such as backspace)
698 to move the cursor one position to the left,
699 that capability should be given as
702 codes to move to the right, up, and down
710 .I local cursor motions\^
711 should not alter the text they pass over;
712 for example, you would not normally use
714 unless the terminal has the
717 because the space would erase the character moved over.
719 A very important point here is that the local cursor motions encoded
722 have undefined behavior at the left and top edges of a
725 Programs should never attempt to backspace around the left edge,
728 is given, and never attempt to go up off the top
729 using local cursor motions.
731 In order to scroll text up,
732 a program goes to the bottom left corner of the screen and sends the
736 a program goes to the top left corner of the screen and sends the
738 (reverse index) string.
743 have undefined behavior
744 when not on their respective corners of the screen.
745 Parameterized versions of the scrolling sequences are
749 which have the same semantics as
753 except that they take one parameter
754 and scroll that many lines.
755 They also have undefined behavior
756 except at the appropriate corner of the screen.
760 capability tells whether the cursor sticks at the right
761 edge of the screen when text is output there,
762 but this does not necessarily apply to
764 from the last column.
765 Leftward local motion is defined from the left edge only when
769 from the left edge will move to the right edge of the previous row.
770 This is useful for drawing a box around the edge of the screen,
772 If the terminal has switch-selectable automatic margins,
775 description usually assumes that this feature is on,
778 If the terminal has a command
779 that moves to the first column of the next line,
780 that command can be given as
783 It is permissible for this to clear the remainder of the current line,
784 so if the terminal has no correctly-working \s-2CR\s0 and \s-2LF\s0
785 it may still be possible to craft a working
787 out of one or both of them.
789 These capabilities suffice to describe hardcopy and \*(lqglass-tty\*(rq terminals.
790 Thus the Teletype model 33 is described as
793 T3\||\|tty33\||\|33\||\|tty\||\|Teletype model 33:\e
794 :bl=^G:co#72:cr=^M:do=^J:hc:os:
797 and the Lear Siegler \s-1ADM\s0\-3 is described as
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:
806 .B Parameterized Strings
808 Cursor addressing and other strings requiring parameters
810 parameterized string capability, with
811 .BR printf\^ (3)-like
815 while other characters are passed through unchanged.
816 For example, to address the cursor the
818 capability 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
820 visible to the user, not to any unseen memory.
821 If the terminal has memory-relative cursor addressing,
822 that can be indicated by an analogous
828 encodings have the following meanings:
835 %d output value as in \fBprintf\^\fP %d
837 %2 output value as in \fBprintf\^\fP %2d
839 %3 output value as in \fBprintf\^\fP %3d
841 %. output value as in \fBprintf\^\fP %c
843 %+\fIx\fP add \fIx\^\fP to value, then do %.
845 %>\fIxy\fP if value > \fIx\^\fP then add \fIy\^\fP, no output
847 %r reverse order of two parameters, no output
849 %i increment by one, no output
851 %n exclusive-or all parameters with 0140 (Datamedia 2500)
853 %B BCD (16*(value/10)) + (value%10), no output
855 %D Reverse coding (value \- 2*(value%16)), no output (Delta Data)
859 Consider the Hewlett-Packard 2645, which, to get to row 3 and column 12, needs
860 to be sent \*(lq\eE&a12c03Y\*(rq padded for 6 milliseconds.
862 of the row and column coordinates is reversed here
863 and that the row and column
864 are sent as two-digit integers.
867 capability is \*(lqcm=6\eE&%r%2c%2Y\*(rq.
871 needs the current row and column sent
872 simply encoded in binary
876 Terminals that use \*(lq%.\*(rq need to be able to
879 and to move the cursor up one line on the screen
881 This is necessary because it is not always safe to transmit
886 as the system may change or discard them.
889 must set terminal modes so that tabs are not expanded, so
892 This turns out to be essential for the Ann Arbor 4080.)
894 A final example is the Lear Siegler \s-1ADM\s0\-3a,
895 which offsets row and column
896 by a blank character, thus \*(lqcm=\eE=%+ %+ \*(rq.
898 Row or column absolute cursor addressing
899 can be given as single parameter capabilities
901 (horizontal position absolute) and
903 (vertical position absolute).
904 Sometimes these are shorter than the more general two-parameter sequence
905 (as with the Hewlett-Packard 2645) and can be used in preference to
907 If there are parameterized local motions
911 positions to the right)
912 these can be given as
918 with a single parameter indicating how many positions to move.
919 These are primarily useful if the terminal does not have
921 such as the Tektronix 4025.
927 If 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
930 Similarly, a fast way of getting to the lower left-hand corner
933 this may involve going up with
935 from the home position,
936 but a program should never do this itself (unless
938 does), because it can
939 make no assumption about the effect of moving up from the home position.
940 Note that the home position is the same as
941 cursor 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
950 If the terminal can clear from the current position to the end of the
951 line, leaving the cursor where it is, this should be given as
953 If the terminal can clear from the current position to the end of the
954 display, this should be given as
957 must only be invoked from the first column of a line.
959 it can be simulated by a request to delete a large number of lines,
966 .B Insert/Delete Line
968 If the terminal can open a new blank line
969 before the line containing the cursor,
970 this should be given as
972 this must be invoked only from the first
974 The cursor must then appear at the left of the newly blank line.
975 If the terminal can delete the line that the cursor is on, this
978 this must only be used from the first position on
979 the line to be deleted.
984 which take a single parameter
985 and insert or delete that many lines
990 If the terminal has a settable scrolling region
992 the command to set this can be described with the
995 which takes two parameters: the top and bottom lines of the scrolling region.
996 The cursor position is, alas, undefined after using this command.
997 It is possible to get the effect of insert or delete line
998 using this command \(em the
1002 (save and restore cursor) commands are also useful.
1003 Inserting lines at the top or bottom of the screen can also be done using
1007 on many terminals without a true insert/delete line,
1008 and is often faster even on terminals with those features.
1010 If the terminal has the ability to define a window as part of memory
1011 which all commands affect, it should be given as the parameterized string
1013 The four parameters are the starting and ending lines in memory
1014 and the starting and ending columns in memory, in that order.
1017 capability is described for completeness.
1018 It is unlikely that any
1019 .BR termcap\^ -using
1020 program will support it.)
1022 If the terminal can retain display memory above the screen, then the
1024 capability should be given;
1025 if display memory can be retained
1030 that deleting a line or scrolling may bring non-blank lines up from below
1031 or that scrolling back with
1033 may bring down non-blank lines.
1037 .B Insert/Delete Character
1039 There are two basic kinds of intelligent terminals with respect to
1040 insert/delete character that can be described using
1042 The most common insert/delete character operations affect only the characters
1043 on the current line and shift characters off the end of the line rigidly.
1044 Other terminals, such as the Concept\-100 and the Perkin Elmer Owl, make
1045 a distinction between typed and untyped blanks on the screen, shifting
1046 upon an insert or delete only to an untyped blank on the screen which is
1047 either eliminated or expanded to two untyped blanks.
1049 the kind of terminal you have by clearing the screen then typing
1050 text separated by cursor motions.
1051 Type \*(lqabc\ \ \ \ def\*(rq using local
1052 cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq.
1053 Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert
1055 If typing characters causes the rest of the line to shift
1056 rigidly and characters to fall off the end, then your terminal does
1057 not distinguish between blanks and untyped positions.
1058 If the \*(lqabc\*(rq
1059 shifts over to the \*(lqdef\*(rq which then move together around the end of the
1060 current line and onto the next as you insert, then you have the second type of
1061 terminal and should give the capability \fBin\fP, which stands for
1062 \*(lqinsert null\*(rq.
1063 While these are two logically separate attributes
1066 multi-line insert mode,
1067 and special treatment of untyped spaces),
1068 we have seen no terminals whose insert
1069 mode cannot be described with the single attribute.
1072 can describe both terminals that have an insert mode and terminals
1073 that send a simple sequence to open a blank position on the current line.
1076 the sequence to get into insert mode.
1079 the sequence to leave insert mode.
1082 any sequence that needs to be sent just before
1083 each character to be inserted.
1084 Most terminals with a true insert mode
1087 terminals that use a sequence to open a screen
1088 position should give it here.
1089 (If your terminal has both,
1090 insert mode is usually preferable to
1092 Do not give both unless the terminal actually requires both to be used
1094 If post-insert padding is needed, give this as a number of milliseconds
1098 Any other sequence that may need to be
1099 sent after insertion of a single character can also be given in
1101 If your terminal needs to be placed into an `insert mode'
1102 and needs a special code preceding each inserted character,
1107 can be given, and both will be used.
1110 capability, with one parameter
1112 will repeat the effects of
1117 It is occasionally necessary to move around while in insert mode
1118 to delete characters on the same line
1120 if there is a tab after
1121 the insertion position).
1122 If your terminal allows motion while in
1123 insert mode, you can give the capability
1125 to speed up inserting
1129 will affect only speed.
1131 (notably Datamedia's) must not have
1133 because of the way their
1136 Finally, you can specify
1138 to delete a single character,
1145 and delete mode by giving
1149 to enter and exit delete mode
1150 (which is any mode the terminal needs to be placed in for
1156 .B Highlighting, Underlining, and Visible Bells
1158 If your terminal has one or more kinds of display attributes,
1159 these can be represented in a number of different ways.
1160 You should choose one display form as
1161 .IR "standout mode" ,
1162 representing a good high-contrast, easy-on-the-eyes format
1163 for highlighting error messages and other attention getters.
1164 (If you have a choice, reverse video plus half-bright is good,
1165 or reverse video alone.)
1166 The sequences to enter and exit standout mode
1172 If the code to change into or out of standout
1173 mode leaves one or even two blank spaces or garbage characters on the screen,
1174 as the TVI 912 and Teleray 1061 do,
1177 should be given to tell how many characters are left.
1179 Codes to begin underlining and end underlining can be given as
1184 Underline mode change garbage is specified by
1188 If the terminal has a code to underline the current character and move
1189 the cursor one position to the right,
1190 such as the Microterm Mime,
1191 this can be given as
1194 Other capabilities to enter various highlighting modes include
1198 (bold or extra bright),
1200 (dim or half-bright),
1202 (blanking or invisible text),
1212 (enter alternate character set mode), and
1214 (exit alternate character set mode).
1215 Turning on any of these modes singly may or may not turn off other modes.
1217 If there is a sequence to set arbitrary combinations of mode,
1218 this should be given as
1220 (set attributes), taking 9 parameters.
1221 Each parameter is either 0 or 1,
1222 as the corresponding attributes is on or off.
1223 The 9 parameters are, in order: standout, underline, reverse, blink,
1224 dim, bold, blank, protect, and alternate character set.
1225 Not all modes need be supported by
1227 only those for which corresponding attribute commands exist.
1228 (It is unlikely that a
1229 .BR termcap\^ -using
1230 program will support this capability, which is defined for compatibility
1234 Terminals with the \*(lqmagic cookie\*(rq glitches
1238 rather than maintaining extra attribute bits for each character cell,
1239 instead deposit special \*(lqcookies\*(rq,
1240 or \*(lqgarbage characters\*(rq,
1241 when they receive mode-setting sequences,
1242 which affect the display algorithm.
1245 such as the Hewlett-Packard 2621,
1246 automatically leave standout
1247 mode when they move to a new line or when the cursor is addressed.
1248 Programs using standout mode
1249 should exit standout mode on such terminals
1250 before moving the cursor or sending a newline.
1251 On terminals where this is not a problem,
1254 capability should be present
1255 to say that this overhead is unnecessary.
1258 a way of flashing the screen to indicate an error quietly
1259 (a bell replacement),
1260 this can be given as
1262 it must not move the cursor.
1264 If the cursor needs to be made more visible than normal
1265 when it is not on the bottom line
1266 (to change, for example, a non-blinking underline into an easier-to-find
1267 block or blinking underline),
1268 give this sequence as
1270 If there is a way to make the cursor completely invisible, give that as
1274 which undoes the effects of both of these modes,
1275 should also be given.
1277 If your terminal correctly displays underlined characters
1278 (with no special codes needed)
1279 even though it does not overstrike,
1280 then you should give the capability
1282 If overstrikes are erasable with a blank,
1283 this should be indicated by giving
1290 If the terminal has a keypad that transmits codes when the keys are pressed,
1291 this information can be given.
1292 Note that it is not possible to handle
1293 terminals where the keypad only works in local mode
1294 (this applies, for example, to the unshifted Hewlett-Packard 2621 keys).
1295 If the keypad can be set to transmit or not transmit,
1300 Otherwise the keypad is assumed to always transmit.
1301 The codes sent by the left-arrow, right-arrow, up-arrow, down-arrow,
1302 and home keys can be given as
1310 If there are function keys such as f0, f1, ..., f9, the codes they send
1315 If these keys have labels other than the default f0 through f9, the labels
1320 The codes transmitted by certain other special keys can be given:
1328 (clear the tab stop in this column),
1330 (clear screen or erase),
1338 (clear to end of line),
1340 (clear to end of screen),
1342 (insert character or enter insert mode),
1350 (scroll forward/down),
1352 (scroll backward/up), and
1354 (set a tab stop in this column).
1355 In addition, if the keypad has a 3 by 3 array of keys
1356 including the four arrow keys, then the other five keys can be given as
1363 These keys are useful when the effects of a 3 by 3 directional pad are needed.
1366 capability formerly used to describe \*(lqother\*(rq function keys has been
1367 completely supplanted by the above capabilities.
1371 entry is also used to indicate arrow keys on terminals that have
1372 single-character arrow keys.
1373 It is obsolete but still in use in
1376 which must be run on some minicomputers due to
1378 This field is redundant with
1385 It consists of groups of two characters.
1386 In each group, the first character is what an arrow key sends, and the
1387 second character is the corresponding
1407 For example, the Mime would have \*(lqma=^Hh^Kj^Zk^Xl\*(rq
1408 indicating arrow keys left (^H), down (^K), up (^Z), and right (^X).
1409 (There is no home key on the Mime.)
1413 .B Tabs and Initialization
1415 If the terminal needs to be in a special mode when running
1416 a program that uses these capabilities,
1417 the codes to enter and exit this mode can be given as
1421 This arises, for example, from terminals like the Concept with more than
1423 If the terminal has only memory-relative cursor addressing and not
1424 screen-relative cursor addressing,
1425 a screen-sized window must be fixed into
1426 the display for cursor addressing to work properly.
1427 This is also used for the Tektronix 4025, where
1429 sets the command character to be the one used by
1435 an initialization string for the terminal,
1438 the name of a file containing long initialization strings.
1439 These strings are expected to set the terminal into modes
1440 consistent with the rest of the
1443 They are normally sent to the terminal by the
1445 program each time the user logs in.
1446 They will be printed in the following order:
1459 and runs the program
1463 after the other initializations.)
1464 A pair of sequences that does a harder reset from a totally unknown state
1465 can be analogously given as
1469 These strings are output by the
1471 program, which is used when the terminal gets into a wedged state.
1477 Commands are normally placed in
1481 only if they produce annoying effects on the screen and are not necessary
1483 For example, the command to set the VT100 into 80-column mode
1484 would normally be part of
1486 but it causes an annoying glitch of the screen and is not normally needed
1487 since the terminal is usually already in 80-column mode.
1489 If the terminal has hardware tabs,
1490 the command to advance to the next tab stop can be given as
1494 A \*(lqbacktab\*(rq command which moves leftward to the previous tab stop
1498 if the terminal driver modes indicate that tab stops are being expanded
1499 by the computer rather than being sent to the terminal,
1500 programs should not use
1504 even if they are present,
1505 since the user may not have the tab stops properly set.
1506 If the terminal has hardware tabs that are initially set every
1508 positions when the terminal is powered up, then the numeric parameter
1510 is given, showing the number of positions between tab stops.
1511 This is normally used by the
1513 command to determine whether to set the driver mode for hardware tab
1514 expansion, and whether to set the tab stops.
1515 If the terminal has tab stops that can be saved in nonvolatile memory, the
1517 description can assume that they are properly set.
1519 If there are commands to set and clear tab stops, they can be given as
1521 (clear all tab stops) and
1523 (set a tab stop in the current column of every row).
1524 If a more complex sequence is needed to set the tabs than can be
1525 described by this, the sequence can be placed in
1534 Certain capabilities control padding in the terminal driver.
1535 These are primarily needed by hardcopy terminals and are used by the
1537 program to set terminal driver modes appropriately.
1538 Delays embedded in the capabilities
1545 will cause the appropriate delay bits to be set in the terminal driver.
1548 (padding baud rate) is given, these values can be ignored at baud rates
1553 the delays are given as numeric capabilities
1566 If the terminal requires other than a \s-2NUL\s0 (zero) character as a pad,
1567 this can be given as
1569 Only the first character of the
1573 If the terminal has commands to save and restore the position of the
1574 cursor, give them as
1579 If the terminal has an extra \*(lqstatus line\*(rq that is not normally used by
1580 software, this fact can be indicated.
1581 If the status line is viewed as an extra line below the bottom line,
1585 Special strings to go to a position in the status line and to return
1586 from the status line can be given as
1591 must leave the cursor position in the same place that it was before
1597 strings can be included in
1601 to get this effect.)
1604 takes one parameter, which is the column number of the status line
1605 to which the cursor is to be moved.
1606 If escape sequences and other special commands such as tab work while in
1607 the status line, the flag
1610 A string that turns off the status line (or otherwise erases its contents)
1613 The status line is normally assumed to be the same width as the
1617 If the status line is a different width (possibly because the terminal
1618 does not allow an entire line to be loaded), then its width in columns
1619 can be indicated with the numeric parameter
1622 If the terminal can move up or down half a line, this can be
1628 This is primarily useful for superscripts and subscripts on hardcopy
1630 If a hardcopy terminal can eject to the next page (form feed),
1636 If 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),
1638 this can be indicated with the parameterized string
1640 The first parameter is the character to be repeated and the second is
1641 the number of times to repeat it.
1644 feature that is unlikely to be supported by a program that uses
1647 If the terminal has a settable command character, such as the
1648 Tektronix 4025, this can be indicated with
1650 A prototype command character is chosen which is used in all capabilities.
1651 This character is given in the
1653 capability to identify it.
1654 The following convention is supported on some UNIX systems:
1655 The environment is to be searched for a
1660 all occurrences of the prototype character are replaced by the character
1661 in the environment variable.
1665 environment variable
1666 is a very bad idea, as it conflicts with
1669 Terminal descriptions that do not represent a specific kind of known
1678 (generic) capability so that programs can complain that they do not know
1679 how to talk to the terminal.
1680 (This capability does not apply to
1682 terminal descriptions for which the escape sequences are known.)
1684 If the terminal uses xoff/xon (\s-2DC3\s0/\s-2DC1\s0)
1685 handshaking for flow control, give
1687 Padding information should still be included so that routines can make
1688 better decisions about costs, but actual pad characters will not be
1691 If the terminal has a \*(lqmeta key\*(rq which acts as a shift key, setting the
1692 8th bit of any character transmitted, then this fact can be indicated with
1694 Otherwise, software will assume that the 8th bit is parity and it will
1696 If strings exist to turn this \*(lqmeta mode\*(rq on and off, they can be given as
1701 If the terminal has more lines of memory than will fit on the screen at once,
1702 the number of lines of memory can be indicated with
1704 An explicit value of 0 indicates that the number of lines is not fixed,
1705 but that there is still more memory than fits on the screen.
1707 If the terminal is one of those supported by the UNIX system virtual
1708 terminal protocol, the terminal number can be given as
1711 Media copy strings which control an auxiliary printer
1712 connected to the terminal can be given as
1714 print the contents of the screen;
1716 turn off the printer; and
1718 turn on the printer.
1719 When the printer is on, all text sent to the terminal will be sent to the
1721 It is undefined whether the text is also displayed on the terminal screen
1722 when the printer is on.
1725 takes one parameter and leaves the printer on for as many characters as the
1726 value of the parameter, then turns the printer off.
1727 The parameter should not exceed 255.
1730 is transparently passed to the printer while
1734 Strings to program function keys can be given as
1739 Each of these strings takes two parameters: the function key number
1740 to program (from 0 to 9) and the string to program it with.
1741 Function key numbers out of this range may program undefined keys
1742 in a terminal-dependent manner.
1743 The differences among the capabilities are that
1745 causes pressing the given key to be the same as the user typing the given
1748 causes the string to be executed by the terminal in local mode;
1751 causes the string to be transmitted to the computer.
1752 Unfortunately, due to lack of a definition for string parameters in
1756 supports these capabilities.
1760 .B Glitches and Braindamage
1762 Hazeltine terminals, which do not allow `~' characters to be displayed,
1768 capability, now obsolete, formerly indicated Datamedia terminals,
1772 carriage return then ignore a following linefeed.
1774 Terminals that ignore a linefeed immediately after an
1776 wrap, such as the Concept, should indicate
1781 is required to get rid of standout
1782 (instead of merely writing normal text on top of it),
1786 Teleray terminals, where tabs turn all characters moved over to blanks,
1790 This glitch is also taken to mean that it is not possible
1791 to position the cursor on top of a \*(lqmagic cookie\*(rq, and that
1792 to erase standout mode it is necessary to use delete and insert line.
1794 The Beehive Superbee, which is unable to correctly transmit the
1795 \s-2ESC\s0 or ^C characters, has
1797 indicating 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.)
1800 Other specific terminal problems may be corrected by adding more
1801 capabilities of the form \fBx\fIx\^\fP.
1805 .B Similar Terminals
1807 If there are two very similar terminals,
1808 one can be defined as being just like the other with certain exceptions.
1809 The string capability
1812 with the name of the similar terminal.
1813 This capability must be
1815 and the combined length of the entries
1816 must not exceed 1024.
1817 The capabilities given before
1819 override those in the terminal type invoked by
1821 A capability can be canceled by placing
1828 For example, the entry
1830 hn\||\|2621\-nl:ks@:ke@:tc=2621:
1832 defines a \*(lq2621\-nl\*(rq that does not have the
1837 hence does not turn on the function key labels when in visual mode.
1838 This is useful for different modes for a terminal, or for different
1843 Mark Horton added underlining and keypad support
1847 file containing terminal descriptions
1849 file containing more terminal descriptions (Minix-vmd)
1855 .SH "CAVEATS AND BUGS"
1856 Lines and columns are now stored by the kernel as well as in the termcap
1858 Most programs now use the kernel information primarily; the information
1859 in this file is used only if the kernel does not have any information.
1861 Not all programs support all entries.
1865 does not understand everything described here, unlike the one Minix-vmd uses.