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

NAME

6       infocmp - compare or print out terminfo descriptions
7

SYNOPSIS

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

FILES

315       /usr/share/terminfo Compiled terminal description database.
316

EXTENSIONS

318       The  -E,  -F,  -G,  -R,  -T,  -V, -a, -e, -f, -g, -i, -l, -p, -q and -t
319       options are not supported in SVr4 curses.
320
321       The -r option's notion of `termcap' capabilities is  System  V  Release
322       4's.   Actual  BSD curses versions will have a more restricted set.  To
323       see only the 4.4BSD set, use -r -RBSD.
324

BUGS

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

SEE ALSO

329       captoinfo(1M),  infotocap(1M),  tic(1M),  toe(1M),   curses(3X),   ter‐
330       minfo(5).
331
332       This describes ncurses version 5.6 (patch 20070812).
333

AUTHOR

335       Eric S. Raymond <esr@snark.thyrsus.com> and
336       Thomas E. Dickey <dickey@invisible-island.net>
337
338
339
340                                                                   infocmp(1M)
Impressum