*** Welcome to piglix ***

Terminfo


Terminfo is a library and database that enables programs to use display terminals in a device-independent manner. Mark Horton implemented the first terminfo library in 1981–1982 as an improvement over termcap. The improvements include

Terminfo was included with UNIX System V Release 2 and soon became the preferred form of terminal descriptions in System V, rather than termcap (which BSD continued to use). This was imitated in pcurses in 1982–1984 by Pavel Curtis, and was available on other UNIX implementations, adapting or incorporating fixes from Mark Horton. For more information, refer to the posting on the comp.sources.unix newsgroup from December 1986.

A terminfo database can describe the capabilities of hundreds of different display terminals. This allows external programs to be able to have character-based display output, independent of the type of terminal.

Some configurations are:

Terminfo databases consist of one or more descriptions of terminals.

Each description must contain the canonical name of the terminal. It may also contain one or more aliases for the name of the terminal. The canonical name or aliases are the keys by which the library searches the terminfo database.

The description contains one or more capabilities, which have conventional names. The capabilities are typed: boolean, numeric and string. The terminfo library has predetermined types for each capability name. It checks the types of each capability by the syntax:

Applications which use terminfo know the types for the respective capabilities, and obtain the values of capabilities from the terminfo database using library calls that return successfully only when the capability name corresponds to one of the predefined typed capabilities.

Like termcap, some of the string capabilities represent escape sequences which may be sent to the host by pressing special keys on the keyboard. Other capabilities represent strings that may be sent by an application to the terminal. In the latter case, the terminfo library functions (as does a termcap library) for substituting application parameters into the string which is sent. These functions provide a stack-based expression parser, which is primarily used to help minimize the number of characters sent for control sequences which have optional parameters such as SGR (Select Graphic Rendition). In contrast, termcap libraries provide a limited set of operations which are useful for most terminals.


...
Wikipedia

...