1infocmp(1M)                                                        infocmp(1M)
2
3
4

NAME

6       infocmp - compare or print out terminfo descriptions
7

SYNOPSIS

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

DESCRIPTION

15       infocmp  can be used to compare a binary terminfo entry with other ter‐
16       minfo entries, rewrite a terminfo description to take advantage of  the
17       use=  terminfo  field, or print out a terminfo description from the bi‐
18       nary file (term) in a variety of formats.  In all  cases,  the  boolean
19       fields  will be printed first, followed by the numeric fields, followed
20       by the string fields.
21
22   Default Options
23       If no options are specified and zero or one  termnames  are  specified,
24       the -I option will be assumed.  If more than one termname is specified,
25       the -d option will be assumed.
26
27   Comparison Options [-d] [-c] [-n]
28       infocmp  compares  the  terminfo  description  of  the  first  terminal
29       termname  with  each  of  the descriptions given by the entries for the
30       other terminal's termnames.  If a capability is defined for only one of
31       the  terminals,  the value returned depends on the type of the capabil‐
32       ity:
33
34F for missing boolean variables
35
36NULL for missing integer or string variables
37
38       Use the -q option to show the distinction between absent and  cancelled
39       capabilities.
40
41       These  options  produce a list which you can use to compare two or more
42       terminal descriptions:
43
44       -d   produces a list of each capability that is different  between  two
45            entries.   Each  item  in  the list shows “:” after the capability
46            name, followed by the capability values, separated by a comma.
47
48       -c   produces a list of each capability that is common between  two  or
49            more entries.  Missing capabilities are ignored.  Each item in the
50            list shows “=” after the capability name, followed by the capabil‐
51            ity value.
52
53            The  -u option provides a related output, showing the first termi‐
54            nal description rewritten to use the second as  a  building  block
55            via the “use=” clause.
56
57       -n   produces  a  list  of each capability that is in none of the given
58            entries.  Each item in the list shows “!”  before  the  capability
59            name.
60
61            Normally only the conventional capabilities are shown.  Use the -x
62            option to add the BSD-compatibility capabilities  (names  prefixed
63            with “OT”).
64
65            If  no  termnames are given, infocmp uses the environment variable
66            TERM for each of the termnames.
67
68   Source Listing Options [-I] [-L] [-C] [-r]
69       The -I, -L, and -C options will produce a source listing for each  ter‐
70       minal named.
71
72            -I   use the terminfo names
73            -L   use the long C variable name listed in <term.h>
74            -C   use the termcap names
75            -r   when using -C, put out all capabilities in termcap form
76            -K   modifies the -C option, improving BSD-compatibility.
77
78       If  no  termnames are given, the environment variable TERM will be used
79       for the terminal name.
80
81       The source produced by the -C option may be used directly as a  termcap
82       entry,  but not all parameterized strings can be changed to the termcap
83       format.  infocmp will attempt to convert most of the parameterized  in‐
84       formation,  and  anything  not  converted will be plainly marked in the
85       output and commented out.  These should be edited by hand.
86
87       For best results when converting to termcap format, you should use both
88       -C  and  -r.   Normally a termcap description is limited to 1023 bytes.
89       infocmp trims away less essential parts to make it  fit.   If  you  are
90       converting to one of the (rare) termcap implementations which accept an
91       unlimited size of termcap, you may want to add the -T option.  More of‐
92       ten  however, you must help the termcap implementation, and trim excess
93       whitespace (use the -0 option for that).
94
95       All padding information for strings  will  be  collected  together  and
96       placed at the beginning of the string where termcap expects it.  Manda‐
97       tory padding (padding information with a trailing “/”) will become  op‐
98       tional.
99
100       All  termcap  variables  no longer supported by terminfo, but which are
101       derivable from other terminfo variables, will be output.  Not all  ter‐
102       minfo  capabilities will be translated; only those variables which were
103       part of termcap will normally be output.  Specifying the -r option will
104       take  off  this  restriction, allowing all capabilities to be output in
105       termcap form.  Normally you would use both the -C and -r options.   The
106       actual  format  used incorporates some improvements for escaped charac‐
107       ters from terminfo format.  For a stricter BSD-compatible  translation,
108       use the -K option rather than -C.
109
110       Note that because padding is collected to the beginning of the capabil‐
111       ity, not all capabilities are output.  Mandatory padding  is  not  sup‐
112       ported.   Because termcap strings are not as flexible, it is not always
113       possible to convert a terminfo string  capability  into  an  equivalent
114       termcap  format.  A subsequent conversion of the termcap file back into
115       terminfo format will not necessarily reproduce  the  original  terminfo
116       source.
117
118       Some  common  terminfo  parameter sequences, their termcap equivalents,
119       and some terminal types which commonly have such sequences, are:
120
121           terminfo                    termcap   Representative Terminals
122           ───────────────────────────────────────────────────────────────
123           %p1%c                       %.        adm
124           %p1%d                       %d        hp, ANSI standard, vt100
125           %p1%'x'%+%c                 %+x       concept
126           %i                          %iq       ANSI standard, vt100
127           %p1%?%'x'%>%t%p1%'y'%+%;    %>xy      concept
128           %p2 is printed before %p1   %r        hp
129
130   Use= Option [-u]
131       The -u option produces a terminfo source description of the first  ter‐
132       minal  termname  which is relative to the sum of the descriptions given
133       by the entries for the other terminals termnames.  It does this by ana‐
134       lyzing  the  differences  between  the  first  termname  and  the other
135       termnames and producing a description with use= fields  for  the  other
136       terminals.  In this manner, it is possible to retrofit generic terminfo
137       entries into a terminal's description.  Or, if  two  similar  terminals
138       exist, but were coded at different times or by different people so that
139       each description is a full description, using infocmp  will  show  what
140       can be done to change one description to be relative to the other.
141
142       A capability will be printed with an at-sign (@) if it no longer exists
143       in the first termname, but one of the other termname entries contains a
144       value for it.  A capability's value will be printed if the value in the
145       first termname is not found in any of the other termname entries, or if
146       the  first of the other termname entries that has this capability gives
147       a different value for the capability than that in the first termname.
148
149       The order of the other termname entries is significant.  Since the ter‐
150       minfo compiler tic does a left-to-right scan of the capabilities, spec‐
151       ifying two use= entries that contain differing entries for the same ca‐
152       pabilities  will  produce different results depending on the order that
153       the entries are given in.  infocmp will flag any  such  inconsistencies
154       between the other termname entries as they are found.
155
156       Alternatively, specifying a capability after a use= entry that contains
157       that capability will cause the second specification to be ignored.  Us‐
158       ing  infocmp  to  recreate  a description can be a useful check to make
159       sure that everything was specified correctly in the original source de‐
160       scription.
161
162       Another  error  that  does not cause incorrect compiled files, but will
163       slow down the compilation time, is specifying extra  use=  fields  that
164       are superfluous.  infocmp will flag any other termname use= fields that
165       were not needed.
166
167   Changing Databases [-A directory] [-B directory]
168       Like other ncurses utilities, infocmp looks for the  terminal  descrip‐
169       tions  in  several  places.  You can use the TERMINFO and TERMINFO_DIRS
170       environment variables to  override  the  compiled-in  default  list  of
171       places to search (see curses(3X) for details).
172
173       You  can  also use the options -A and -B to override the list of places
174       to search when comparing terminal descriptions:
175
176       •   The -A option sets the location for the first termname
177
178       •   The -B option sets the location for the other termnames.
179
180       Using these options, it is possible to compare descriptions for a  ter‐
181       minal  with  the same name located in two different databases.  For in‐
182       stance, you can use this feature for  comparing  descriptions  for  the
183       same terminal created by different people.
184
185   Other Options
186       -0   causes the fields to be printed on one line, without wrapping.
187
188       -1   causes the fields to be printed out one to a line.  Otherwise, the
189            fields will be printed several to a line to a maximum width of  60
190            characters.
191
192       -a   tells  infocmp  to  retain  commented-out capabilities rather than
193            discarding them.  Capabilities are  commented  by  prefixing  them
194            with a period.
195
196       -D   tells infocmp to print the database locations that it knows about,
197            and exit.
198
199       -E   Dump the capabilities of the given terminal as tables,  needed  in
200            the  C initializer for a TERMTYPE structure (the terminal capabil‐
201            ity structure in the <term.h>).  This option is useful for prepar‐
202            ing  versions of the curses library hardwired for a given terminal
203            type.  The tables are all declared static, and are named according
204            to the type and the name of the corresponding terminal entry.
205
206            Before  ncurses  5.0,  the split between the -e and -E options was
207            not needed; but support for extended names required making the ar‐
208            rays  of  terminal  capabilities separate from the TERMTYPE struc‐
209            ture.
210
211       -e   Dump the capabilities of the given terminal as a C initializer for
212            a  TERMTYPE  structure  (the  terminal capability structure in the
213            <term.h>).  This option is useful for preparing  versions  of  the
214            curses library hardwired for a given terminal type.
215
216       -F   compare terminfo files.  This assumes that two following arguments
217            are filenames.  The files are searched for  pairwise  matches  be‐
218            tween  entries,  with  two  entries  considered to match if any of
219            their names do.  The report printed to standard output  lists  en‐
220            tries  with  no  matches  in the other file, and entries with more
221            than one match.  For entries with exactly one match it includes  a
222            difference  report.  Normally, to reduce the volume of the report,
223            use references are not resolved before  looking  for  differences,
224            but resolution can be forced by also specifying -r.
225
226       -f   Display  complex terminfo strings which contain if/then/else/endif
227            expressions indented for readability.
228
229       -G   Display constant literals in decimal form rather than their  char‐
230            acter equivalents.
231
232       -g   Display  constant  character  literals  in quoted form rather than
233            their decimal equivalents.
234
235       -i   Analyze the initialization (is1, is2, is3), and reset  (rs1,  rs2,
236            rs3),  strings  in  the  entry,  as  well as those used for start‐
237            ing/stopping cursor-positioning mode (smcup,  rmcup)  as  well  as
238            starting/stopping keymap mode (smkx, rmkx).
239
240            For  each  string,  the  code  tries to analyze it into actions in
241            terms of the other capabilities in the  entry,  certain  X3.64/ISO
242            6429/ECMA-48 capabilities, and certain DEC VT-series private modes
243            (the set of recognized special sequences  has  been  selected  for
244            completeness  over  the  existing terminfo database).  Each report
245            line consists of the capability name,  followed  by  a  colon  and
246            space,  followed by a printable expansion of the capability string
247            with  sections  matching  recognized   actions   translated   into
248            {}-bracketed descriptions.
249
250            Here is a list of the DEC/ANSI special sequences recognized:
251
252                         Action        Meaning
253                         ─────────────────────────────────────────
254                         RIS           full reset
255                         SC            save cursor
256                         RC            restore cursor
257                         LL            home-down
258                         RSR           reset scroll region
259                         ─────────────────────────────────────────
260                         DECSTR        soft reset (VT320)
261                         S7C1T         7-bit controls (VT220)
262                         ─────────────────────────────────────────
263                         ISO DEC G0    enable DEC graphics for G0
264
265                         ISO UK G0     enable UK chars for G0
266                         ISO US G0     enable US chars for G0
267                         ISO DEC G1    enable DEC graphics for G1
268                         ISO UK G1     enable UK chars for G1
269                         ISO US G1     enable US chars for G1
270                         ─────────────────────────────────────────
271                         DECPAM        application keypad mode
272                         DECPNM        normal keypad mode
273                         DECANSI       enter ANSI mode
274                         ─────────────────────────────────────────
275                         ECMA[+-]AM    keyboard action mode
276                         ECMA[+-]IRM   insert replace mode
277                         ECMA[+-]SRM   send receive mode
278                         ECMA[+-]LNM   linefeed mode
279                         ─────────────────────────────────────────
280                         DEC[+-]CKM    application cursor keys
281                         DEC[+-]ANM    set VT52 mode
282                         DEC[+-]COLM   132-column mode
283                         DEC[+-]SCLM   smooth scroll
284                         DEC[+-]SCNM   reverse video mode
285                         DEC[+-]OM     origin mode
286                         DEC[+-]AWM    wraparound mode
287                         DEC[+-]ARM    auto-repeat mode
288
289            It   also  recognizes  a  SGR  action  corresponding  to  ANSI/ISO
290            6429/ECMA Set Graphics Rendition, with the  values  NORMAL,  BOLD,
291            UNDERLINE,  BLINK,  and  REVERSE.   All but NORMAL may be prefixed
292            with
293
294            •   “+” (turn on) or
295
296            •   “-” (turn off).
297
298            An SGR0 designates an  empty  highlight  sequence  (equivalent  to
299            {SGR:NORMAL}).
300
301       -l   Set output format to terminfo.
302
303       -p   Ignore padding specifications when comparing strings.
304
305       -Q n Rather  than show source in terminfo (text) format, print the com‐
306            piled (binary) format in hexadecimal or base64 form, depending  on
307            the option's value:
308
309               1  hexadecimal
310
311               2  base64
312
313               3  hexadecimal and base64
314
315            For  example,  this prints the compiled terminfo value as a string
316            which could be assigned to the TERMINFO environment variable:
317
318                infocmp -0 -q -Q2
319
320       -q   This makes the output a little shorter:
321
322            •   Make the comparison listing shorter by  omitting  subheadings,
323                and using “-” for absent capabilities, “@” for canceled rather
324                than “NULL”.
325
326            •   However, show differences between absent and  cancelled  capa‐
327                bilities.
328
329            •   Omit the “Reconstructed from” comment for source listings.
330
331       -Rsubset
332            Restrict  output  to  a given subset.  This option is for use with
333            archaic versions of terminfo like those on SVr1, Ultrix, or  HP/UX
334            that  do not support the full set of SVR4/XSI Curses terminfo; and
335            variants such as AIX that have their own  extensions  incompatible
336            with SVr4/XSI.
337
338            •   Available  terminfo  subsets  are  “SVr1”, “Ultrix”, “HP”, and
339                “AIX”; see terminfo(5) for details.
340
341            •   You can also choose the subset “BSD” which selects only  capa‐
342                bilities  with  termcap equivalents recognized by 4.4BSD.  The
343                -C option sets the “BSD” subset as a side-effect.
344
345            •   If you select any other value for -R, it is  the  same  as  no
346                subset,  i.e., all capabilities are used.  The -I option like‐
347                wise selects no subset as a side-effect.
348
349       -s [d|i|l|c]
350            The -s option sorts the fields within each type according  to  the
351            argument below:
352
353            d    leave  fields  in  the order that they are stored in the ter‐
354                 minfo database.
355
356            i    sort by terminfo name.
357
358            l    sort by the long C variable name.
359
360            c    sort by the termcap name.
361
362            If the -s option is not given, the  fields  printed  out  will  be
363            sorted  alphabetically  by the terminfo name within each type, ex‐
364            cept in the case of the -C or the  -L  options,  which  cause  the
365            sorting  to  be  done  by  the termcap name or the long C variable
366            name, respectively.
367
368       -T   eliminates size-restrictions  on  the  generated  text.   This  is
369            mainly  useful  for  testing  and analysis, since the compiled de‐
370            scriptions are limited (e.g., 1023  for  termcap,  4096  for  ter‐
371            minfo).
372
373       -t   tells  tic  to  discard commented-out capabilities.  Normally when
374            translating from terminfo to termcap, untranslatable  capabilities
375            are commented-out.
376
377       -U   tells  infocmp  to  not  post-process  the  data after parsing the
378            source file.  This feature helps when comparing  the  actual  con‐
379            tents  of  two source files, since it excludes the inferences that
380            infocmp makes to fill in missing data.
381
382       -V   reports the version of ncurses which was used in this program, and
383            exits.
384
385       -v n prints  out  tracing  information on standard error as the program
386            runs.
387
388            The optional parameter n is a number from 1 to 10, inclusive,  in‐
389            dicating  the  desired level of detail of information.  If ncurses
390            is built without tracing support, the optional  parameter  is  ig‐
391            nored.
392
393       -W   By  itself,  the  -w  option  will  not  force  long strings to be
394            wrapped.  Use the -W option to do this.
395
396       -w width
397            changes the output to width characters.
398
399       -x   print information for user-defined capabilities (see user_caps(5).
400            These  are  extensions  to  the  terminfo  repertoire which can be
401            loaded using the -x option of tic.
402

FILES

404       /usr/share/terminfo Compiled terminal description database.
405

HISTORY

407       Although System V Release 2 provided a terminfo library, it had no doc‐
408       umented  tool  for  decompiling the terminal descriptions.  Tony Hansen
409       (AT&T) wrote the first infocmp in early 1984, for System V Release 3.
410
411       Eric Raymond used the AT&T documentation in 1995 to provide an  equiva‐
412       lent  infocmp  for  ncurses.   In addition, he added a few new features
413       such as:
414
415       •   the -e option, to support fallback (compiled-in) terminal  descrip‐
416           tions
417
418       •   the -i option, to help with analysis
419
420       Later,  Thomas  Dickey added the -x (user-defined capabilities) option,
421       and the -E option to support fallback entries with  user-defined  capa‐
422       bilities.
423
424       For a complete list, see the EXTENSIONS section.
425
426       In  2010,  Roy  Marples  provided an infocmp program for NetBSD.  It is
427       less capable than the SVr4 or ncurses  versions  (e.g.,  it  lacks  the
428       sorting  options  documented in X/Open), but does include the -x option
429       adapted from ncurses.
430

PORTABILITY

432       X/Open Curses, Issue 7 (2009) provides a description  of  infocmp.   It
433       does not mention the options used for converting to termcap format.
434

EXTENSIONS

436       The  -0, -1, -E, -F, -G, -Q, -R, -T, -V, -a, -e, -f, -g, -i, -l, -p, -q
437       and -t options are not supported in SVr4 curses.
438
439       SVr4 infocmp does not distinguish between absent and cancelled capabil‐
440       ities.  Also, it shows missing integer capabilities as -1 (the internal
441       value used to represent missing integers).  This  implementation  shows
442       those as “NULL”, for consistency with missing strings.
443
444       The  -r  option's  notion of “termcap” capabilities is System V Release
445       4's.  Actual BSD curses versions will have a more restricted  set.   To
446       see only the 4.4BSD set, use -r -RBSD.
447

BUGS

449       The -F option of infocmp(1M) should be a toe(1M) mode.
450

SEE ALSO

452       captoinfo(1M),   infotocap(1M),   tic(1M),  toe(1M),  curses(3X),  ter‐
453       minfo(5).  user_caps(5).
454
455       https://invisible-island.net/ncurses/tctest.html
456
457       This describes ncurses version 6.2 (patch 20210508).
458

AUTHOR

460       Eric S. Raymond <esr@snark.thyrsus.com> and
461       Thomas E. Dickey <dickey@invisible-island.net>
462
463
464
465                                                                   infocmp(1M)
Impressum