xref: /freebsd/contrib/ncurses/man/terminfo.head (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
***************************************************************************
Copyright 2018-2019,2020 Thomas E. Dickey *
Copyright 1998-2016,2017 Free Software Foundation, Inc. *
*
Permission is hereby granted, free of charge, to any person obtaining a *
copy of this software and associated documentation files (the *
"Software"), to deal in the Software without restriction, including *
without limitation the rights to use, copy, modify, merge, publish, *
distribute, distribute with modifications, sublicense, and/or sell *
copies of the Software, and to permit persons to whom the Software is *
furnished to do so, subject to the following conditions: *
*
The above copyright notice and this permission notice shall be included *
in all copies or substantial portions of the Software. *
*
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
*
Except as contained in this notice, the name(s) of the above copyright *
holders shall not be used in advertising or otherwise to promote the *
sale, use or other dealings in this Software without prior written *
authorization. *
***************************************************************************

$Id: terminfo.head,v 1.39 2020/02/02 23:34:34 tom Exp $
terminfo 5 "" "" "File Formats"
..
..
..
NAME
terminfo - terminal capability data base
SYNOPSIS
\*d/*/*
DESCRIPTION
Terminfo is a data base describing terminals, used by screen-oriented programs such as nvi(1), lynx(1), mutt(1), and other curses applications, using high-level calls to libraries such as curses(3X). It is also used via low-level calls by non-curses applications which may be screen-oriented (such as @CLEAR@(1)) or non-screen (such as @TABS@(1)).

Terminfo describes terminals by giving a set of capabilities which they have, by specifying how to perform screen operations, and by specifying padding requirements and initialization sequences.

This manual describes ncurses version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).

Terminfo Entry Syntax

Entries in terminfo consist of a sequence of fields: .bP Each field ends with a comma \*(``,\*('' (embedded commas may be escaped with a backslash or written as \*(``\\054\*(''). .bP White space between fields is ignored. .bP The first field in a terminfo entry begins in the first column. .bP Newlines and leading whitespace (spaces or tabs) may be used for formatting entries for readability. These are removed from parsed entries.

The @INFOCMP@ -f and -W options rely on this to format if-then-else expressions, or to enforce maximum line-width. The resulting formatted terminal description can be read by @TIC@. .bP The first field for each terminal gives the names which are known for the terminal, separated by \*(``|\*('' characters.
The first name given is the most common abbreviation for the terminal (its primary name), the last name given should be a long name fully identifying the terminal (see longname(3X)), and all others are treated as synonyms (aliases) for the primary terminal name.
X/Open Curses advises that all names but the last should be in lower case and contain no blanks; the last name may well contain upper case and blanks for readability.
This implementation is not so strict; it allows mixed case in the primary name and aliases. If the last name has no embedded blanks, it allows that to be both an alias and a verbose name (but will warn about this ambiguity). .bP Lines beginning with a \*(``#\*('' in the first column are treated as comments.
While comment lines are legal at any point, the output of @CAPTOINFO@ and @INFOTOCAP@ (aliases for @TIC@) will move comments so they occur only between entries.

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, thus \*(``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 a mode suffix. Thus, a vt100 in 132-column mode would be vt100-w. The following suffixes should be used where possible:

Suffix Meaning Example
-nn Number of lines on the screen aaa-60
-np Number of pages of memory c100-4p
-am With automargins (usually the default) vt100-am
-m Mono mode; suppress color ansi-m
-mc Magic cookie; spaces when highlighting wy30-mc
-na No arrow keys (leave them in local) c100-na
-nam Without automatic margins vt100-nam
-nl No status line att4415-nl
-ns No status line hp2626-ns
-rv Reverse video c100-rv
-s Enable status line vt100-s
-vb Use visible bell instead of beep wy370-vb
-w Wide mode (> 80 columns, usually 132) vt100-w

For more on terminal naming conventions, see the term(7) manual page.

Terminfo Capabilities Syntax

The terminfo entry consists of several capabilities, i.e., features that the terminal has, or methods for exercising the terminal's features.

After the first field (giving the name(s) of the terminal entry), there should be one or more capability fields. These are boolean, numeric or string names with corresponding values: .bP Boolean capabilities are true when present, false when absent. There is no explicit value for boolean capabilities. .bP Numeric capabilities have a \*(``#\*('' following the name, then an unsigned decimal integer value. .bP String capabilities have a \*(``=\*('' following the name, then an string of characters making up the capability value.

String capabilities can be split into multiple lines, just as the fields comprising a terminal entry can be split into multiple lines. While blanks between fields are ignored, blanks embedded within a string value are retained, except for leading blanks on a line.

Any capability can be canceled, i.e., suppressed from the terminal entry, by following its name with \*(``@\*('' rather than a capability value.

Similar Terminals

If there are two very similar terminals, one (the variant) can be defined as being just like the other (the base) with certain exceptions. In the definition of the variant, the string capability use can be given with the name of the base terminal: .bP The capabilities given before use override those in the base type named by use . .bP If there are multiple use capabilities, they are merged in reverse order. That is, the rightmost use reference is processed first, then the one to its left, and so forth. .bP Capabilities given explicitly in the entry override those brought in by use references.

A capability can be canceled by placing xx@ to the left of the use reference that imports it, where xx is the capability. For example, the entry

2621-nl, smkx@, rmkx@, use=2621,

defines a 2621-nl that does not have the smkx or rmkx capabilities, and 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.

An entry included via use can contain canceled capabilities, which have the same effect as if those cancels were inline in the using terminal entry.

Predefined Capabilities
Head of terminfo man page ends here