INFOCMP(8V)

NAME
infocmp - compare or print out terminfo descriptions

SYNOPSIS
infocmp [ -cdnILCruvV1 ] [ -sd ] [ -si ] [ -sl ] [ -sc ] [ -w width ]
[-A directory ] [-B directory ] [ termname ...]

SYNOPSIS
/usr/5bin/infocmp arguments

Note: arguments to /usr/5bin/infocmp are the same as those for infocmp, above.

AVAILABILITY
The System V version of this command is available with the System V software installation option. Refer to for information on how to install optional software.

DESCRIPTION
infocmp compares a binary terminfo(5V) entry with other terminfo entries, rewrites a terminfo description to take advantage of the use= field, or prints out a terminfo description from the corresponding binary file in a variety of formats. It displays boolean fields first, then numeric fields, then string fields.

It can also convert a terminfo entry to a termcap(5) entry; the -C flag causes infocmp to perform this conversion. Some termcap variables are not supported by terminfo, but those that can be derived from terminfo variables are displayed. Not all terminfo capabilities are translated either; only those that are allowed in a termcap entry are normally displayed. Specifying the -r option eliminates this restriction, allowing all capabilities to be displayed in termcap form.

Because padding is collected at the beginning of a capability, not all capabilities are displayed. Since mandatory padding is not supported by terminfo and termcap strings are not as flexible, it is not always possible to convert a terminfo string capability into an equivalent working termcap capability. Also, a subsequent conversion of the termcap file back into terminfo format will not necessarily reproduce the original source; infocmp attempts to convert parameterized strings, and comments out those that it can not.

Some common terminfo parameter sequences, their termcap equivalents, and some terminal types which commonly have such sequences, are:

Terminfo | Termcap | Representative Terminals
%p1%c | %. | adm
%p1%d | %d | hp, ANSI standard, vt100
%p1%'x'%+%c | %+x | concept
%i | %i | ANSI standard, vt100
%p1%?%'x'%>%t%p1%'y'%+%; | %>xy | concept
%p2 is printed before %p1 | %r | hp

If no termname arguments are given, the environment variable TERM is used for all expected termname arguments.

OPTIONS

  Default Options
If no options are specified and either zero or one termname is specified, the -I option is assumed to be in effect. If more than one termname is specified, the -d option is assumed.

  Comparison Options
infocmp compares the description of the first terminal termname with each of the descriptions for terminals listed in subsequent termname arguments. If a capability is defined for only one of the terminals, the value returned will depend on the type of the capability: F for boolean variables, -1 for integer variables, and NULL for string variables.

-c  Produce a list of capabilities common to both entries. Capabilities that are not set are ignored. This option can be used as a quick check to see if the -u option is worth using.

-d  Produce a list of capabilities that differ between descriptions.

-n  Produce a list of capabilities in neither entry.

  Source Listing Options
The -I, -L, and -C options produce a source listing for each terminal named.

-I  Use the terminfo names.

-L  Use the long C variable name listed in <term.h>.

-C  Display only those capabilities that have termcap equivalents, using the termcap names and displaying them in termcap form whenever possible.

    The source produced by the -C option may be used directly as a termcap entry, but not all of the parameterized strings may be changed to the termcap format. All padding information for strings is collected together and placed at the beginning of the string where termcap expects it. Mandatory padding (padding information with a trailing `/') will become optional.

-r  When using -C, display all capabilities, not just those capabilities that have termcap equivalents.

-u  Produce a terminfo source description for the first named terminal which is relative to the descriptions given by the entries for all terminals named subsequently on the command line, by analyzing the differences between them, and producing a description with use= fields for the other terminals. In this manner, it is possible to retrofit generic terminfo entries into a terminal's description. Or, if two similar terminals exist, but were coded at different times or by different people so that each description is a full description, using infocmp will show what can be done to change one description to be relative to the other.

    A capability is displayed with an at-sign (@) if it no longer exists in the first terminal, but one of the other terminal entries contains a value for it. A capability's value gets printed if the value in the first termname is not found in any of the other termname entries, or if the first of the other termname entries has a different value for that capability.

    The order of the other termname entries is significant. Since the terminfo compiler tic(8V) does a left-to-right scan of the capabilities, specifying two use= entries that contain differing entries for the same capabilities will produce different results, depending on the order in which they are given. infocmp flags any such inconsistencies between the other termname entries as they are found.

    Alternatively, specifying a capability after a use= entry that contains it, will cause the second specification to be ignored. Using infocmp to recreate a description can be a useful check to make sure that everything was specified correctly in the original.

    Specifying superfluous use= slows down the comparison, but is not fatal; infocmp flags superfluous use= fields.

  Sorting Options

-sd Sort fields in the order that they are stored in the terminfo database.

-si Sort fields by terminfo name.

-sl Sort fields by the long C variable name.

-sc Sort fields by the termcap name.

    If no sorting option is given, fields are sorted alphabetically by the terminfo name within each type, except in the case of the -C or the -L options, which cause the sorting to be done by the termcap name or the long C variable name, respectively.

  Changing Databases
The location of the compiled terminfo database is taken from the environment variable TERMINFO. If the variable is not defined, or if the terminal is not found in that location, the system terminfo database, usually in /usr/share/lib/terminfo, is used. The options -A and -B may be used to override this location. With these options, it is possible to compare descriptions for a terminal with the same name located in two different databases. This is useful for comparing descriptions for the same terminal created by different people.

-A  Set TERMINFO for the first termname argument.

-B  Set TERMINFO for the remaining termname arguments.

  Other Options

-v  Print out tracing information on the standard error.

-V  Print out the version of the program in use on the standard error and exit.

-1  Print fields out one to a line. Otherwise, fields are printed several to a line to a maximum width of 60 characters.

-w width
    Change the output to width characters.

FILES
/usr/share/lib/terminfo/?/*
    compiled terminal description database
/usr/5include/term.h

SEE ALSO
curses(3V), termcap(5), terminfo(5V), tic(8V)

DIAGNOSTICS

malloc is out of space!
    There was not enough memory available to process all the terminal descriptions requested. Run infocmp in several smaller stages (with fewer termname arguments).

use= order dependency found:
    A value specified in one relative terminal specification was different from that in another relative terminal specification.

`use=term' did not add anything to the description.
    A relative terminal name did not contribute anything to the final description.

must have at least two terminal names for a comparision to be done.
The -u, -d and -c options require at least two terminal names.