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
18       binary 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
34       ·   F for missing boolean variables
35
36       ·   NULL 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
84       information,  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
92       often  however,  you  must  help  the  termcap implementation, and trim
93       excess 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
98       optional.
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  get  printed  with  an at-sign (@) if it no longer
143       exists in the first termname, but one of  the  other  termname  entries
144       contains  a  value  for  it.   A capability's value gets printed if the
145       value in the first termname is not found in any of the  other  termname
146       entries,  or  if  the first of the other termname entries that has this
147       capability gives a different value for the capability than that in  the
148       first termname.
149
150       The order of the other termname entries is significant.  Since the ter‐
151       minfo compiler tic does a left-to-right scan of the capabilities, spec‐
152       ifying  two  use=  entries  that contain differing entries for the same
153       capabilities will produce different results depending on the order that
154       the  entries  are given in.  infocmp will flag any such inconsistencies
155       between the other termname entries as they are found.
156
157       Alternatively, specifying a capability after a use= entry that contains
158       that  capability  will  cause  the  second specification to be ignored.
159       Using infocmp to recreate a description can be a useful check  to  make
160       sure  that  everything  was  specified correctly in the original source
161       description.
162
163       Another error that does not cause incorrect compiled  files,  but  will
164       slow  down  the  compilation time, is specifying extra use= fields that
165       are superfluous.  infocmp will flag any other termname use= fields that
166       were not needed.
167
168   Changing Databases [-A directory] [-B directory]
169       Like  other  ncurses utilities, infocmp looks for the terminal descrip‐
170       tions in several places.  You can use the  TERMINFO  and  TERMINFO_DIRS
171       environment  variables  to  override  the  compiled-in  default list of
172       places to search (see curses(3X) for details).
173
174       You can also use the options -A and -B to override the list  of  places
175       to search when comparing terminal descriptions:
176
177       ·   The -A option sets the location for the first termname
178
179       ·   The -B option sets the location for the other termnames.
180
181       Using  these options, it is possible to compare descriptions for a ter‐
182       minal with the same name  located  in  two  different  databases.   For
183       instance,  you  can use this feature for comparing descriptions for the
184       same terminal created by different people.
185
186   Other Options
187       -0   causes the fields to be printed on one line, without wrapping.
188
189       -1   causes the fields to be printed out one to a line.  Otherwise, the
190            fields  will be printed several to a line to a maximum width of 60
191            characters.
192
193       -a   tells infocmp to retain  commented-out  capabilities  rather  than
194            discarding  them.   Capabilities  are  commented by prefixing them
195            with a period.
196
197       -D   tells infocmp to print the database locations that it knows about,
198            and exit.
199
200       -E   Dump  the  capabilities of the given terminal as tables, needed in
201            the C initializer for a TERMTYPE structure (the terminal  capabil‐
202            ity structure in the <term.h>).  This option is useful for prepar‐
203            ing versions of the curses library hardwired for a given  terminal
204            type.  The tables are all declared static, and are named according
205            to the type and the name of the corresponding terminal entry.
206
207            Before ncurses 5.0, the split between the -e and  -E  options  was
208            not  needed;  but  support  for extended names required making the
209            arrays of terminal capabilities separate from the TERMTYPE  struc‐
210            ture.
211
212       -e   Dump the capabilities of the given terminal as a C initializer for
213            a TERMTYPE structure (the terminal  capability  structure  in  the
214            <term.h>).   This  option  is useful for preparing versions of the
215            curses library hardwired for a given terminal type.
216
217       -F   compare terminfo files.  This assumes that two following arguments
218            are  filenames.   The  files  are  searched  for  pairwise matches
219            between entries, with two entries considered to match  if  any  of
220            their  names  do.   The  report  printed  to standard output lists
221            entries with no matches in the other file, and entries  with  more
222            than  one match.  For entries with exactly one match it includes a
223            difference report.  Normally, to reduce the volume of the  report,
224            use  references  are  not resolved before looking for differences,
225            but resolution can be forced by also specifying -r.
226
227       -f   Display complex terminfo strings which contain  if/then/else/endif
228            expressions indented for readability.
229
230       -G   Display  constant literals in decimal form rather than their char‐
231            acter equivalents.
232
233       -g   Display constant character literals in  quoted  form  rather  than
234            their decimal equivalents.
235
236       -i   Analyze  the  initialization (is1, is2, is3), and reset (rs1, rs2,
237            rs3), strings in the entry, as  well  as  those  used  for  start‐
238            ing/stopping  cursor-positioning  mode  (smcup,  rmcup) as well as
239            starting/stopping keymap mode (smkx, rmkx).
240
241            For each string, the code tries to  analyze  it  into  actions  in
242            terms  of  the  other capabilities in the entry, certain X3.64/ISO
243            6429/ECMA-48 capabilities, and certain DEC VT-series private modes
244            (the  set  of  recognized  special sequences has been selected for
245            completeness over the existing terminfo  database).   Each  report
246            line  consists  of  the  capability  name, followed by a colon and
247            space, followed by a printable expansion of the capability  string
248            with   sections   matching   recognized  actions  translated  into
249            {}-bracketed descriptions.
250
251            Here is a list of the DEC/ANSI special sequences recognized:
252
253                         Action        Meaning
254                         ─────────────────────────────────────────
255                         RIS           full reset
256                         SC            save cursor
257                         RC            restore cursor
258                         LL            home-down
259                         RSR           reset scroll region
260                         ─────────────────────────────────────────
261                         DECSTR        soft reset (VT320)
262                         S7C1T         7-bit controls (VT220)
263                         ─────────────────────────────────────────
264
265                         ISO DEC G0    enable DEC graphics for G0
266                         ISO UK G0     enable UK chars for G0
267                         ISO US G0     enable US chars for G0
268                         ISO DEC G1    enable DEC graphics for G1
269                         ISO UK G1     enable UK chars for G1
270                         ISO US G1     enable US chars for G1
271                         ─────────────────────────────────────────
272                         DECPAM        application keypad mode
273                         DECPNM        normal keypad mode
274                         DECANSI       enter ANSI mode
275                         ─────────────────────────────────────────
276                         ECMA[+-]AM    keyboard action mode
277                         ECMA[+-]IRM   insert replace mode
278                         ECMA[+-]SRM   send receive mode
279                         ECMA[+-]LNM   linefeed mode
280                         ─────────────────────────────────────────
281                         DEC[+-]CKM    application cursor keys
282                         DEC[+-]ANM    set VT52 mode
283                         DEC[+-]COLM   132-column mode
284                         DEC[+-]SCLM   smooth scroll
285                         DEC[+-]SCNM   reverse video mode
286                         DEC[+-]OM     origin mode
287                         DEC[+-]AWM    wraparound mode
288                         DEC[+-]ARM    auto-repeat mode
289
290            It  also  recognizes  a  SGR  action  corresponding  to   ANSI/ISO
291            6429/ECMA  Set  Graphics  Rendition, with the values NORMAL, BOLD,
292            UNDERLINE, BLINK, and REVERSE.  All but  NORMAL  may  be  prefixed
293            with
294
295            ·   “+” (turn on) or
296
297            ·   “-” (turn off).
298
299            An  SGR0  designates  an  empty  highlight sequence (equivalent to
300            {SGR:NORMAL}).
301
302       -l   Set output format to terminfo.
303
304       -p   Ignore padding specifications when comparing strings.
305
306       -Q n Rather than show source in terminfo (text) format, print the  com‐
307            piled  (binary) format in hexadecimal or base64 form, depending on
308            the option's value:
309
310               1  hexadecimal
311
312               2  base64
313
314               3  hexadecimal and base64
315
316            For example, this prints the compiled terminfo value as  a  string
317            which could be assigned to the TERMINFO environment variable:
318
319                infocmp -0 -q -Q2
320
321       -q   This makes the output a little shorter:
322
323            ·   Make  the  comparison listing shorter by omitting subheadings,
324                and using “-” for absent capabilities, “@” for canceled rather
325                than “NULL”.
326
327            ·   However,  show  differences between absent and cancelled capa‐
328                bilities.
329
330            ·   Omit the “Reconstructed from” comment for source listings.
331
332       -Rsubset
333            Restrict output to a given subset.  This option is  for  use  with
334            archaic  versions of terminfo like those on SVr1, Ultrix, or HP/UX
335            that do not support the full set of SVR4/XSI Curses terminfo;  and
336            variants  such  as AIX that have their own extensions incompatible
337            with SVr4/XSI.
338
339            ·   Available terminfo subsets are  “SVr1”,  “Ultrix”,  “HP”,  and
340                “AIX”; see terminfo(5) for details.
341
342            ·   You  can also choose the subset “BSD” which selects only capa‐
343                bilities with termcap equivalents recognized by  4.4BSD.   The
344                -C option sets the “BSD” subset as a side-effect.
345
346            ·   If  you  select  any  other value for -R, it is the same as no
347                subset, i.e., all capabilities are used.  The -I option  like‐
348                wise selects no subset as a side-effect.
349
350       -s [d|i|l|c]
351            The  -s  option sorts the fields within each type according to the
352            argument below:
353
354            d    leave fields in the order that they are stored  in  the  ter‐
355                 minfo database.
356
357            i    sort by terminfo name.
358
359            l    sort by the long C variable name.
360
361            c    sort by the termcap name.
362
363            If  the  -s  option  is  not given, the fields printed out will be
364            sorted alphabetically by  the  terminfo  name  within  each  type,
365            except  in  the  case of the -C or the -L options, which cause the
366            sorting to be done by the termcap name  or  the  long  C  variable
367            name, respectively.
368
369       -T   eliminates  size-restrictions  on  the  generated  text.   This is
370            mainly  useful  for  testing  and  analysis,  since  the  compiled
371            descriptions  are  limited  (e.g., 1023 for termcap, 4096 for ter‐
372            minfo).
373
374       -t   tells tic to discard commented-out  capabilities.   Normally  when
375            translating  from terminfo to termcap, untranslatable capabilities
376            are commented-out.
377
378       -U   tells infocmp to not  post-process  the  data  after  parsing  the
379            source  file.   This  feature helps when comparing the actual con‐
380            tents of two source files, since it excludes the  inferences  that
381            infocmp makes to fill in missing data.
382
383       -V   reports the version of ncurses which was used in this program, and
384            exits.
385
386       -v n prints out tracing information on standard error  as  the  program
387            runs.
388
389            The  optional  parameter  n  is  a number from 1 to 10, inclusive,
390            indicating the desired level of detail of information.  If ncurses
391            is  built  without  tracing  support,  the  optional  parameter is
392            ignored.
393
394       -W   By itself, the -w  option  will  not  force  long  strings  to  be
395            wrapped.  Use the -W option to do this.
396
397       -w width
398            changes the output to width characters.
399
400       -x   print information for user-defined capabilities.  These are exten‐
401            sions to the terminfo repertoire which can be loaded using the  -x
402            option of tic.
403

FILES

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

EXTENSIONS

408       The  -0, -1, -E, -F, -G, -Q, -R, -T, -V, -a, -e, -f, -g, -i, -l, -p, -q
409       and -t options are not supported in SVr4 curses.
410
411       SVr4 infocmp does not distinguish between absent and cancelled capabil‐
412       ities.  Also, it shows missing integer capabilities as -1 (the internal
413       value used to represent missing integers).  This  implementation  shows
414       those as “NULL”, for consistency with missing strings.
415
416       The  -r  option's  notion of “termcap” capabilities is System V Release
417       4's.  Actual BSD curses versions will have a more restricted  set.   To
418       see only the 4.4BSD set, use -r -RBSD.
419

BUGS

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

SEE ALSO

424       captoinfo(1M),   infotocap(1M),   tic(1M),  toe(1M),  curses(3X),  ter‐
425       minfo(5).
426
427       https://invisible-island.net/ncurses/tctest.html
428
429       This describes ncurses version 6.1 (patch 20180923).
430

AUTHOR

432       Eric S. Raymond <esr@snark.thyrsus.com> and
433       Thomas E. Dickey <dickey@invisible-island.net>
434
435
436
437                                                                   infocmp(1M)
Impressum