1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
4 ****************************************************************************
5 * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
7 * Permission is hereby granted, free of charge, to any person obtaining a *
8 * copy of this software and associated documentation files (the *
9 * "Software"), to deal in the Software without restriction, including *
10 * without limitation the rights to use, copy, modify, merge, publish, *
11 * distribute, distribute with modifications, sublicense, and/or sell *
12 * copies of the Software, and to permit persons to whom the Software is *
13 * furnished to do so, subject to the following conditions: *
15 * The above copyright notice and this permission notice shall be included *
16 * in all copies or substantial portions of the Software. *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
21 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
24 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
26 * Except as contained in this notice, the name(s) of the above copyright *
27 * holders shall not be used in advertising or otherwise to promote the *
28 * sale, use or other dealings in this Software without prior written *
30 ****************************************************************************
31 * @Id: infocmp.1m,v 1.53 2013/02/02 22:07:35 tom Exp @
35 <TITLE>infocmp 1m</TITLE>
36 <link rev=made href="mailto:bug-ncurses@gnu.org">
37 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
43 <!-- Manpage converted by man2html 3.0.1 -->
44 <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG> <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>
51 <STRONG>infocmp</STRONG> - compare or print out <EM>terminfo</EM> descriptions
55 <H2>SYNOPSIS</H2><PRE>
56 <STRONG>infocmp</STRONG> [<STRONG>-1CDEFGIKLTUVcdegilnpqrtux</STRONG>]
57 [<STRONG>-v</STRONG> <EM>n</EM>] [<STRONG>-s</STRONG> <STRONG>d</STRONG>| <STRONG>i</STRONG>| <STRONG>l</STRONG>| <STRONG>c</STRONG>] [<STRONG>-R</STRONG> <STRONG>subset</STRONG>]
58 [<STRONG>-w</STRONG> <EM>width</EM>] [<STRONG>-A</STRONG> <EM>directory</EM>] [<STRONG>-B</STRONG> <EM>directory</EM>]
59 [<EM>termname</EM>...]
63 <H2>DESCRIPTION</H2><PRE>
64 <STRONG>infocmp</STRONG> can be used to compare a binary <STRONG>terminfo</STRONG> entry
65 with other terminfo entries, rewrite a <STRONG>terminfo</STRONG> descrip-
66 tion to take advantage of the <STRONG>use=</STRONG> terminfo field, or
67 print out a <STRONG>terminfo</STRONG> description from the binary file
68 (<STRONG>term</STRONG>) in a variety of formats. In all cases, the boolean
69 fields will be printed first, followed by the numeric
70 fields, followed by the string fields.
72 <STRONG>Default</STRONG> <STRONG>Options</STRONG>
73 If no options are specified and zero or one <EM>termnames</EM> are
74 specified, the <STRONG>-I</STRONG> option will be assumed. If more than
75 one <EM>termname</EM> is specified, the <STRONG>-d</STRONG> option will be assumed.
77 <STRONG>Comparison</STRONG> <STRONG>Options</STRONG> <STRONG>[-d]</STRONG> <STRONG>[-c]</STRONG> <STRONG>[-n]</STRONG>
78 <STRONG>infocmp</STRONG> compares the <STRONG>terminfo</STRONG> description of the first
79 terminal <EM>termname</EM> with each of the descriptions given by
80 the entries for the other terminal's <EM>termnames</EM>. If a
81 capability is defined for only one of the terminals, the
82 value returned will depend on the type of the capability:
83 <STRONG>F</STRONG> for boolean variables, <STRONG>-1</STRONG> for integer variables, and
84 <STRONG>NULL</STRONG> for string variables.
86 The <STRONG>-d</STRONG> option produces a list of each capability that is
87 different between two entries. This option is useful to
88 show the difference between two entries, created by dif-
89 ferent people, for the same or similar terminals.
91 The <STRONG>-c</STRONG> option produces a list of each capability that is
92 common between two or more entries. Capabilities that are
93 not set are ignored. This option can be used as a quick
94 check to see if the <STRONG>-u</STRONG> option is worth using.
96 The <STRONG>-n</STRONG> option produces a list of each capability that is
97 in none of the given entries. If no <EM>termnames</EM> are given,
98 the environment variable <STRONG>TERM</STRONG> will be used for both of the
99 <EM>termnames</EM>. This can be used as a quick check to see if
100 anything was left out of a description.
102 <STRONG>Source</STRONG> <STRONG>Listing</STRONG> <STRONG>Options</STRONG> <STRONG>[-I]</STRONG> <STRONG>[-L]</STRONG> <STRONG>[-C]</STRONG> <STRONG>[-r]</STRONG>
103 The <STRONG>-I</STRONG>, <STRONG>-L</STRONG>, and <STRONG>-C</STRONG> options will produce a source listing
104 for each terminal named.
106 <STRONG>-I</STRONG> use the <STRONG>terminfo</STRONG> names
107 <STRONG>-L</STRONG> use the long C variable name listed in <<STRONG>term.h</STRONG>>
108 <STRONG>-C</STRONG> use the <STRONG>termcap</STRONG> names
109 <STRONG>-r</STRONG> when using <STRONG>-C</STRONG>, put out all capabilities in <STRONG>termcap</STRONG> form
110 <STRONG>-K</STRONG> modifies the <STRONG>-C</STRONG> option, improving BSD-compatibility.
112 If no <EM>termnames</EM> are given, the environment variable <STRONG>TERM</STRONG>
113 will be used for the terminal name.
115 The source produced by the <STRONG>-C</STRONG> option may be used directly
116 as a <STRONG>termcap</STRONG> entry, but not all parameterized strings can
117 be changed to the <STRONG>termcap</STRONG> format. <STRONG>infocmp</STRONG> will attempt to
118 convert most of the parameterized information, and any-
119 thing not converted will be plainly marked in the output
120 and commented out. These should be edited by hand.
122 For best results when converting to <STRONG>termcap</STRONG> format, you
123 should use both <STRONG>-C</STRONG> and <STRONG>-r</STRONG>. Normally a termcap description
124 is limited to 1023 bytes. infocmp trims away less essen-
125 tial parts to make it fit. If you are converting to one
126 of the (rare) termcap implementations which accept an
127 unlimited size of termcap, you may want to add the <STRONG>-T</STRONG>
128 option. More often however, you must help the termcap
129 implementation, and trim excess whitespace (use the <STRONG>-0</STRONG>
132 All padding information for strings will be collected
133 together and placed at the beginning of the string where
134 <STRONG>termcap</STRONG> expects it. Mandatory padding (padding informa-
135 tion with a trailing '/') will become optional.
137 All <STRONG>termcap</STRONG> variables no longer supported by <STRONG>terminfo</STRONG>, but
138 which are derivable from other <STRONG>terminfo</STRONG> variables, will be
139 output. Not all <STRONG>terminfo</STRONG> capabilities will be translated;
140 only those variables which were part of <STRONG>termcap</STRONG> will nor-
141 mally be output. Specifying the <STRONG>-r</STRONG> option will take off
142 this restriction, allowing all capabilities to be output
143 in <EM>termcap</EM> form. Normally you would use both the <STRONG>-C</STRONG> and
144 <STRONG>-r</STRONG> options. The actual format used incorporates some
145 improvements for escaped characters from terminfo format.
146 For a stricter BSD-compatible translation, use the <STRONG>-K</STRONG>
147 option rather than <STRONG>-C</STRONG>.
149 Note that because padding is collected to the beginning of
150 the capability, not all capabilities are output. Manda-
151 tory padding is not supported. Because <STRONG>termcap</STRONG> strings
152 are not as flexible, it is not always possible to convert
153 a <STRONG>terminfo</STRONG> string capability into an equivalent <STRONG>termcap</STRONG>
154 format. A subsequent conversion of the <STRONG>termcap</STRONG> file back
155 into <STRONG>terminfo</STRONG> format will not necessarily reproduce the
156 original <STRONG>terminfo</STRONG> source.
158 Some common <STRONG>terminfo</STRONG> parameter sequences, their <STRONG>termcap</STRONG>
159 equivalents, and some terminal types which commonly have
162 <STRONG>terminfo</STRONG> <STRONG>termcap</STRONG> Representative Terminals
163 ---------------------------------------------------------------
164 <STRONG>%p1%c</STRONG> <STRONG>%.</STRONG> adm
165 <STRONG>%p1%d</STRONG> <STRONG>%d</STRONG> hp, ANSI standard, vt100
166 <STRONG>%p1%'x'%+%c</STRONG> <STRONG>%+x</STRONG> concept
167 <STRONG>%i</STRONG> <STRONG>%i</STRONG>q ANSI standard, vt100
168 <STRONG>%p1%?%'x'%>%t%p1%'y'%+%;</STRONG> <STRONG>%>xy</STRONG> concept
169 <STRONG>%p2</STRONG> is printed before <STRONG>%p1</STRONG> <STRONG>%r</STRONG> hp
171 <STRONG>Use=</STRONG> <STRONG>Option</STRONG> <STRONG>[-u]</STRONG>
172 The <STRONG>-u</STRONG> option produces a <STRONG>terminfo</STRONG> source description of
173 the first terminal <EM>termname</EM> which is relative to the sum
174 of the descriptions given by the entries for the other
175 terminals <EM>termnames</EM>. It does this by analyzing the dif-
176 ferences between the first <EM>termname</EM> and the other
177 <EM>termnames</EM> and producing a description with <STRONG>use=</STRONG> fields for
178 the other terminals. In this manner, it is possible to
179 retrofit generic terminfo entries into a terminal's
180 description. Or, if two similar terminals exist, but were
181 coded at different times or by different people so that
182 each description is a full description, using <STRONG>infocmp</STRONG> will
183 show what can be done to change one description to be rel-
186 A capability will get printed with an at-sign (@) if it no
187 longer exists in the first <EM>termname</EM>, but one of the other
188 <EM>termname</EM> entries contains a value for it. A capability's
189 value gets printed if the value in the first <EM>termname</EM> is
190 not found in any of the other <EM>termname</EM> entries, or if the
191 first of the other <EM>termname</EM> entries that has this capabil-
192 ity gives a different value for the capability than that
193 in the first <EM>termname</EM>.
195 The order of the other <EM>termname</EM> entries is significant.
196 Since the terminfo compiler <STRONG>tic</STRONG> does a left-to-right scan
197 of the capabilities, specifying two <STRONG>use=</STRONG> entries that con-
198 tain differing entries for the same capabilities will pro-
199 duce different results depending on the order that the
200 entries are given in. <STRONG>infocmp</STRONG> will flag any such incon-
201 sistencies between the other <EM>termname</EM> entries as they are
204 Alternatively, specifying a capability <EM>after</EM> a <STRONG>use=</STRONG> entry
205 that contains that capability will cause the second speci-
206 fication to be ignored. Using <STRONG>infocmp</STRONG> to recreate a
207 description can be a useful check to make sure that every-
208 thing was specified correctly in the original source
211 Another error that does not cause incorrect compiled
212 files, but will slow down the compilation time, is speci-
213 fying extra <STRONG>use=</STRONG> fields that are superfluous. <STRONG>infocmp</STRONG>
214 will flag any other <EM>termname</EM> <EM>use=</EM> fields that were not
217 <STRONG>Changing</STRONG> <STRONG>Databases</STRONG> <STRONG>[-A</STRONG> <EM>directory</EM>] [-B <EM>directory</EM>]
218 Like other <STRONG>ncurses</STRONG> utilities, infocmp looks for the termi-
219 nal descriptions in several places. You can use the <STRONG>TER-</STRONG>
220 <STRONG>MINFO</STRONG> and <STRONG>TERMINFO_DIRS</STRONG> environment variables to override
221 the compiled-in default list of places to search (see
222 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> for details).
224 You can also use the options <STRONG>-A</STRONG> and <STRONG>-B</STRONG> to override the
225 list of places to search when comparing terminal descrip-
228 <STRONG>o</STRONG> The <STRONG>-A</STRONG> option sets the location for the first <EM>termname</EM>
230 <STRONG>o</STRONG> The <STRONG>-B</STRONG> option sets the location for the other
233 Using these options, it is possible to compare descrip-
234 tions for a terminal with the same name located in two
235 different databases. For instance, you can use this fea-
236 ture for comparing descriptions for the same terminal cre-
237 ated by different people.
239 <STRONG>Other</STRONG> <STRONG>Options</STRONG>
240 <STRONG>-0</STRONG> causes the fields to be printed on one line, without
243 <STRONG>-1</STRONG> causes the fields to be printed out one to a line.
244 Otherwise, the fields will be printed several to a
245 line to a maximum width of 60 characters.
247 <STRONG>-a</STRONG> tells <STRONG>infocmp</STRONG> to retain commented-out capabilities
248 rather than discarding them. Capabilities are com-
249 mented by prefixing them with a period.
251 <STRONG>-D</STRONG> tells <STRONG>infocmp</STRONG> to print the database locations that it
252 knows about, and exit.
254 <STRONG>-E</STRONG> Dump the capabilities of the given terminal as
255 tables, needed in the C initializer for a TERMTYPE
256 structure (the terminal capability structure in the
257 <STRONG><term.h></STRONG>). This option is useful for preparing ver-
258 sions of the curses library hardwired for a given
259 terminal type. The tables are all declared static,
260 and are named according to the type and the name of
261 the corresponding terminal entry.
263 Before ncurses 5.0, the split between the <STRONG>-e</STRONG> and <STRONG>-E</STRONG>
264 options was not needed; but support for extended
265 names required making the arrays of terminal capabil-
266 ities separate from the TERMTYPE structure.
268 <STRONG>-e</STRONG> Dump the capabilities of the given terminal as a C
269 initializer for a TERMTYPE structure (the terminal
270 capability structure in the <STRONG><term.h></STRONG>). This option
271 is useful for preparing versions of the curses
272 library hardwired for a given terminal type.
274 <STRONG>-F</STRONG> compare terminfo files. This assumes that two fol-
275 lowing arguments are filenames. The files are
276 searched for pairwise matches between entries, with
277 two entries considered to match if any of their names
278 do. The report printed to standard output lists
279 entries with no matches in the other file, and
280 entries with more than one match. For entries with
281 exactly one match it includes a difference report.
282 Normally, to reduce the volume of the report, use
283 references are not resolved before looking for dif-
284 ferences, but resolution can be forced by also speci-
285 fying <STRONG>-r</STRONG>.
287 <STRONG>-f</STRONG> Display complex terminfo strings which contain
288 if/then/else/endif expressions indented for readabil-
291 <STRONG>-G</STRONG> Display constant literals in decimal form rather than
292 their character equivalents.
294 <STRONG>-g</STRONG> Display constant character literals in quoted form
295 rather than their decimal equivalents.
297 <STRONG>-i</STRONG> Analyze the initialization (<STRONG>is1</STRONG>, <STRONG>is2</STRONG>, <STRONG>is3</STRONG>), and reset
298 (<STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rs3</STRONG>), strings in the entry. For each
299 string, the code tries to analyze it into actions in
300 terms of the other capabilities in the entry, certain
301 X3.64/ISO 6429/ECMA-48 capabilities, and certain DEC
302 VT-series private modes (the set of recognized spe-
303 cial sequences has been selected for completeness
304 over the existing terminfo database). Each report
305 line consists of the capability name, followed by a
306 colon and space, followed by a printable expansion of
307 the capability string with sections matching recog-
308 nized actions translated into {}-bracketed descrip-
309 tions. Here is a list of the DEC/ANSI special
310 sequences recognized: i.
313 -----------------------------------------
319 RSR reset scroll region
320 -----------------------------------------
321 DECSTR soft reset (VT320)
322 S7C1T 7-bit controls (VT220)
323 -----------------------------------------
324 ISO DEC G0 enable DEC graphics for G0
325 ISO UK G0 enable UK chars for G0
326 ISO US G0 enable US chars for G0
327 ISO DEC G1 enable DEC graphics for G1
328 ISO UK G1 enable UK chars for G1
329 ISO US G1 enable US chars for G1
330 -----------------------------------------
331 DECPAM application keypad mode
332 DECPNM normal keypad mode
333 DECANSI enter ANSI mode
334 -----------------------------------------
335 ECMA[+-]AM keyboard action mode
336 ECMA[+-]IRM insert replace mode
337 ECMA[+-]SRM send receive mode
338 ECMA[+-]LNM linefeed mode
339 -----------------------------------------
340 DEC[+-]CKM application cursor keys
341 DEC[+-]ANM set VT52 mode
342 DEC[+-]COLM 132-column mode
343 DEC[+-]SCLM smooth scroll
344 DEC[+-]SCNM reverse video mode
345 DEC[+-]OM origin mode
346 DEC[+-]AWM wraparound mode
347 DEC[+-]ARM auto-repeat mode
349 It also recognizes a SGR action corresponding to
350 ANSI/ISO 6429/ECMA Set Graphics Rendition, with the
351 values NORMAL, BOLD, UNDERLINE, BLINK, and REVERSE.
352 All but NORMAL may be prefixed with `+' (turn on) or
355 An SGR0 designates an empty highlight sequence (equivalent
358 <STRONG>-l</STRONG> Set output format to terminfo.
360 <STRONG>-p</STRONG> Ignore padding specifications when comparing strings.
362 <STRONG>-q</STRONG> Make the comparison listing shorter by omitting sub-
363 headings, and using "-" for absent capabilities, "@"
364 for canceled rather than "NULL".
366 <STRONG>-R</STRONG><EM>subset</EM>
367 Restrict output to a given subset. This option is
368 for use with archaic versions of terminfo like those
369 on SVr1, Ultrix, or HP/UX that do not support the
370 full set of SVR4/XSI Curses terminfo; and variants
371 such as AIX that have their own extensions incompati-
372 ble with SVr4/XSI. Available terminfo subsets are
373 "SVr1", "Ultrix", "HP", and "AIX"; see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
374 for details. You can also choose the subset "BSD"
375 which selects only capabilities with termcap equiva-
376 lents recognized by 4.4BSD.
378 <STRONG>-s</STRONG> <EM>[d|i|l|c]</EM>
379 The <STRONG>-s</STRONG> option sorts the fields within each type
380 according to the argument below:
382 <STRONG>d</STRONG> leave fields in the order that they are stored
383 in the <EM>terminfo</EM> database.
385 <STRONG>i</STRONG> sort by <EM>terminfo</EM> name.
387 <STRONG>l</STRONG> sort by the long C variable name.
389 <STRONG>c</STRONG> sort by the <EM>termcap</EM> name.
391 If the <STRONG>-s</STRONG> option is not given, the fields printed out
392 will be sorted alphabetically by the <STRONG>terminfo</STRONG> name
393 within each type, except in the case of the <STRONG>-C</STRONG> or the
394 <STRONG>-L</STRONG> options, which cause the sorting to be done by the
395 <STRONG>termcap</STRONG> name or the long C variable name, respec-
398 <STRONG>-T</STRONG> eliminates size-restrictions on the generated text.
399 This is mainly useful for testing and analysis, since
400 the compiled descriptions are limited (e.g., 1023 for
401 termcap, 4096 for terminfo).
403 <STRONG>-t</STRONG> tells <STRONG>tic</STRONG> to discard commented-out capabilities.
404 Normally when translating from terminfo to termcap,
405 untranslatable capabilities are commented-out.
407 <STRONG>-U</STRONG> tells <STRONG>infocmp</STRONG> to not post-process the data after
408 parsing the source file. This feature helps when
409 comparing the actual contents of two source files,
410 since it excludes the inferences that <STRONG>infocmp</STRONG> makes
411 to fill in missing data.
413 <STRONG>-V</STRONG> reports the version of ncurses which was used in this
416 <STRONG>-v</STRONG> <EM>n</EM> prints out tracing information on standard error as
417 the program runs. Higher values of n induce greater
420 <STRONG>-w</STRONG> <EM>width</EM>
421 changes the output to <EM>width</EM> characters.
423 <STRONG>-x</STRONG> print information for user-defined capabilities.
424 These are extensions to the terminfo repertoire which
425 can be loaded using the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG>.
430 /usr/share/terminfo Compiled terminal description data-
435 <H2>EXTENSIONS</H2><PRE>
436 The <STRONG>-0</STRONG>, <STRONG>-1</STRONG>, <STRONG>-E</STRONG>, <STRONG>-F</STRONG>, <STRONG>-G</STRONG>, <STRONG>-R</STRONG>, <STRONG>-T</STRONG>, <STRONG>-V</STRONG>, <STRONG>-a</STRONG>, <STRONG>-e</STRONG>, <STRONG>-f</STRONG>, <STRONG>-g</STRONG>, <STRONG>-i</STRONG>,
437 <STRONG>-l</STRONG>, <STRONG>-p</STRONG>, <STRONG>-q</STRONG> and <STRONG>-t</STRONG> options are not supported in SVr4
440 The <STRONG>-r</STRONG> option's notion of `termcap' capabilities is System
441 V Release 4's. Actual BSD curses versions will have a
442 more restricted set. To see only the 4.4BSD set, use <STRONG>-r</STRONG>
443 <STRONG>-RBSD</STRONG>.
448 The <STRONG>-F</STRONG> option of <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG> should be a <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG> mode.
452 <H2>SEE ALSO</H2><PRE>
453 <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,
454 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
456 http://invisible-island.net/ncurses/tctest.html
458 This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20130309).
463 Eric S. Raymond <esr@snark.thyrsus.com> and
464 Thomas E. Dickey <dickey@invisible-island.net>
468 <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>
472 Man(1) output converted with
473 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>