Linux "infocmp" Command Line Options and Examples
compare or print out terminfo descriptions

infocmp can be used to compare a binary terminfo entry with other terminfo entries, rewrite a terminfo description to take advantage of the use= terminfo field, or print out a terminfo description from the binary file (term) in a variety of formats. In all cases, the boolean fields will be printed first, followed by the numeric fields, followed by the string fields.


Usage:

infocmp [-1CDEFGIKLTUVWcdegilnpqrtux]
       [-v n] [-s d| i| l| c] [-Q n] [-R subset]
       [-w width] [-A directory] [-B directory]
       [termname...]






Command Line Options:

-I
use the terminfo names
infocmp -I ...
-L
use the long C variable name listed in <term.h>
infocmp -L ...
-C
use the termcap names
infocmp -C ...
-r
put out all capabilities in termcap form
infocmp -r ...
-K
If no termnames are given, the environment variable TERM will be used for the terminal name.The source produced by the -C option may be used directly as a termcap entry, but not all parameterized strings can be changed to thetermcap format. infocmp will attempt to convert most of the parameterized information, and anything not converted will be plainlymarked in the output and commented out. These should be edited by hand.For best results when converting to termcap format, you should use both -C and -r. Normally a termcap description is limited to 1023bytes. infocmp trims away less essential parts to make it fit. If you are converting to one of the (rare) termcap implementationswhich accept an unlimited size of termcap, you may want to add the -T option. More often however, you must help the termcap imple‐mentation, and trim excess whitespace (use the -0 option for that).All padding information for strings will be collected together and placed at the beginning of the string where termcap expects it.Mandatory padding (padding information with a trailing “/”) will become optional.All termcap variables no longer supported by terminfo, but which are derivable from other terminfo variables, will be output. Notall terminfo capabilities will be translated; only those variables which were part of termcap will normally be output. Specifyingthe -r option will take off this restriction, allowing all capabilities to be output in termcap form. Normally you would use boththe -C and -r options. The actual format used incorporates some improvements for escaped characters from terminfo format. For astricter BSD-compatible translation, use the -K option rather than -C.Note that because padding is collected to the beginning of the capability, not all capabilities are output. Mandatory padding is notsupported. Because termcap strings are not as flexible, it is not always possible to convert a terminfo string capability into anequivalent termcap format. A subsequent conversion of the termcap file back into terminfo format will not necessarily reproduce theoriginal terminfo source.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 %iq ANSI standard, vt100%p1%?%'x'%>%t%p1%'y'%+%; %>xy concept%p2 is printed before %p1 %r hpUse= Option [-u]The -u option produces a terminfo source description of the first terminal termname which is relative to the sum of the descriptionsgiven by the entries for the other terminals termnames. It does this by analyzing the differences between the first termname and theother termnames and producing a description with use= fields for the other terminals. In this manner, it is possible to retrofitgeneric terminfo entries into a terminal's description. Or, if two similar terminals exist, but were coded at different times or bydifferent people so that each description is a full description, using infocmp will show what can be done to change one descriptionto be relative to the other.A capability will get printed with an at-sign (@) if it no longer exists in the first termname, but one of the other termname entriescontains a value for it. A capability's value gets printed if the value in the first termname is not found in any of the othertermname entries, or if the first of the other termname entries that has this capability gives a different value for the capabilitythan that in the first termname.The order of the other termname entries is significant. Since the terminfo compiler tic does a left-to-right scan of the capabili‐ties, specifying two use= entries that contain differing entries for the same capabilities will produce different results dependingon the order that the entries are given in. infocmp will flag any such inconsistencies between the other termname entries as theyare found.Alternatively, specifying a capability after a use= entry that contains that capability will cause the second specification to beignored. Using infocmp to recreate a description can be a useful check to make sure that everything was specified correctly in theoriginal source description.Another error that does not cause incorrect compiled files, but will slow down the compilation time, is specifying extra use= fieldsthat are superfluous. infocmp will flag any other termname use= fields that were not needed.Changing Databases [-A directory] [-B directory]Like other ncurses utilities, infocmp looks for the terminal descriptions in several places. You can use the TERMINFO and TER‐MINFO_DIRS environment variables to override the compiled-in default list of places to search (see curses(3X) for details).You can also use the options -A and -B to override the list of places to search when comparing terminal descriptions:· The -A option sets the location for the first termname· The -B option sets the location for the other termnames.Using these options, it is possible to compare descriptions for a terminal with the same name located in two different databases.For instance, you can use this feature for comparing descriptions for the same terminal created by different people.Other Options
infocmp -K ...
-0
causes the fields to be printed on one line, without wrapping.
infocmp -0 ...
-D
tells infocmp to print the database locations that it knows about, and exit.
infocmp -D ...
-f
Display complex terminfo strings which contain if/then/else/endif expressions indented for readability.
infocmp -f ...
-G
Display constant literals in decimal form rather than their character equivalents.
infocmp -G ...
-g
Display constant character literals in quoted form rather than their decimal equivalents.
infocmp -g ...
-l
Set output format to terminfo.
infocmp -l ...
-p
Ignore padding specifications when comparing strings.
infocmp -p ...
-q
· Make the comparison listing shorter by omitting subheadings, and using “-” for absent capabilities, “@” for canceled ratherthan “NULL”.· However, show differences between absent and cancelled capabilities.· Omit the “Reconstructed from” comment for source listings.
infocmp -q ...
-Rsubset
Restrict output to a given subset. This option is for use with archaic versions of terminfo like those on SVr1, Ultrix, orHP/UX that do not support the full set of SVR4/XSI Curses terminfo; and variants such as AIX that have their own extensionsincompatible with SVr4/XSI.· Available terminfo subsets are “SVr1”, “Ultrix”, “HP”, and “AIX”; see terminfo(5) for details.· You can also choose the subset “BSD” which selects only capabilities with termcap equivalents recognized by 4.4BSD. The -Coption sets the “BSD” subset as a side-effect.· If you select any other value for -R, it is the same as no subset, i.e., all capabilities are used. The -I option likewiseselects no subset as a side-effect.
infocmp -Rsubset ...
-s
The -s option sorts the fields within each type according to the argument below:d leave fields in the order that they are stored in the terminfo database.i sort by terminfo name.l sort by the long C variable name.c sort by the termcap name.If the -s option is not given, the fields printed out will be 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 variablename, respectively.
infocmp -s ...
-V
reports the version of ncurses which was used in this program, and exits.
infocmp -V ...
-v
The optional parameter n is a number from 1 to 10, inclusive, indicating the desired level of detail of information. If ncursesis built without tracing support, the optional parameter is ignored.
infocmp -v ...
-W
the -w option will not force long strings to be wrapped. Use the -W option to do this.
infocmp -W ...
-w
changes the output to width characters.
infocmp -w ...
-x
print information for user-defined capabilities. These are extensions to the terminfo repertoire which can be loaded using the
infocmp -x ...