LinuxCommandLibrary

infocmp

Compare or print terminfo descriptions

SYNOPSIS

infocmp [options] terminfo-entry-name [terminfo-entry-name ...]

PARAMETERS

-A term
    Specifies the primary terminal entry for comparison. If two entries are given without -A or -B, the first is used as -A.

-B term
    Specifies the secondary terminal entry for comparison. This is the entry against which the primary one is compared.

-C
    Outputs the terminfo entry in termcap (capinfo) format. This format is older and less capable than terminfo but may be useful for compatibility.

-I
    Outputs the terminfo entry in terminfo source format, suitable for input to the tic compiler. This is the default output format when printing a single entry.

-d
    When comparing two entries, dumps only those capabilities that are different between the two entries.

-n num
    Sets the number of columns for the formatted output, making the output more readable for wide terminals. Default is 60 columns.

-q
    Enables quiet mode. This option suppresses comments and reduces output, primarily useful when comparing entries in scripts for automated checking.

-s [d|l|s|c]
    Sorts the output. Options include by default (d), by long capability names (l), by short capability names (s), or by capability type (c).

-v
    Increases verbosity of the output. Can be specified multiple times (e.g., -vv) for even more detailed information, including comments and debugging info.

-V
    Prints the version number of the ncurses library that infocmp is part of, then exits.

DESCRIPTION

The infocmp command is a utility from the ncurses library that allows users to compare or print entries from the terminfo database. The terminfo database is a comprehensive collection of descriptions for various terminal types, detailing their capabilities and behaviors (e.g., how to clear the screen, move the cursor, or set colors).

When used for comparison, infocmp can highlight the differences between two or more specified terminal entries, which is incredibly useful for debugging terminal issues, verifying new terminfo entries, or understanding variations between terminals. It can display these differences in a human-readable format, or specifically show capabilities that exist in one entry but not another.

As a printing utility, infocmp can output a terminfo entry in a source format suitable for compilation by the tic compiler, or in a format compatible with the older termcap system (known as capinfo format). This functionality aids in porting, documenting, or simply inspecting the raw capabilities of a terminal as defined in the database. It's an essential tool for system administrators and developers working with terminal applications and behaviors.

CAVEATS

infocmp's output can be very detailed and complex, especially when dealing with obscure capabilities or when comparing many entries. It relies on the terminfo database, which must be correctly installed and accessible (typically in /usr/share/terminfo or defined by the TERMINFO environment variable). Interpreting differences requires a good understanding of terminfo syntax and capabilities. The -C (termcap) output option generates an obsolete format that may not fully represent modern terminfo capabilities.

ENVIRONMENT VARIABLES

The TERMINFO environment variable can be set to override the default location of the terminfo database. If not set, infocmp typically looks in /usr/share/terminfo or a similar system-dependent path. The TERM variable specifies the type of terminal to be used, but infocmp generally takes terminal names as explicit arguments.

EXIT STATUS

infocmp exits with 0 on success, 1 if usage or parameter errors occur, and 2 if a specified terminal entry is not found in the database. When comparing entries, a non-zero exit status may also indicate differences found, depending on the options used (e.g., with -q).

HISTORY

infocmp is a component of the ncurses (new curses) project, which is a free software emulation of the System V Release 4.0 (SVr4) curses library. The terminfo database and its associated utilities like infocmp and tic were developed as part of AT&T System V Unix, succeeding the older termcap system. ncurses aims to be fully compatible with SVr4 curses, ensuring that tools like infocmp provide robust and consistent functionality for managing terminal capabilities across various Unix-like systems. Its development has focused on maintaining compatibility while also introducing enhancements and bug fixes.

SEE ALSO

tic(1), captoinfo(1), ncurses(3), terminfo(5), tput(1), tset(1)

Copied to clipboard