HP-UX Reference (11i v2 03/08) - 4 File Formats (vol 8)
t
terminfo(4) terminfo(4)
(ENHANCED CURSES)
Note that most printer manufacturers advertise the maximum print rate, not the nominal print rate. A
good way to get a value to put in for cps is to generate a few pages of text, count the number of printable
characters, and then see how long it takes to print the text.
Applications that use these values should recognize the variability in the print rate. Straight text, in
short lines, with no embedded control sequences will probably print at close to the advertised print rate
and probably faster than the rate in cps. Graphics data with a lot of control sequences, or very long
lines of text, will print at well below the advertised rate and below the rate in cps. If the application is
using cps to decide how long it should take a printer to print a block of text, the application should pad
the estimate. If the application is using cps to decide how much text has already been printed, it should
shrink the estimate. The application will thus err in favor of the user, who wants, above all, to see all the
output in its correct place.
Selecting a Terminal
If the environment variable TERMINFO is defined, any program using Curses checks for a local terminal
definition before checking in the standard place. For example, if TERM is set to att4424, then the com-
piled terminal definition is found by default in the path
a/att4424
within an implementation-specific directory.
(The "a" is copied from the first letter of att4424 to avoid creation of huge directories.) However, if
TERMINFO is set to $HOME/myterms, Curses first checks
$HOME/myterms/a/att4424
If that fails, it then checks the default path name.
This is useful for developing experimental definitions or when write permission in the implementation-
defined default database is not available.
If the LINES and COLUMNS environment variables are set, or if the program is executing in a window
environment, line and column information in the environment will override information read by ter-
minfo.
Application Usage
The most effective way to prepare a terminal description is by imitating the description of a similar termi-
nal in terminfo and to build up a description gradually, using partial descriptions with a screen-
oriented editor, to check that they are correct. To easily test a new terminal description, the environment
variable TERMINFO can be set to the path name of a directory containing the compiled description, and
programs will look there rather than in the terminfo database.
Conventions for Device Aliases
Every device must be assigned a name, such as vt100. Device names (except the long name) should be
chosen using the following conventions. The name should not contain hyphens because hyphens are
reserved for use when adding suffixes that indicate special modes.
These special modes may be modes that the hardware can be in, or user preferences. To assign a special
mode to a particular device, append a suffix consisting of a hyphen and an indicator of the mode to the
device name. For example, the -w suffix means wide mode; when specified, it allows for a width of 132
columns instead of the standard 80 columns. Therefore, if you want to use a VT100 device set to wide
mode, name the device vt100-w. Use the following suffixes where possible:
Suffix Meaning Example
-w Wide mode (more than 80 columns) 5410-w
-am With automatic margins (usually default) vt100-am
-nam Without automatic margins vt100-nam
-n Number of lines on the screen 2300-40
-na No arrow keys (leave them in local) c100-na
-np Number of pages of memory c100-4p
-rv Reverse video 4415-rv
Variations of Terminal Definitions
It is implementation-defined how the entries in terminfo may be created.
There is more than one way to write a terminfo entry. A minimal entry may permit applications to use
Curses to operate the terminal. If the entry is enhanced to describe more of the terminal’s capabilities,
Section 4−−344 Hewlett-Packard Company − 33 − HP-UX 11i Version 2: August 2003