1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
4 ****************************************************************************
5 * Copyright (c) 1998-2010,2011 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.50 2011/12/17 23:15:19 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 entries. Capabilities that are not set
93 are ignored. This option can be used as a quick check to
94 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 neither entry. If no <EM>termnames</EM> are given, the environ-
98 ment variable <STRONG>TERM</STRONG> will be used for both of the <EM>termnames</EM>.
99 This can be used as a quick check to see if anything was
100 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 All padding information for strings will be collected
123 together and placed at the beginning of the string where
124 <STRONG>termcap</STRONG> expects it. Mandatory padding (padding informa-
125 tion with a trailing '/') will become optional.
127 All <STRONG>termcap</STRONG> variables no longer supported by <STRONG>terminfo</STRONG>, but
128 which are derivable from other <STRONG>terminfo</STRONG> variables, will be
129 output. Not all <STRONG>terminfo</STRONG> capabilities will be translated;
130 only those variables which were part of <STRONG>termcap</STRONG> will nor-
131 mally be output. Specifying the <STRONG>-r</STRONG> option will take off
132 this restriction, allowing all capabilities to be output
133 in <EM>termcap</EM> form. Normally you would use both the <STRONG>-C</STRONG> and
134 <STRONG>-r</STRONG> options. The actual format used incorporates some
135 improvements for escaped characters from terminfo format.
136 For a stricter BSD-compatible translation, use the <STRONG>-K</STRONG>
137 option rather than <STRONG>-C</STRONG>.
139 Note that because padding is collected to the beginning of
140 the capability, not all capabilities are output. Manda-
141 tory padding is not supported. Because <STRONG>termcap</STRONG> strings
142 are not as flexible, it is not always possible to convert
143 a <STRONG>terminfo</STRONG> string capability into an equivalent <STRONG>termcap</STRONG>
144 format. A subsequent conversion of the <STRONG>termcap</STRONG> file back
145 into <STRONG>terminfo</STRONG> format will not necessarily reproduce the
146 original <STRONG>terminfo</STRONG> source.
148 Some common <STRONG>terminfo</STRONG> parameter sequences, their <STRONG>termcap</STRONG>
149 equivalents, and some terminal types which commonly have
152 <STRONG>terminfo</STRONG> <STRONG>termcap</STRONG> Representative Terminals
153 ---------------------------------------------------------------
154 <STRONG>%p1%c</STRONG> <STRONG>%.</STRONG> adm
155 <STRONG>%p1%d</STRONG> <STRONG>%d</STRONG> hp, ANSI standard, vt100
156 <STRONG>%p1%'x'%+%c</STRONG> <STRONG>%+x</STRONG> concept
157 <STRONG>%i</STRONG> <STRONG>%i</STRONG>q ANSI standard, vt100
158 <STRONG>%p1%?%'x'%>%t%p1%'y'%+%;</STRONG> <STRONG>%>xy</STRONG> concept
159 <STRONG>%p2</STRONG> is printed before <STRONG>%p1</STRONG> <STRONG>%r</STRONG> hp
161 <STRONG>Use=</STRONG> <STRONG>Option</STRONG> <STRONG>[-u]</STRONG>
162 The <STRONG>-u</STRONG> option produces a <STRONG>terminfo</STRONG> source description of
163 the first terminal <EM>termname</EM> which is relative to the sum
164 of the descriptions given by the entries for the other
165 terminals <EM>termnames</EM>. It does this by analyzing the dif-
166 ferences between the first <EM>termname</EM> and the other
167 <EM>termnames</EM> and producing a description with <STRONG>use=</STRONG> fields for
168 the other terminals. In this manner, it is possible to
169 retrofit generic terminfo entries into a terminal's
170 description. Or, if two similar terminals exist, but were
171 coded at different times or by different people so that
172 each description is a full description, using <STRONG>infocmp</STRONG> will
173 show what can be done to change one description to be rel-
176 A capability will get printed with an at-sign (@) if it no
177 longer exists in the first <EM>termname</EM>, but one of the other
178 <EM>termname</EM> entries contains a value for it. A capability's
179 value gets printed if the value in the first <EM>termname</EM> is
180 not found in any of the other <EM>termname</EM> entries, or if the
181 first of the other <EM>termname</EM> entries that has this
182 capability gives a different value for the capability than
183 that in the first <EM>termname</EM>.
185 The order of the other <EM>termname</EM> entries is significant.
186 Since the terminfo compiler <STRONG>tic</STRONG> does a left-to-right scan
187 of the capabilities, specifying two <STRONG>use=</STRONG> entries that con-
188 tain differing entries for the same capabilities will pro-
189 duce different results depending on the order that the
190 entries are given in. <STRONG>infocmp</STRONG> will flag any such incon-
191 sistencies between the other <EM>termname</EM> entries as they are
194 Alternatively, specifying a capability <EM>after</EM> a <STRONG>use=</STRONG> entry
195 that contains that capability will cause the second speci-
196 fication to be ignored. Using <STRONG>infocmp</STRONG> to recreate a
197 description can be a useful check to make sure that every-
198 thing was specified correctly in the original source
201 Another error that does not cause incorrect compiled
202 files, but will slow down the compilation time, is speci-
203 fying extra <STRONG>use=</STRONG> fields that are superfluous. <STRONG>infocmp</STRONG>
204 will flag any other <EM>termname</EM> <EM>use=</EM> fields that were not
207 <STRONG>Changing</STRONG> <STRONG>Databases</STRONG> <STRONG>[-A</STRONG> <EM>directory</EM>] [-B <EM>directory</EM>]
208 The location of the compiled <STRONG>terminfo</STRONG> database is taken
209 from the environment variable <STRONG>TERMINFO</STRONG> . If the variable
210 is not defined, or the terminal is not found in that loca-
211 tion, the system <STRONG>terminfo</STRONG> database, in <STRONG>/usr/share/ter-</STRONG>
212 <STRONG>minfo</STRONG>, will be used. The options <STRONG>-A</STRONG> and <STRONG>-B</STRONG> may be used to
213 override this location. The <STRONG>-A</STRONG> option will set <STRONG>TERMINFO</STRONG>
214 for the first <EM>termname</EM> and the <STRONG>-B</STRONG> option will set <STRONG>TERMINFO</STRONG>
215 for the other <EM>termnames</EM>. With this, it is possible to
216 compare descriptions for a terminal with the same name
217 located in two different databases. This is useful for
218 comparing descriptions for the same terminal created by
221 <STRONG>Other</STRONG> <STRONG>Options</STRONG>
222 <STRONG>-0</STRONG> causes the fields to be printed on one line, without
225 <STRONG>-1</STRONG> causes the fields to be printed out one to a line.
226 Otherwise, the fields will be printed several to a
227 line to a maximum width of 60 characters.
229 <STRONG>-a</STRONG> tells <STRONG>infocmp</STRONG> to retain commented-out capabilities
230 rather than discarding them. Capabilities are com-
231 mented by prefixing them with a period.
233 <STRONG>-D</STRONG> tells <STRONG>infocmp</STRONG> to print the database locations that it
234 knows about, and exit.
236 <STRONG>-E</STRONG> Dump the capabilities of the given terminal as
237 tables, needed in the C initializer for a TERMTYPE
238 structure (the terminal capability structure in the
239 <STRONG><term.h></STRONG>). This option is useful for preparing ver-
240 sions of the curses library hardwired for a given
241 terminal type. The tables are all declared static,
242 and are named according to the type and the name of
243 the corresponding terminal entry.
245 Before ncurses 5.0, the split between the <STRONG>-e</STRONG> and <STRONG>-E</STRONG>
246 options was not needed; but support for extended
247 names required making the arrays of terminal
248 capabilities separate from the TERMTYPE structure.
250 <STRONG>-e</STRONG> Dump the capabilities of the given terminal as a C
251 initializer for a TERMTYPE structure (the terminal
252 capability structure in the <STRONG><term.h></STRONG>). This option
253 is useful for preparing versions of the curses
254 library hardwired for a given terminal type.
256 <STRONG>-F</STRONG> compare terminfo files. This assumes that two fol-
257 lowing arguments are filenames. The files are
258 searched for pairwise matches between entries, with
259 two entries considered to match if any of their names
260 do. The report printed to standard output lists
261 entries with no matches in the other file, and
262 entries with more than one match. For entries with
263 exactly one match it includes a difference report.
264 Normally, to reduce the volume of the report, use
265 references are not resolved before looking for dif-
266 ferences, but resolution can be forced by also speci-
267 fying <STRONG>-r</STRONG>.
269 <STRONG>-f</STRONG> Display complex terminfo strings which contain
270 if/then/else/endif expressions indented for readabil-
273 <STRONG>-G</STRONG> Display constant literals in decimal form rather than
274 their character equivalents.
276 <STRONG>-g</STRONG> Display constant character literals in quoted form
277 rather than their decimal equivalents.
279 <STRONG>-i</STRONG> Analyze the initialization (<STRONG>is1</STRONG>, <STRONG>is2</STRONG>, <STRONG>is3</STRONG>), and reset
280 (<STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rs3</STRONG>), strings in the entry. For each
281 string, the code tries to analyze it into actions in
282 terms of the other capabilities in the entry, certain
283 X3.64/ISO 6429/ECMA-48 capabilities, and certain DEC
284 VT-series private modes (the set of recognized spe-
285 cial sequences has been selected for completeness
286 over the existing terminfo database). Each report
287 line consists of the capability name, followed by a
288 colon and space, followed by a printable expansion of
289 the capability string with sections matching recog-
290 nized actions translated into {}-bracketed descrip-
291 tions. Here is a list of the DEC/ANSI special
292 sequences recognized: i.
295 -----------------------------------------
300 RSR reset scroll region
301 -----------------------------------------
302 DECSTR soft reset (VT320)
303 S7C1T 7-bit controls (VT220)
304 -----------------------------------------
305 ISO DEC G0 enable DEC graphics for G0
306 ISO UK G0 enable UK chars for G0
307 ISO US G0 enable US chars for G0
308 ISO DEC G1 enable DEC graphics for G1
309 ISO UK G1 enable UK chars for G1
310 ISO US G1 enable US chars for G1
311 -----------------------------------------
312 DECPAM application keypad mode
314 DECPNM normal keypad mode
315 DECANSI enter ANSI mode
316 -----------------------------------------
317 ECMA[+-]AM keyboard action mode
318 ECMA[+-]IRM insert replace mode
319 ECMA[+-]SRM send receive mode
320 ECMA[+-]LNM linefeed mode
321 -----------------------------------------
322 DEC[+-]CKM application cursor keys
323 DEC[+-]ANM set VT52 mode
324 DEC[+-]COLM 132-column mode
325 DEC[+-]SCLM smooth scroll
326 DEC[+-]SCNM reverse video mode
327 DEC[+-]OM origin mode
328 DEC[+-]AWM wraparound mode
329 DEC[+-]ARM auto-repeat mode
331 It also recognizes a SGR action corresponding to
332 ANSI/ISO 6429/ECMA Set Graphics Rendition, with the
333 values NORMAL, BOLD, UNDERLINE, BLINK, and REVERSE.
334 All but NORMAL may be prefixed with `+' (turn on) or
337 An SGR0 designates an empty highlight sequence (equivalent
340 <STRONG>-l</STRONG> Set output format to terminfo.
342 <STRONG>-p</STRONG> Ignore padding specifications when comparing strings.
344 <STRONG>-q</STRONG> Make the comparison listing shorter by omitting sub-
345 headings, and using "-" for absent capabilities, "@"
346 for canceled rather than "NULL".
348 <STRONG>-R</STRONG><EM>subset</EM>
349 Restrict output to a given subset. This option is
350 for use with archaic versions of terminfo like those
351 on SVr1, Ultrix, or HP/UX that do not support the
352 full set of SVR4/XSI Curses terminfo; and variants
353 such as AIX that have their own extensions incompati-
354 ble with SVr4/XSI. Available terminfo subsets are
355 "SVr1", "Ultrix", "HP", and "AIX"; see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
356 for details. You can also choose the subset "BSD"
357 which selects only capabilities with termcap equiva-
358 lents recognized by 4.4BSD.
360 <STRONG>-s</STRONG> <EM>[d|i|l|c]</EM>
361 The <STRONG>-s</STRONG> option sorts the fields within each type
362 according to the argument below:
364 <STRONG>d</STRONG> leave fields in the order that they are stored
365 in the <EM>terminfo</EM> database.
367 <STRONG>i</STRONG> sort by <EM>terminfo</EM> name.
369 <STRONG>l</STRONG> sort by the long C variable name.
371 <STRONG>c</STRONG> sort by the <EM>termcap</EM> name.
373 If the <STRONG>-s</STRONG> option is not given, the fields printed out
374 will be sorted alphabetically by the <STRONG>terminfo</STRONG> name
375 within each type, except in the case of the <STRONG>-C</STRONG> or the
376 <STRONG>-L</STRONG> options, which cause the sorting to be done by the
377 <STRONG>termcap</STRONG> name or the long C variable name, respec-
380 <STRONG>-T</STRONG> eliminates size-restrictions on the generated text.
381 This is mainly useful for testing and analysis, since
382 the compiled descriptions are limited (e.g., 1023 for
383 termcap, 4096 for terminfo).
385 <STRONG>-t</STRONG> tells <STRONG>tic</STRONG> to discard commented-out capabilities.
386 Normally when translating from terminfo to termcap,
387 untranslatable capabilities are commented-out.
389 <STRONG>-U</STRONG> tells <STRONG>infocmp</STRONG> to not post-process the data after
390 parsing the source file. This feature helps when
391 comparing the actual contents of two source files,
392 since it excludes the inferences that <STRONG>infocmp</STRONG> makes
393 to fill in missing data.
395 <STRONG>-V</STRONG> reports the version of ncurses which was used in this
398 <STRONG>-v</STRONG> <EM>n</EM> prints out tracing information on standard error as
399 the program runs. Higher values of n induce greater
402 <STRONG>-w</STRONG> <EM>width</EM>
403 changes the output to <EM>width</EM> characters.
405 <STRONG>-x</STRONG> print information for user-defined capabilities.
406 These are extensions to the terminfo repertoire which
407 can be loaded using the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG>.
412 /usr/share/terminfo Compiled terminal description
417 <H2>EXTENSIONS</H2><PRE>
418 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>,
419 <STRONG>-l</STRONG>, <STRONG>-p</STRONG>, <STRONG>-q</STRONG> and <STRONG>-t</STRONG> options are not supported in SVr4
422 The <STRONG>-r</STRONG> option's notion of `termcap' capabilities is System
423 V Release 4's. Actual BSD curses versions will have a
424 more restricted set. To see only the 4.4BSD set, use <STRONG>-r</STRONG>
425 <STRONG>-RBSD</STRONG>.
430 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.
434 <H2>SEE ALSO</H2><PRE>
435 <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>,
436 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
438 This describes <STRONG>ncurses</STRONG> version 5.9 (patch 20120107).
443 Eric S. Raymond <esr@snark.thyrsus.com> and
444 Thomas E. Dickey <dickey@invisible-island.net>
448 <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>
452 Man(1) output converted with
453 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>