TERMCAP(5) TERMCAP(5) NAME termcap - terminal capability file DESCRIPTION Termcap describes terminals as used, for example, by vi(1) and curses(3) or in the TERMCAP environment variable. A termcap entry is a line containing fields separated by `:'. Lines may be broken; `\' at the end of a line signifies con- tinuation. Empty fields are ignored. The first field for each entry gives names for a terminal separated by `|'. The first name is conventionally two characters long for the benefit of older systems; the second name is the customary abbreviation; and the last name fully identifies the terminal. There are three types of capability: Boolean for the pres- ence of a feature, numeric for sizes and time delays, and strings for performing operations. Some string fields may be preceded by a number, which specifies padding, a time delay required with the operation. These capabilities are marked `P' or `P*' below. Padding is measured in millisec- onds; P* signifies that the padding is proportional to the number of lines (or characters) affected, for example, `3.5*' specifies 3.5 milliseconds per unit. Name Type Pad Description ae str P End alternate character set al str P* Add new blank line am bool Automatic margin as str P Start alternate character set bc str Backspace char if not ^H bs bool Terminal can backspace bt str P Back tab bw bool Backspace wraps from column 0 to last column CC str Command character in prototype if terminal settable cd str P* Clear to end of display ce str P Clear to end of line ch str P Like cm but horizontal motion only cl str P* Clear screen cm str P Cursor motion co num Number of columns cr str P* Carriage return, default ^M cs str P Change scrolling region (vt100), like cm cv str P Like ch, but vertical only da bool Display may be retained above dB num Backspace delay db bool Display may be retained below dC num Carriage return delay dc str P* Delete character TERMCAP(5) TERMCAP(5) dF num Form feed delay dl str P* Delete line dm str Enter delete mode dN num Newline delay do str Down one line dT num tab delay ed str End delete mode ei str End insert mode; give :ei=: if ic eo str Can erase overstrikes with blank ff str P* Hard copy page eject, default ^L hc bool Hardcopy terminal hd str Half line down ho str Home cursor if no cm hu str Half line up hz str Hazeltine, can't print ~ ic str P Insert character if str Name of file containing initializationis im bool Enter insert mode; give :im=: if ic in bool Insert mode distinguishes nulls on display ip str P* Insert pad after character insert is str Terminal initialization string k0-k9 str Other function key codes kb str Backspace key code kd str Down arrow key code ke str Leave keypad transmit mode kh str Home key code kl str Left arrow key code kn num Number of function keys ko str Termcap entries for other non-function keys kr str Right arrow key code ks str Enter keypad transmit mode ku str Up arrow key code l0-9 str Labels on other function keys li num Number of lines on screen or page ll str Last line, first column, if no cm ma str Arrow key map mi bool Safe to move in insert mode ml str Memory lock above cursor ms bool Safe to move in standout or underline mode mu str Turn off memory lock nc bool No correctly working CR (DM2500, H2000) nd str Nondestructive space (cursor right) nl str P* Newline character, default \n ns bool Nonscrolling CRT os bool Terminal overstrikes pc str Pad character, default NUL pt bool Has hardware tabs (possibly set by is) se str Leave standout mode sf str P Scroll forward sg num Number of blanks left by so, se so str Enter standout mode sr str P Scroll reverse (backward) TERMCAP(5) TERMCAP(5) ta str P Tab, if not ^I or if padded tc str Entry of similar terminal, must be last te str String to end programs that use cm ti str String to begin programs that use cm uc str Underscore one char and move past it ue str Leave underscore mode ug num Number of blanks left by us, ue ul bool Terminal underlines but doesn't overstrike up str Cursor up one line us str Enter underscore mode vb str Visible bell, (may not move cursor) ve str Leave open/visual mode vs str Enter open/visual mode xb bool Beehive (f1=escape, f2=^C) xn bool Newline ignored after wrap (Concept) xr bool Return acts like ce \r \n (Delta Data) xs bool Standout not erased by writing over (HP264?) xt bool Tabs are destructive, magic so (Teleray 1061) The following example is one of the more elaborate termcap entries. (Do not believe it; see the file for current facts.) co|c100|concept 100:is=\EU\Ef\E7\E5\E8\El\ENH\EK\E\200\Eo&\200\Eo\47\E:\ :al=3*\E^R:am:bs:cd=16*\E^C:ce=16\E^S:cl=2*^L:cm=\Ea%+ %+ :co#80:\ :dc=16\E^A:dl=3*\E^B:ei=\E\200:eo:im=\E^P:in:ip=16*:li#24:mi:\ :nd=\E=:se=\Ed\E:so=\ED\EE:ta=8\t:ul:up=\E;vb=\Ek\Ek:xn: Among the Boolean capabilities shown for the Concept are automatic margins `am': automatic return and linefeed at the end of a line. Numeric capabilities are indicated by `#'; `co#80' means the Concept has 80 columns. String capabili- ties are indicated by `='; to clear to end of line (`ce') on the Concept, issue <escape> <control-C> and pad with 16 mil- liseconds delay. In strings the ASCII ESC character is represented by `\E' and control characters are represented by ^c, where charac- ter c has ASCII code 0100 greater than the desired control character. Newline, return, tab, backspace, form feed, \ and ^ are represented by \n \r \t \b \f \\ \^. Backslash `\' followed by 3 digits specifies a byte in octal. A null character is encoded `\200': the routines that use termcap information mask out the high bit of all bytes. Local cursor motions are undefined if they run off the left or top of the screen; the curses routines refrain from issu- ing such motions. It is assumed that the screen will scroll up upon running off the bottom; this assumption is negated by `ns'. Capability `am' (automatic margin) describes the handling of the right margin. TERMCAP(5) TERMCAP(5) Cursor addressing is described by capability `cm', which contains printf(3)-like format codes for line and column positions. The leftmost column is column 0. %d as in printf %2 like %2d %3 like %3d %. like %c %+x adds x before converting %>xy if value exceeds x, add y, no output %r reverse order of line and column, no output %i increment line/column (1-origin) %% single % %n exclusive or row and column with 0140 (DM2500) %B BCD: 16*(x/10) + (x%10), no output %D Reverse coding: x-2*(x%16), no output For example, to go to line 3 column 12, a HP2645 terminal must get \E&a12c03Y padded for 6 milliseconds: `:cm=6\E&%r%2c%2Y: .' Capability `al' adds an empty line before the line where the cursor is and leaves the cursor on the new line. This will always be done with the cursor at column 0. Capability `dl' deletes the line where the cursor is and is also done with the cursor at column 0. Capabilities `da' and `db' warn that off-screen lines may appear at the top or bottom of the screen upon scrolling or deleting lines. The curses rou- tines do not use this feature, but do guard against its effects. Insert-character operations usually affect only the current line and shift characters off the end of the line rigidly. Some terminals, such as the Concept 100, distinguish typed from untyped blanks on the screen, shifting upon insertion only up to an untyped blank, i.e. a space caused by cursor motion; these terminals have capability `in' (insert null). Some terminals have an insertion mode; others require a spe- cial sequence to open up a blank position on the current line. Insertion mode is entered and left by `im' and `ie', which should be null strings if there is no insertion mode. String `ic' is sent just before each character to be inserted, and padding `ip' is sent after. Capability `mi' says it is possible to move around without leaving insertion mode. Delete mode works similarly: enter with `dm', leave with `de', and issue `dc' before each character. Highlighting, or `standout' mode is entered by `so' and left by `se'. Underline mode is entered by `us' and left by `ue'. Terminals that underline characters individually have capability `uc'. The visual bell capability `vb' flashes TERMCAP(5) TERMCAP(5) the screen without moving the cursor. A terminal with a keypad that transmits cursor motions may be described by capabilities kl kr ku kd kh that give the codes for left, right, up, down, and home. Up to ten func- tion keys may be described by `k0' through `k9'. Special labels for the function keys may be given as `l0' through `l9'. The initialization string `is' is expected to set tabs if that is necessary. That string may come from a file (`if'); if both are present `is' is done first. The entry for a terminal may be continued by jumping to another entry given by `tc'. Duplicate capabilities are resolved in favor of the first. FILES SEE ALSO curses(3), termcap(3), vi(1), ul(1) BUGS Termcap entries, including `tc' continuations, are limited to 1024 characters.