.\" $OpenBSD: termcap.5,v 1.27 2013/08/08 14:36:34 millert Exp $ .\" .\" Copyright (c) 1985, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" from: @(#)termcap.5 6.11 (Berkeley) 3/6/93 .\" .Dd $Mdocdate: August 8 2013 $ .Dt TERMCAP 5 .Os .Sh NAME .Nm termcap .Nd terminal capability database .Sh SYNOPSIS .Nm termcap .Sh DESCRIPTION The .Nm file is a database describing terminals, used, for example, by .Xr \&vi 1 and .Xr curses 3 . Terminals are described in .Nm by giving a set of capabilities that they have and by describing how operations are performed. Padding requirements and initialization sequences are included in .Nm . .Pp Entries in .Nm consist of a number of `:'-separated fields. The first entry for each terminal gives the names that are known for the terminal, separated by `|' characters. The first name given is the most common abbreviation for the terminal. The last name given should be a long name fully identifying the terminal, and all others are understood as synonyms for the terminal name. All names but the last should be in lower case and contain no blanks; the last name may well contain upper case characters and blanks for readability. .Pp Terminal names (except for the last, verbose entry) should be chosen using the following conventions. The particular piece of hardware making up the terminal should have a root name chosen, thus .Dq hp2621 This name should not contain hyphens. Modes that the hardware can be in or user preferences should be indicated by appending a hyphen and an indicator of the mode. Therefore, a .Dq vt100 in 132-column mode would be .Dq vt100-w . .Pp The following suffixes should be used where possible: .Bl -column "Suffix" "With automatic margins (usually default)" "Example" .It Sy Suffix Ta Sy Meaning Ta Sy Example .It \-w Ta "Wide mode (more than 80 columns)." Ta vt100-w .It \-am Ta "With automatic margins (usually default)." Ta vt100-am .It \-nam Ta "Without automatic margins." Ta vt100-nam .It Pf \- Ar n Ta "Number of lines on screen." Ta aaa-60 .It \-na Ta "arrow keys (leave them in local)." Ta concept100-na .It Pf \- Ar np Ta "Number of pages of memory." Ta concept100-4p .It \-rv Ta "Reverse video." Ta concept100-rv .El .Sh CAPABILITIES The characters in the .Em Notes function field in the table have the following meanings (more than one may apply to a capability): .Bd -unfilled N Indicates numeric parameter(s). P Indicates that padding may be specified. * Indicates that padding may be based on the number of lines affected. o Indicates capability is obsolete. .Ed .Pp .Dq Obsolete capabilities have no .Em terminfo equivalents, since they were considered useless, or are subsumed by other capabilities. New software should not rely on them at all. .Bl -column "i1-i3" "Type" "(NP*)" "Description" .It Sy Name Ta Sy Type Ta Sy Notes Ta Sy Description .It ae Ta str Ta (P) Ta "End alternate character set." .It AL Ta str Ta (NP*) Ta "Add" .Em n new blank lines .It al Ta str Ta (P*) Ta "Add new blank line." .It am Ta bool Ta "" Ta "Terminal has automatic margins." .It as Ta str Ta (P) Ta "Start alternate character set." .It bc Ta str Ta (o) Ta "Backspace if not" .Sy \&^H . .It bl Ta str Ta (P) Ta "Audible signal (bell)." .It bs Ta bool Ta (o) Ta "Terminal can backspace with" .Sy \&^H . .It bt Ta str Ta (P) Ta "Back tab." .It bw Ta bool Ta "" Ta Sy \&le (backspace) wraps from column 0 to last column. .It CC Ta str Ta "" Ta "Terminal settable command character in prototype." .It cd Ta str Ta (P*) Ta "Clear to end of display." .It ce Ta str Ta (P) Ta "Clear to end of line." .It ch Ta str Ta (NP) Ta "Set cursor column (horizontal position)." .It cl Ta str Ta (P*) Ta "Clear screen and home cursor." .It CM Ta str Ta (NP) Ta "Memory-relative cursor addressing." .It cm Ta str Ta (NP) Ta "Screen-relative cursor motion." .It co Ta num Ta "" Ta "Number of columns in a line (see" .Sx BUGS section below). .It cr Ta str Ta (P) Ta "Carriage return." .It cs Ta str Ta (NP) Ta "Change scrolling region (VT100)." .It ct Ta str Ta (P) Ta "Clear all tab stops." .It cv Ta str Ta (NP) Ta "Set cursor row (vertical position)." .It da Ta bool Ta "" Ta "Display may be retained above the screen." .It dB Ta num Ta (o) Ta "Milliseconds" .Sy \&bs delay needed (default 0). .It db Ta bool Ta "" Ta "Display may be retained below the screen." .It DC Ta str Ta (NP*) Ta "Delete" .Em n characters. .It dC Ta num Ta (o) Ta "Milliseconds" .Sy \&cr delay needed (default 0). .It dc Ta str Ta (P*) Ta "Delete character." .It dF Ta num Ta (o) Ta "Milliseconds" .Sy \&ff delay needed (default 0). .It DL Ta str Ta (NP*) Ta "Delete" .Ar n lines. .It dl Ta str Ta (P*) Ta "Delete line." .It dm Ta str Ta "" Ta "Enter delete mode." .It dN Ta num Ta (o) Ta "Milliseconds" .Sy \&nl delay needed (default 0). .It DO Ta str Ta (NP*) Ta "Move cursor down" .Ar n lines. .It do Ta str Ta "" Ta "Down one line." .It ds Ta str Ta "" Ta "Disable status line." .It dT Ta num Ta (o) Ta "Milliseconds of horizontal tab delay needed (default 0)." .It dV Ta num Ta (o) Ta "Milliseconds of vertical tab delay needed (default 0)." .It ec Ta str Ta (NP) Ta "Erase" .Ar n characters. .It ed Ta str Ta "" Ta "End delete mode." .It ei Ta str Ta "" Ta "End insert mode." .It eo Ta bool Ta "" Ta "Can erase overstrikes with a blank." .It EP Ta bool Ta (o) Ta "Even parity." .It es Ta bool Ta "" Ta "Escape can be used on the status line." .It ff Ta str Ta (P*) Ta "Hardcopy terminal page eject." .It fs Ta str Ta "" Ta "Return from status line." .It gn Ta bool Ta "" Ta "Generic line type, for example dialup, switch)." .It hc Ta bool Ta "" Ta "Hardcopy terminal." .It HD Ta bool Ta (o) Ta "Half-duplex." .It hd Ta str Ta "" Ta "Half-line down (forward 1/2 linefeed)." .It ho Ta str Ta (P) Ta "Home cursor." .It hs Ta bool Ta "" Ta "Has extra" .Dq status line . .It hu Ta str Ta "" Ta "Half-line up (reverse 1/2 linefeed)." .It hz Ta bool Ta "" Ta "Cannot print ``~'' (Hazeltine)." .It i1-i3 Ta str Ta "" Ta "Terminal initialization strings" .Pf ( Xr terminfo only) .It IC Ta str Ta (NP*) Ta "Insert" .Ar n blank characters. .It ic Ta str Ta (P*) Ta "Insert character." .It if Ta str Ta "" Ta "Name of file containing initialization string." .It im Ta str Ta "" Ta "Enter insert mode." .It in Ta bool Ta "" Ta "Insert mode distinguishes nulls." .It iP Ta str Ta "" Ta "Pathname of program for initialization" .Pf ( Xr terminfo only). .It ip Ta str Ta (P*) Ta "Insert pad after character inserted." .It is Ta str Ta "" Ta "Terminal initialization string" .Pf ( Nm termcap only). .It it Ta num Ta "" Ta "Tabs initially every" .Ar n positions. .It K1 Ta str Ta "" Ta "Sent by keypad upper left." .It K2 Ta str Ta "" Ta "Sent by keypad center." .It K3 Ta str Ta "" Ta "Sent by keypad upper right." .It K4 Ta str Ta "" Ta "Sent by keypad lower left." .It K5 Ta str Ta "" Ta "Sent by keypad lower right." .It k0-k9 Ta str Ta "" Ta "Sent by function keys 0-9." .It kA Ta str Ta "" Ta "Sent by insert-line key." .It ka Ta str Ta "" Ta "Sent by clear-all-tabs key." .It kb Ta str Ta "" Ta "Sent by backspace key." .It kC Ta str Ta "" Ta "Sent by clear-screen or erase key." .It kD Ta str Ta "" Ta "Sent by delete-character key." .It kd Ta str Ta "" Ta "Sent by down-arrow key." .It kE Ta str Ta "" Ta "Sent by clear-to-end-of-line key." .It ke Ta str Ta "" Ta "Out of" .Dq keypad transmit mode. .It kF Ta str Ta "" Ta "Sent by scroll-forward/down key." .It kH Ta str Ta "" Ta "Sent by home-down key." .It kh Ta str Ta "" Ta "Sent by home key." .It kI Ta str Ta "" Ta "Sent by insert-character or enter-insert-mode key." .It kL Ta str Ta "" Ta "Sent by delete-line key." .It kl Ta str Ta "" Ta "Sent by left-arrow key." .It kM Ta str Ta "" Ta "Sent by insert key while in insert mode." .It km Ta bool Ta "" Ta "Has a" .Dq meta key (shift, sets parity bit). .It kN Ta str Ta "" Ta "Sent by next-page key." .It kn Ta num Ta (o) Ta "Number of function" .Pq Sy \&k\&0 Ns \- Ns Sy \&k\&9 keys (default 0). .It ko Ta str Ta (o) Ta "Termcap entries for other non-function keys." .It kP Ta str Ta "" Ta "Sent by previous-page key." .It kR Ta str Ta "" Ta "Sent by scroll-backward/up key." .It kr Ta str Ta "" Ta "Sent by right-arrow key." .It kS Ta str Ta "" Ta "Sent by clear-to-end-of-screen key." .It ks Ta str Ta "" Ta "Put terminal in" .Dq keypad transmit mode. .It kT Ta str Ta "" Ta "Sent by set-tab key." .It kt Ta str Ta "" Ta "Sent by clear-tab key." .It ku Ta str Ta "" Ta "Sent by up-arrow key." .It l0-l9 Ta str Ta "" Ta "Labels on function keys if not" .Dq \&f Ns Em n . .It LC Ta bool Ta (o) Ta "Lower-case only." .It LE Ta str Ta (NP) Ta "Move cursor left" .Ar n positions. .It le Ta str Ta (P) Ta "Move cursor left one position." .It li Ta num Ta "" Ta "Number of lines on screen or page (see" .Sx BUGS section below). .It ll Ta str Ta "" Ta "Last line, first column." .It lm Ta num Ta "" Ta "Lines of memory if >" Sy \&li (0 means varies). .It ma Ta str Ta (o) Ta "Arrow key map (used by" .Xr \&vi 1 version 2 only). .It mb Ta str Ta "" Ta "Turn on blinking attribute." .It md Ta str Ta "" Ta "Turn on bold (extra bright) attribute." .It me Ta str Ta "" Ta "Turn off all attributes." .It mh Ta str Ta "" Ta "Turn on half-bright attribute." .It mi Ta bool Ta "" Ta "Safe to move while in insert mode." .It mk Ta str Ta "" Ta "Turn on blank attribute (characters invisible)." .It ml Ta str Ta (o) Ta "Memory lock on above cursor." .It mm Ta str Ta "" Ta "Turn on" .Dq meta mode (8th bit). .It mo Ta str Ta "" Ta "Turn off" .Dq meta mode . .It mp Ta str Ta "" Ta "Turn on protected attribute." .It mr Ta str Ta "" Ta "Turn on reverse-video attribute." .It ms Ta bool Ta "" Ta "Safe to move in standout modes." .It mu Ta str Ta (o) Ta "Memory unlock (turn off memory lock)." .It nc Ta bool Ta (o) Ta "No correctly-working" .Sy \&cr (Datamedia 2500, Hazeltine 2000). .It nd Ta str Ta "" Ta "Non-destructive space (cursor right)." .It NL Ta bool Ta (o)" Ta Sy \&\en No "is newline, not line feed." .It nl Ta str Ta (o) Ta "Newline character if not" Sy \en . .It ns Ta bool Ta (o) Ta "Terminal doesn't scroll." .It nw Ta str Ta (P) Ta "Newline (behaves like" .Sy \&cr followed by .Sy \&do ) . .It OP Ta bool Ta (o) Ta "Odd parity." .It os Ta bool Ta "" Ta "Terminal overstrikes." .It pb Ta num Ta "" Ta "Lowest baud where delays are required." .It pc Ta str Ta "" Ta "Pad character (default NUL)." .It pf Ta str Ta "" Ta "Turn off the printer." .It pk Ta str Ta "" Ta "Program function key" .Em n to type string .Em s .Pf ( Xr terminfo only). .It pl Ta str Ta "" Ta "Program function key" .Em n to execute string .Em s .Pf ( Xr terminfo only). .It pO Ta str Ta (N) Ta "Turn on the printer for" .Em n bytes. .It po Ta str Ta "" Ta "Turn on the printer." .It ps Ta str Ta "" Ta "Print contents of the screen." .It pt Ta bool Ta (o) Ta "Has hardware tabs (may need to be set with" .Sy \&is ) . .It px Ta str Ta "" Ta "Program function key" .Em n to transmit string .Em s .Pf ( Xr terminfo only). .It r1-r3 Ta str Ta "" Ta "Reset terminal completely to sane modes" .Pf ( Xr terminfo only). .It rc Ta str Ta (P) Ta "Restore cursor to position of last" .Sy \&sc . .It rf Ta str Ta "" Ta "Name of file containing reset codes." .It RI Ta str Ta (NP) Ta "Move cursor right" .Em n positions. .It rp Ta str Ta (NP*) Ta "Repeat character" .Em c n times. .It rs Ta str Ta "" Ta "Reset terminal completely to sane modes" .Pf ( Nm termcap only). .It sa Ta str Ta (NP) Ta "Define the video attributes." .It sc Ta str Ta (P) Ta "Save cursor position." .It se Ta str Ta "" Ta "End standout mode." .It SF Ta str Ta (NP*) Ta "Scroll forward" .Em n lines. .It sf Ta str Ta (P) Ta "Scroll text up." .It sg Ta num Ta "" Ta "Number of garbage chars left by" .Sy \&so or .Sy \&se (default 0). .It so Ta str Ta "" Ta "Begin standout mode." .It SR Ta str Ta (NP*) Ta "Scroll backward" .Em n lines. .It sr Ta str Ta (P) Ta "Scroll text down." .It st Ta str Ta "" Ta "Set a tab in all rows, current column." .It ta Ta str Ta (P) Ta "Tab to next 8-position hardware tab stop." .It tc Ta str Ta "" Ta "Entry of similar terminal; must be last." .It te Ta str Ta "" Ta "String to end programs that use" .Nm . .It ti Ta str Ta "" Ta "String to begin programs that use" .Nm . .It ts Ta str Ta (N) Ta "Go to status line, column" .Em n . .It UC Ta bool Ta (o) Ta "Upper-case only." .It uc Ta str Ta "" Ta "Underscore one character and move past it." .It ue Ta str Ta "" Ta "End underscore mode." .It ug Ta num Ta "" Ta "Number of garbage chars left by" .Sy \&us or .Sy \&ue (default 0). .It ul Ta bool Ta "" Ta "Underline character overstrikes." .It UP Ta str Ta (NP*) Ta "Move cursor up" .Em n lines. .It up Ta str Ta "" Ta "Upline (cursor up)." .It us Ta str Ta "" Ta "Start underscore mode." .It vb Ta str Ta "" Ta "Visible bell (must not move cursor)." .It ve Ta str Ta "" Ta "Make cursor appear normal (undo" .Sy \&vs Ns / Ns Sy \&vi ) . .It vi Ta str Ta "" Ta "Make cursor invisible." .It vs Ta str Ta "" Ta "Make cursor very visible." .It vt Ta num Ta "" Ta "Virtual terminal number (not supported on all systems)." .It wi Ta str Ta (N) Ta "Set current window." .It ws Ta num Ta "" Ta "Number of columns in status line." .It xb Ta bool Ta "" Ta "Beehive" .Pf ( "f1=" Dv ESC , .Pf "f2=" Sy \&^C ) . .It xn Ta bool Ta "" Ta "Newline ignored after 80 columns (Concept)." .It xo Ta bool Ta "" Ta "Terminal uses xoff/xon" .Pq Dv DC3 Ns / Ns Dv DC1 handshaking. .It xr Ta bool Ta (o) Ta "Return acts like" .Sy "ce cr nl" (Delta Data). .It xs Ta bool Ta "" Ta "Standout not erased by overwriting (Hewlett-Packard)." .It xt Ta bool Ta "" Ta "Tabs ruin, magic" .Sy \&so char (Teleray 1061). .It xx Ta bool Ta (o) Ta "Tektronix 4025 insert-line." .El .Ss A Sample Entry The following entry, which describes the Concept\-100, is among the more complex entries in the .Nm file as of this writing. .Bd -literal ca\||\|concept100\||\|c100\||\|concept\||\|c104\||\|concept100-4p\||\|HDS Concept\-100:\e :al=3*\eE^R:am:bl=^G:cd=16*\eE^C:ce=16\eE^U:cl=2*^L:cm=\eEa%+ %+ :\e :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 :ip=16*:is=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200\eEo\e47\eE:k1=\eE5:\e :k2=\eE6:k3=\eE7:kb=^h:kd=\eE<:ke=\eEx:kh=\eE?:kl=\eE>:kr=\eE=:ks=\eEX:\e :ku=\eE;:le=^H:li#24:mb=\eEC:me=\eEN\e200:mh=\eEE:mi:mk=\eEH:mp=\eEI:\e :mr=\eED:nd=\eE=:pb#9600:rp=0.2*\eEr%.%+ :se=\eEd\eEe:sf=^J:so=\eEE\eED:\e :.ta=8\et:te=\eEv \e200\e200\e200\e200\e200\e200\eEp\er\en:\e :ti=\eEU\eEv 8p\eEp\er:ue=\eEg:ul:up=\eE;:us=\eEG:\e :vb=\eEk\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\eEK:\e :ve=\eEw:vs=\eEW:vt#8:xn:\e :bs:cr=^M:dC#9:dT#8:nl=^J:ta=^I:pt: .Ed .Pp Entries may continue onto multiple lines by giving a .Ql \e as the last character of a line, and empty fields may be included for readability (here between the last field on a line and the first field on the next). Comments may be included on lines beginning with .Ql # . .Ss Types of Capabilities Capabilities in .Nm are of three types: Boolean capabilities, which indicate particular features that the terminal has; numeric capabilities, giving the size of the display or the size of other attributes; and string capabilities, which give character sequences that can be used to perform particular terminal operations. All capabilities have two-letter codes. For instance, the fact that the Concept has .Em automatic margins (an automatic return and linefeed when the end of a line is reached) is indicated by the Boolean capability .Sy \&am . Hence the description of the Concept includes .Sy \&am . .Pp Boolean capabilities are defined by their name, .Sy \&fo . They have no argument. The presence of a boolean capability name sets its value to .Sy \&true . A capability value will be reverted to .Sy \&false , by appending a .Sy \&@ char after the name, such as .Sy \&fo@ . .Pp Numeric capabilities are followed by the character `#' then the value. In the example above .Sy \&co , which indicates the number of columns the display has, gives the value `80' for the Concept. .Pp Finally, string-valued capabilities, such as .Sy \&ce (clear-to-end-of-line sequence) are given by the two-letter code, an `=', then a string ending at the next following `:'. A delay in milliseconds may appear after the `=' in such a capability, which causes padding characters to be supplied by .Xr tputs 3 after the remainder of the string is sent to provide this delay. The delay can be either a number, such as `20', or a number followed by an `*', such as `3*'. An `*' indicates that the padding required is proportional to the number of lines affected by the operation, and the amount given is the per-affected-line padding required. (In the case of insert-character, the factor is still the number of .Em lines affected; this is always 1 unless the terminal has .Sy \&in and the software uses it.) When an `*' is specified, it is sometimes useful to give a delay of the form `3.5' to specify a delay per line to tenths of milliseconds. (Only one decimal place is allowed.) .Pp A number of escape sequences are provided in the string-valued capabilities for easy encoding of control characters there. .Sy \&\eE maps to an .Dv ESC character, .Sy \&^X maps to a control-X for any appropriate X, and the sequences .Sy \&\en .Sy \&\er .Sy \&\et .Sy \&\eb .Sy \&\ef map to linefeed, return, tab, backspace, and formfeed, respectively. Finally, characters may be given as three octal digits after a .Sy \&\e , and the characters .Sy \&^ and .Sy \&\e may be given as .Sy \&\e^ and .Sy \&\e\e . If it is necessary to place a .Sy \&: in a capability it must be escaped in octal as .Sy \&\e072 . If it is necessary to place a .Dv NUL character in a string capability it must be encoded as .Sy \&\e200 . (The routines that deal with .Nm use C strings and strip the high bits of the output very late, so that a .Sy \&\e200 comes out as a .Sy \&\e000 would.) .Pp Sometimes individual capabilities must be commented out. To do this, put a period before the capability name. For example, see the first .Sy \&cr and .Sy \&ta in the example above. .Ss Preparing Descriptions The most effective way to prepare a terminal description is by imitating the description of a similar terminal in .Nm and to build up a description gradually, using partial descriptions with .Xr \&vi 1 to check that they are correct. Be aware that a very unusual terminal may expose deficiencies in the ability of the .Nm file to describe it or bugs in .Xr \&vi 1 . To easily test a new terminal description you are working on you can put it in your home directory in a file called .Pa .termcap and programs will look there before looking in .Pa /usr/share/misc/termcap . You can also set the environment variable .Ev TERMPATH to a list of absolute file pathnames (separated by spaces or colons), one of which contains the description you are working on, and programs will search them in the order listed, and nowhere else. See .Xr termcap 3 . The .Ev TERMCAP environment variable is usually set to the .Nm entry itself to avoid reading files when starting up a program. .Pp To get the padding for insert-line right (if the terminal manufacturer did not document it), a severe test is to use .Xr \&vi 1 to edit .Pa /etc/passwd at 9600 baud, delete roughly 16 lines from the middle of the screen, then hit the `u' key several times quickly. If the display messes up, more padding is usually needed. A similar test can be used for insert-character. .Ss Basic Capabilities The number of columns on each line of the display is given by the .Sy \&co numeric capability. If the display is a terminal, then the number of lines on the screen is given by the .Sy \&li capability. If the display wraps around to the beginning of the next line when the cursor reaches the right margin, then it should have the .Sy \&am capability. If the terminal can clear its screen, the code to do this is given by the .Sy \&cl string capability. If the terminal overstrikes (rather than clearing the position when a character is overwritten), it should have the .Sy \&os capability. If the terminal is a printing terminal, with no soft copy unit, give it both .Sy \&hc and .Sy \&os . .Pf ( Sy \&os applies to storage scope terminals, such as the Tektronix 4010 series, as well as to hard copy and .Tn APL terminals.) If there is a code to move the cursor to the left edge of the current row, give this as .Sy \&cr . (Normally this will be carriage-return, .Sy \&^M . ) If there is a code to produce an audible signal (bell, beep, etc.), give this as .Sy \&bl . .Pp If there is a code (such as backspace) to move the cursor one position to the left, that capability should be given as .Sy \&le . Similarly, codes to move to the right, up, and down should be given as .Sy \&nd , .Sy \&up , and .Sy \&do , respectively. These .Em local cursor motions should not alter the text they pass over; for example, you would not normally use .Dq nd=\ \& unless the terminal has the .Sy \&os capability, because the space would erase the character moved over. .Pp A very important point here is that the local cursor motions encoded in .Nm have undefined behavior at the left and top edges of a terminal. Programs should never attempt to backspace around the left edge, unless .Sy \&bw is given, and never attempt to go up off the top using local cursor motions. .Pp In order to scroll text up, a program goes to the bottom left corner of the screen and sends the .Sy \&sf (index) string. To scroll text down, a program goes to the top left corner of the screen and sends the .Sy \&sr (reverse index) string. The strings .Sy \&sf and .Sy \&sr have undefined behavior when not on their respective corners of the screen. Parameterized versions of the scrolling sequences are .Sy \&SF and .Sy \&SR , which have the same semantics as .Sy \&sf and .Sy \&sr except that they take one parameter and scroll that many lines. They also have undefined behavior except at the appropriate corner of the screen. .Pp The .Sy \&am capability tells whether the cursor sticks at the right edge of the screen when text is output there, but this does not necessarily apply to .Sy \&nd from the last column. Leftward local motion is defined from the left edge only when .Sy \&bw is given; then an .Sy \&le from the left edge will move to the right edge of the previous row. This is useful for drawing a box around the edge of the screen, for example. If the terminal has switch-selectable automatic margins, the .Nm description usually assumes that this feature is on, i.e.\& .Sy \&am . If the terminal has a command that moves to the first column of the next line, that command can be given as .Sy \&nw (newline). It is permissible for this to clear the remainder of the current line, so if the terminal has no correctly working .Tn \&CR and .Tn \&LF it may still be possible to craft a working .Sy \&nw out of one or both of them. .Pp These capabilities suffice to describe hardcopy and .Dq glass-tty terminals. Thus the Teletype model 33 is described as .Bd -literal -offset indent T3\||\|tty33\||\|33\||\|tty\||\|Teletype model 33:\e :bl=^G:co#72:cr=^M:do=^J:hc:os: .Ed .Pp and the Lear Siegler .Tn ADM Ns \-3 is described as .Bd -literal -offset indent l3\||\|adm3\||\|3\||\|LSI ADM-3:\e :am:bl=^G:cl=^Z:co#80:cr=^M:do=^J:le=^H:li#24:sf=^J: .Ed .Ss Parameterized Strings Cursor addressing and other strings requiring parameters are described by a parameterized string capability, with .Xr printf 3 Ns \-like escapes .Sy \&%x in it, while other characters are passed through unchanged. For example, to address the cursor the .Sy \&cm capability is given, using two parameters: the row and column to move to. (Rows and columns are numbered from zero and refer to the physical screen visible to the user, not to any unseen memory. If the terminal has memory-relative cursor addressing, that can be indicated by an analogous .Sy \&CM capability.) .Pp The .Sy \&% encodings have the following meanings: .Pp .Bl -tag -width "%>xy" -compact .It %% output `%' .It %d output value as in .Xr printf 3 %d .It %2 output value as in .Xr printf 3 %2d .It %3 output value as in .Xr printf 3 %3d .It %. output value as in .Xr printf 3 %c .It %+ Ns Em x add .Em x to value, then do %. .It %> Ns Em \&xy if value > .Em x then add .Em y , no output .It %r reverse order of two parameters, no output .It %i increment by one, no output .It %n exclusive-or all parameters with 0140 (Datamedia 2500) .It \&%B BCD (16*(value/10)) + (value%10), no output .It \&%D Reverse coding (value \- 2*(value%16)), no output (Delta Data) .El .Pp Consider the Hewlett-Packard 2645, which, to get to row 3 and column 12, needs to be sent .Dq \eE&a12c03Y padded for 6 milliseconds. Note that the order of the row and column coordinates is reversed here and that the row and column are sent as two-digit integers. Thus its .Sy \&cm capability is .Dq Li cm=6\eE&a%r%2c%2Y . .Pp The Datamedia 2500 needs the current row and column sent encoded in binary using .Dq \&%. . Terminals that use .Dq \&%. need to be able to backspace the cursor .Pq Sy \&le and to move the cursor up one line on the screen .Pq Sy \&up . This is necessary because it is not always safe to transmit .Sy \&\en , .Sy \&^D , and .Sy \&\er , as the system may change or discard them. (Programs using .Nm must set terminal modes so that tabs are not expanded, so .Sy \&\et is safe to send. This turns out to be essential for the Ann Arbor 4080.) .Pp A final example is the Lear Siegler .Tn ADM Ns \-3a , which offsets row and column by a blank character, thus .Dq Li cm=\eE=%+ %+\ \& . .Pp Row or column absolute cursor addressing can be given as single parameter capabilities .Sy \&ch (horizontal position absolute) and .Sy \&cv (vertical position absolute). Sometimes these are shorter than the more general two-parameter sequence (as with the Hewlett-Packard 2645) and can be used in preference to .Sy \&cm . If there are parameterized local motions (e.g., move .Ar n positions to the right) these can be given as .Sy \&DO , .Sy \&LE , .Sy \&RI , and .Sy \&UP with a single parameter indicating how many positions to move. These are primarily useful if the terminal does not have .Sy \&cm , such as the Tektronix 4025. .Ss Cursor Motions If the terminal has a fast way to home the cursor (to the very upper left corner of the screen), this can be given as .Sy \&ho . Similarly, a fast way of getting to the lower left-hand corner can be given as .Sy \&ll ; this may involve going up with .Sy \&up from the home position, but a program should never do this itself (unless .Sy \&ll does), because it can make no assumption about the effect of moving up from the home position. Note that the home position is the same as cursor address (0,0): to the top left corner of the screen, not of memory. (Therefore, the .Dq \eEH sequence on Hewlett-Packard terminals cannot be used for .Sy \&ho . ) .Ss Area Clears If the terminal can clear from the current position to the end of the line, leaving the cursor where it is, this should be given as .Sy \&ce . If the terminal can clear from the current position to the end of the display, this should be given as .Sy \&cd . .Sy \&cd must only be invoked from the first column of a line. (Therefore, it can be simulated by a request to delete a large number of lines, if a true .Sy \&cd is not available.) .Ss Insert/Delete Line If the terminal can open a new blank line before the line containing the cursor, this should be given as .Sy \&al ; this must be invoked only from the first position of a line. The cursor must then appear at the left of the newly blank line. If the terminal can delete the line that the cursor is on, this should be given as .Sy \&dl ; this must only be used from the first position on the line to be deleted. Versions of .Sy \&al and .Sy \&dl which take a single parameter and insert or delete that many lines can be given as .Sy \&AL and .Sy \&DL . If the terminal has a settable scrolling region (like the VT100), the command to set this can be described with the .Sy \&cs capability, which takes two parameters: the top and bottom lines of the scrolling region. The cursor position is, alas, undefined after using this command. It is possible to get the effect of insert or delete line using this command \(em the .Sy \&sc and .Sy \&rc (save and restore cursor) commands are also useful. Inserting lines at the top or bottom of the screen can also be done using .Sy \&sr or .Sy \&sf on many terminals without a true insert/delete line, and is often faster even on terminals with those features. .Pp If the terminal has the ability to define a window as part of memory which all commands affect, it should be given as the parameterized string .Sy \&wi . The four parameters are the starting and ending lines in memory and the starting and ending columns in memory, in that order. (This .Xr terminfo 5 capability is described for completeness. It is unlikely that any .Nm Ns -using program will support it.) .Pp If the terminal can retain display memory above the screen, then the .Sy \&da capability should be given; if display memory can be retained below, then .Sy \&db should be given. These indicate that deleting a line or scrolling may bring non-blank lines up from below or that scrolling back with .Sy \&sr may bring down non-blank lines. .Ss Insert/Delete Character There are two basic kinds of intelligent terminals with respect to insert/delete character that can be described using .Nm . The most common insert/delete character operations affect only the characters on the current line and shift characters off the end of the line rigidly. Other terminals, such as the Concept\-100 and the Perkin Elmer Owl, make a distinction between typed and untyped blanks on the screen, shifting upon an insert or delete only to an untyped blank on the screen which is either eliminated or expanded to two untyped blanks. You can determine the kind of terminal you have by clearing the screen then typing text separated by cursor motions. Type .Dq Li abc\ \ \ \ def using local cursor motions (not spaces) between the .Dq abc and the .Dq def . Then position the cursor before the .Dq abc and put the terminal in insert mode. If typing characters causes the rest of the line to shift rigidly and characters to fall off the end, then your terminal does not distinguish between blanks and untyped positions. If the .Dq abc shifts over to the .Dq def which then move together around the end of the current line and onto the next as you insert, then you have the second type of terminal and should give the capability .Sy \&in , which stands for .Dq insert null . While these are two logically separate attributes (one line .Em \&vs . multi-line insert mode, and special treatment of untyped spaces), we have seen no terminals whose insert mode cannot be described with the single attribute. .Pp .Nm can describe both terminals that have an insert mode and terminals that send a simple sequence to open a blank position on the current line. Give as .Sy \&im the sequence to get into insert mode. Give as .Sy \&ei the sequence to leave insert mode. Now give as .Sy \&ic any sequence that needs to be sent just before each character to be inserted. Most terminals with a true insert mode will not give .Sy \&ic ; terminals that use a sequence to open a screen position should give it here. (If your terminal has both, insert mode is usually preferable to .Sy \&ic . Do not give both unless the terminal actually requires both to be used in combination.) If post-insert padding is needed, give this as a number of milliseconds in .Sy \&ip (a string option). Any other sequence that may need to be sent after insertion of a single character can also be given in .Sy \&ip . If your terminal needs to be placed into an `insert mode' and needs a special code preceding each inserted character, then both .Sy \&im Ns / Sy \&ei and .Sy \&ic can be given, and both will be used. The .Sy \&IC capability, with one parameter .Em n , will repeat the effects of .Sy \&ic .Em n times. .Pp It is occasionally necessary to move around while in insert mode to delete characters on the same line (e.g., if there is a tab after the insertion position). If your terminal allows motion while in insert mode, you can give the capability .Sy \&mi to speed up inserting in this case. Omitting .Sy \&mi will affect only speed. Some terminals (notably Datamedia's) must not have .Sy \&mi because of the way their insert mode works. .Pp Finally, you can specify .Sy \&dc to delete a single character, .Sy \&DC with one parameter .Em n to delete .Em n characters, and delete mode by giving .Sy \&dm and .Sy \&ed to enter and exit delete mode (which is any mode the terminal needs to be placed in for .Sy \&dc to work). .Ss Highlighting, Underlining, and Visible Bells If your terminal has one or more kinds of display attributes, these can be represented in a number of different ways. You should choose one display form as .Em standout mode , representing a good high-contrast, easy-on-the-eyes format for highlighting error messages and other attention getters. (If you have a choice, reverse video plus half-bright is good, or reverse video alone.) The sequences to enter and exit standout mode are given as .Sy \&so and .Sy \&se , respectively. If the code to change into or out of standout mode leaves one or even two blank spaces or garbage characters on the screen, as the .Tn TVI 912 and Teleray 1061 do, then .Sy \&sg should be given to tell how many characters are left. .Pp Codes to begin underlining and end underlining can be given as .Sy \&us and .Sy \&ue , respectively. Underline mode change garbage is specified by .Sy \&ug , similar to .Sy \&sg . If the terminal has a code to underline the current character and move the cursor one position to the right, such as the Microterm Mime, this can be given as .Sy \&uc . .Pp Other capabilities to enter various highlighting modes include .Sy \&mb (blinking), .Sy \&md (bold or extra bright), .Sy \&mh (dim or half-bright), .Sy \&mk (blanking or invisible text), .Sy \&mp (protected), .Sy \&mr (reverse video), .Sy \&me (turn off .Em all attribute modes), .Sy \&as (enter alternate character set mode), and .Sy \&ae (exit alternate character set mode). Turning on any of these modes singly may or may not turn off other modes. .Pp If there is a sequence to set arbitrary combinations of mode, this should be given as .Sy \&sa (set attributes), taking 9 parameters. Each parameter is either 0 or 1, as the corresponding attributes is on or off. The 9 parameters are, in order: standout, underline, reverse, blink, dim, bold, blank, protect, and alternate character set. Not all modes need be supported by .Sy \&sa , only those for which corresponding attribute commands exist. (It is unlikely that a .Nm Ns -using program will support this capability, which is defined for compatibility with .Xr terminfo 5 . ) .Pp Terminals with the .Dq magic cookie glitches .Pf ( Sy \&sg and .Sy \&ug ) , rather than maintaining extra attribute bits for each character cell, instead deposit special .Dq cookies , or .Dq garbage characters , when they receive mode-setting sequences, which affect the display algorithm. .Pp Some terminals, such as the Hewlett-Packard 2621, automatically leave standout mode when they move to a new line or when the cursor is addressed. Programs using standout mode should exit standout mode on such terminals before moving the cursor or sending a newline. On terminals where this is not a problem, the .Sy \&ms capability should be present to say that this overhead is unnecessary. .Pp If the terminal has a way of flashing the screen to indicate an error quietly (a bell replacement), this can be given as .Sy \&vb ; it must not move the cursor. .Pp If the cursor needs to be made more visible than normal when it is not on the bottom line (to change, for example, a non-blinking underline into an easier-to-find block or blinking underline), give this sequence as .Sy \&vs . If there is a way to make the cursor completely invisible, give that as .Sy \&vi . The capability .Sy \&ve , which undoes the effects of both of these modes, should also be given. .Pp If your terminal correctly displays underlined characters (with no special codes needed) even though it does not overstrike, then you should give the capability .Sy \&ul . If overstrikes are erasable with a blank, this should be indicated by giving .Sy \&eo . .Ss Keypad If the terminal has a keypad that transmits codes when the keys are pressed, this information can be given. Note that it is not possible to handle terminals where the keypad only works in local mode (this applies, for example, to the unshifted Hewlett-Packard 2621 keys). If the keypad can be set to transmit or not transmit, give these codes as .Sy \&ks and .Sy \&ke . Otherwise the keypad is assumed to always transmit. The codes sent by the left-arrow, right-arrow, up-arrow, down-arrow, and home keys can be given as .Sy \&kl , .Sy \&kr , .Sy \&ku , .Sy \&kd , and .Sy \&kh , respectively. If there are function keys such as f0, f1, ..., f9, the codes they send can be given as .Sy \&k0 , .Sy \&k1 , \&..., .Sy \&k9 . If these keys have labels other than the default f0 through f9, the labels can be given as .Sy \&l0 , .Sy \&l1 , \&..., .Sy \&l9 . The codes transmitted by certain other special keys can be given: .Sy \&kH (home down), .Sy \&kb (backspace), .Sy \&ka (clear all tabs), .Sy \&kt (clear the tab stop in this column), .Sy \&kC (clear screen or erase), .Sy \&kD (delete character), .Sy \&kL (delete line), .Sy \&kM (exit insert mode), .Sy \&kE (clear to end of line), .Sy \&kS (clear to end of screen), .Sy \&kI (insert character or enter insert mode), .Sy \&kA (insert line), .Sy \&kN (next page), .Sy \&kP (previous page), .Sy \&kF (scroll forward/down), .Sy \&kR (scroll backward/up), and .Sy \&kT (set a tab stop in this column). In addition, if the keypad has a 3 by 3 array of keys including the four arrow keys, then the other five keys can be given as .Sy \&K1 , .Sy \&K2 , .Sy \&K3 , .Sy \&K4 , and .Sy \&K5 . These keys are useful when the effects of a 3 by 3 directional pad are needed. The obsolete .Sy \&ko capability formerly used to describe .Dq other function keys has been completely supplanted by the above capabilities. .Pp The .Sy \&ma entry is also used to indicate arrow keys on terminals that have single-character arrow keys. It is obsolete but still in use in version 2 of .Sy \&vi which must be run on some minicomputers due to memory limitations. This field is redundant with .Sy \&kl , .Sy \&kr , .Sy \&ku , .Sy \&kd , and .Sy \&kh . It consists of groups of two characters. In each group, the first character is what an arrow key sends, and the second character is the corresponding .Sy \&vi command. These commands are .Ar h for .Sy \&kl , .Ar j for .Sy \&kd , .Ar k for .Sy \&ku , .Ar l for .Sy \&kr , and .Ar H for .Sy \&kh . For example, the Mime would have .Dq Li ma=^Hh^Kj^Zk^Xl indicating arrow keys left (^H), down (^K), up (^Z), and right (^X). (There is no home key on the Mime.) .Ss Tabs and Initialization If the terminal needs to be in a special mode when running a program that uses these capabilities, the codes to enter and exit this mode can be given as .Sy \&ti and .Sy \&te . This arises, for example, from terminals like the Concept with more than one page of memory. If the terminal has only memory-relative cursor addressing and not screen-relative cursor addressing, a screen-sized window must be fixed into the display for cursor addressing to work properly. This is also used for the Tektronix 4025, where .Sy \&ti sets the command character to be the one used by .Nm . .Pp Other capabilities include .Sy \&is , an initialization string for the terminal, and .Sy \&if , the name of a file containing long initialization strings. These strings are expected to set the terminal into modes consistent with the rest of the .Nm description. They are normally sent to the terminal by the .Xr tset 1 program each time the user logs in. They will be printed in the following order: .Sy \&is ; setting tabs using .Sy \&ct and .Sy \&st ; and finally .Sy \&if . .Pf ( Xr Terminfo uses .Sy \&i\&1-i2 instead of .Sy \&is and runs the program .Sy \&iP and prints .Sy "\&i\&3" after the other initializations.) A pair of sequences that does a harder reset from a totally unknown state can be analogously given as .Sy \&rs and .Sy \&if . These strings are output by the .Xr reset 1 program, which is used when the terminal gets into a wedged state. .Pf ( Xr Terminfo uses .Sy "\&r1-r3" instead of .Sy \&rs . ) Commands are normally placed in .Sy \&rs and .Sy \&rf only if they produce annoying effects on the screen and are not necessary when logging in. For example, the command to set the VT100 into 80-column mode would normally be part of .Sy \&is , but it causes an annoying glitch of the screen and is not normally needed since the terminal is usually already in 80-column mode. .Pp If the terminal has hardware tabs, the command to advance to the next tab stop can be given as .Sy \&ta (usually .Sy \&^I ) . A .Dq backtab command which moves leftward to the previous tab stop can be given as .Sy \&bt . By convention, if the terminal driver modes indicate that tab stops are being expanded by the computer rather than being sent to the terminal, programs should not use .Sy \&ta or .Sy \&bt even if they are present, since the user may not have the tab stops properly set. If the terminal has hardware tabs that are initially set every .Ar n positions when the terminal is powered up, then the numeric parameter .Sy \&it is given, showing the number of positions between tab stops. This is normally used by the .Xr tset 1 command to determine whether to set the driver mode for hardware tab expansion, and whether to set the tab stops. If the terminal has tab stops that can be saved in nonvolatile memory, the .Nm description can assume that they are properly set. .Pp If there are commands to set and clear tab stops, they can be given as .Sy \&ct (clear all tab stops) and .Sy \&st (set a tab stop in the current column of every row). If a more complex sequence is needed to set the tabs than can be described by this, the sequence can be placed in .Sy \&is or .Sy \&if . .Ss Delays Certain capabilities control padding in the terminal driver. These are primarily needed by hardcopy terminals and are used by the .Xr tset 1 program to set terminal driver modes appropriately. Delays embedded in the capabilities .Sy \&cr , .Sy \&sf , .Sy \&le , .Sy \&ff , and .Sy \&ta will cause the appropriate delay bits to be set in the terminal driver. If .Sy \&pb (padding baud rate) is given, these values can be ignored at baud rates below the value of .Sy \&pb . For .Bx 4.2 .Xr tset 1 , the delays are given as numeric capabilities .Sy \&dC , .Sy \&dN , .Sy \&dB , .Sy \&dF , and .Sy \&dT instead. .Ss Miscellaneous If the terminal requires other than a .Dv NUL (zero) character as a pad, this can be given as .Sy \&pc . Only the first character of the .Sy \&pc string is used. .Pp If the terminal has commands to save and restore the position of the cursor, give them as .Sy \&sc and .Sy \&rc . .Pp If the terminal has an extra .Dq status line that is not normally used by software, this fact can be indicated. If the status line is viewed as an extra line below the bottom line, then the capability .Sy \&hs should be given. Special strings to go to a position in the status line and to return from the status line can be given as .Sy \&ts and .Sy \&fs . .Pf ( Xr \&fs must leave the cursor position in the same place that it was before .Sy \&ts . If necessary, the .Sy \&sc and .Sy \&rc strings can be included in .Sy \&ts and .Sy \&fs to get this effect.) The capability .Sy \&ts takes one parameter, which is the column number of the status line to which the cursor is to be moved. If escape sequences and other special commands such as tab work while in the status line, the flag .Sy \&es can be given. A string that turns off the status line (or otherwise erases its contents) should be given as .Sy \&ds . The status line is normally assumed to be the same width as the rest of the screen, i.e.\& .Sy \&co . If the status line is a different width (possibly because the terminal does not allow an entire line to be loaded), then its width in columns can be indicated with the numeric parameter .Sy \&ws . .Pp If the terminal can move up or down half a line, this can be indicated with .Sy \&hu (half-line up) and .Sy \&hd (half-line down). This is primarily useful for superscripts and subscripts on hardcopy terminals. If a hardcopy terminal can eject to the next page (form feed), give this as .Sy \&ff (usually .Sy \&^L ) . .Pp If there is a command to repeat a given character a given number of times (to save time transmitting a large number of identical characters), this can be indicated with the parameterized string .Sy \&rp . The first parameter is the character to be repeated and the second is the number of times to repeat it. (This is a .Xr terminfo 5 feature that is unlikely to be supported by a program that uses .Nm . ) .Pp If the terminal has a settable command character, such as the Tektronix 4025, this can be indicated with .Sy \&CC . A prototype command character is chosen which is used in all capabilities. This character is given in the .Sy \&CC capability to identify it. The following convention is supported on some .Ux systems: The environment is to be searched for a .Ev \&CC variable, and if found, all occurrences of the prototype character are replaced by the character in the environment variable. This use of the .Ev \&CC environment variable is a very bad idea, as it conflicts with .Xr make 1 . .Pp Terminal descriptions that do not represent a specific kind of known terminal, such as .Em switch , .Em dialup , .Em patch , and .Em network , should include the .Sy \&gn (generic) capability so that programs can complain that they do not know how to talk to the terminal. (This capability does not apply to .Em virtual terminal descriptions for which the escape sequences are known.) .Pp If the terminal uses xoff/xon .Pq Tn DC3 Ns / Ns Tn DC1 handshaking for flow control, give .Sy \&xo . Padding information should still be included so that routines can make better decisions about costs, but actual pad characters will not be transmitted. .Pp If the terminal has a .Dq meta key which acts as a shift key, setting the 8th bit of any character transmitted, then this fact can be indicated with .Sy \&km . Otherwise, software will assume that the 8th bit is parity and it will usually be cleared. If strings exist to turn this .Dq meta mode on and off, they can be given as .Sy \&mm and .Sy \&mo . .Pp If the terminal has more lines of memory than will fit on the screen at once, the number of lines of memory can be indicated with .Sy \&lm . An explicit value of 0 indicates that the number of lines is not fixed, but that there is still more memory than fits on the screen. .Pp If the terminal is one of those supported by the .Ux system virtual terminal protocol, the terminal number can be given as .Sy \&vt . .Pp Media copy strings which control an auxiliary printer connected to the terminal can be given as .Sy \&ps : print the contents of the screen; .Sy \&pf : turn off the printer; and .Sy \&po : turn on the printer. When the printer is on, all text sent to the terminal will be sent to the printer. It is undefined whether the text is also displayed on the terminal screen when the printer is on. A variation .Sy \&pO takes one parameter and leaves the printer on for as many characters as the value of the parameter, then turns the printer off. The parameter should not exceed 255. All text, including .Sy \&pf , is transparently passed to the printer while .Sy \&pO is in effect. .Pp Strings to program function keys can be given as .Sy \&pk , .Sy \&pl , and .Sy \&px . Each of these strings takes two parameters: the function key number to program (from 0 to 9) and the string to program it with. Function key numbers out of this range may program undefined keys in a terminal-dependent manner. The differences among the capabilities are that .Sy \&pk causes pressing the given key to be the same as the user typing the given string; .Sy \&pl causes the string to be executed by the terminal in local mode; and .Sy \&px causes the string to be transmitted to the computer. Unfortunately, due to lack of a definition for string parameters in .Nm , only .Xr terminfo 5 supports these capabilities. .Ss Glitches and Brain-damage Hazeltine terminals, which do not allow `~' characters to be displayed, should indicate .Sy \&hz . .Pp The .Sy \&nc capability, now obsolete, formerly indicated Datamedia terminals, which echo .Sy \&\er \en for carriage return then ignore a following linefeed. .Pp Terminals that ignore a linefeed immediately after an .Sy \&am wrap, such as the Concept, should indicate .Sy \&xn . .Pp If .Sy \&ce is required to get rid of standout (instead of merely writing normal text on top of it), .Sy \&xs should be given. .Pp Teleray terminals, where tabs turn all characters moved over to blanks, should indicate .Sy \&xt (destructive tabs). This glitch is also taken to mean that it is not possible to position the cursor on top of a \*(lqmagic cookie\*(rq, and that to erase standout mode it is necessary to use delete and insert line. .Pp The Beehive Superbee, which is unable to correctly transmit the .Dv ESC or .Sy \&^C characters, has .Sy \&xb , indicating that the .Dq \&f\&1 key is used for .Dv ESC and .Dq \&f\&2 for ^C. (Only certain Superbees have this problem, depending on the .Tn ROM . ) .Pp Other specific terminal problems may be corrected by adding more capabilities of the form .Sy x Em x . .Ss Similar Terminals If there are two very similar terminals, one can be defined as being just like the other with certain exceptions. The string capability .Sy \&tc can be given with the name of the similar terminal. This capability must be .Em last , and the combined length of the entries must not exceed 1024. The capabilities given before .Sy \&tc override those in the terminal type invoked by .Sy \&tc . A capability can be cancelled by placing .Sy \&xx@ to the left of the .Sy \&tc invocation, where .Sy \&xx is the capability. For example, the entry .Bd -literal -offset indent hn\||\|2621\-nl:ks@:ke@:tc=2621: .Ed .Pp defines a .Dq 2621\-nl that does not have the .Sy \&ks or .Sy \&ke capabilities, hence does not turn on the function key labels when in visual mode. This is useful for different modes for a terminal, or for different user preferences. .Sh FILES .Bl -tag -width /usr/share/misc/termcap.db -compact .It Pa /usr/share/misc/termcap File containing terminal descriptions. .It Pa /usr/share/misc/termcap.db Hash database file containing terminal descriptions (see .Xr cap_mkdb 1 ) . .El .Sh SEE ALSO .Xr cap_mkdb 1 , .Xr \&ex 1 , .Xr more 1 , .Xr tset 1 , .Xr \&ul 1 , .Xr vi 1 , .Xr curses 3 , .Xr printf 3 , .Xr termcap 3 , .Xr terminfo 3 , .Xr terminfo 5 , .Xr term 7 .Sh HISTORY The .Nm file format appeared in .Bx 3 . .Sh CAVEATS The .Nm functions were replaced by .Xr terminfo 5 in .At V Release 2.0. The transition will be relatively painless if capabilities flagged as .Dq obsolete are avoided. .Sh BUGS Lines and columns are now stored by the kernel as well as in the termcap entry. Most programs now use the kernel information primarily; the information in this file is used only if the kernel does not have any information. .Pp .Xr \&vi 1 allows only 256 characters for string capabilities, and the routines in .Xr termcap 3 do not check for overflow of this buffer. The total length of a single entry (excluding only escaped newlines) may not exceed 1024. .Pp Not all programs support all entries.