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

NAME

6       infocmp - compare or print out terminfo descriptions
7

SYNOPSIS

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

FILES

340       /usr/share/terminfo Compiled terminal description database.
341

EXTENSIONS

343       The -0, -1, -E, -F, -G, -R, -T, -V, -a, -e, -f, -g, -i, -l, -p, -q  and
344       -t options are not supported in SVr4 curses.
345
346       The  -r  option's  notion of `termcap' capabilities is System V Release
347       4's.  Actual BSD curses versions will have a more restricted  set.   To
348       see only the 4.4BSD set, use -r -RBSD.
349

BUGS

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

SEE ALSO

354       captoinfo(1M),   infotocap(1M),   tic(1M),  toe(1M),  curses(3X),  ter‐
355       minfo(5).
356
357       http://invisible-island.net/ncurses/tctest.html
358
359       This describes ncurses version 5.9 (patch 20130511).
360

AUTHOR

362       Eric S. Raymond <esr@snark.thyrsus.com> and
363       Thomas E. Dickey <dickey@invisible-island.net>
364
365
366
367                                                                   infocmp(1M)
Impressum