1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
4 ****************************************************************************
5 * Copyright (c) 1998-2003,2004 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.39 2004/08/28 22:43:49 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>-1CEFGILTVcdegilnpqrtux</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.
107 <STRONG>-I</STRONG> use the <STRONG>terminfo</STRONG> names
108 <STRONG>-L</STRONG> use the long C variable name listed in <<STRONG>term.h</STRONG>>
109 <STRONG>-C</STRONG> use the <STRONG>termcap</STRONG> names
110 <STRONG>-r</STRONG> when using <STRONG>-C</STRONG>, put out all capabilities in <STRONG>termcap</STRONG> form
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.
135 Note that because padding is collected to the beginning of
136 the capability, not all capabilities are output. Manda-
137 tory padding is not supported. Because <STRONG>termcap</STRONG> strings
138 are not as flexible, it is not always possible to convert
139 a <STRONG>terminfo</STRONG> string capability into an equivalent <STRONG>termcap</STRONG>
140 format. A subsequent conversion of the <STRONG>termcap</STRONG> file back
141 into <STRONG>terminfo</STRONG> format will not necessarily reproduce the
142 original <STRONG>terminfo</STRONG> source.
144 Some common <STRONG>terminfo</STRONG> parameter sequences, their <STRONG>termcap</STRONG>
145 equivalents, and some terminal types which commonly have
149 <STRONG>terminfo</STRONG> <STRONG>termcap</STRONG> Representative Terminals
150 ---------------------------------------------------------------
151 <STRONG>%p1%c</STRONG> <STRONG>%.</STRONG> adm
152 <STRONG>%p1%d</STRONG> <STRONG>%d</STRONG> hp, ANSI standard, vt100
153 <STRONG>%p1%'x'%+%c</STRONG> <STRONG>%+x</STRONG> concept
154 <STRONG>%i</STRONG> <STRONG>%i</STRONG>q ANSI standard, vt100
155 <STRONG>%p1%?%'x'%>%t%p1%'y'%+%;</STRONG> <STRONG>%>xy</STRONG> concept
156 <STRONG>%p2</STRONG> is printed before <STRONG>%p1</STRONG> <STRONG>%r</STRONG> hp
158 <STRONG>Use=</STRONG> <STRONG>Option</STRONG> <STRONG>[-u]</STRONG>
159 The <STRONG>-u</STRONG> option produces a <STRONG>terminfo</STRONG> source description of
160 the first terminal <EM>termname</EM> which is relative to the sum
161 of the descriptions given by the entries for the other
162 terminals <EM>termnames</EM>. It does this by analyzing the dif-
163 ferences between the first <EM>termname</EM> and the other
164 <EM>termnames</EM> and producing a description with <STRONG>use=</STRONG> fields for
165 the other terminals. In this manner, it is possible to
166 retrofit generic terminfo entries into a terminal's
167 description. Or, if two similar terminals exist, but were
168 coded at different times or by different people so that
169 each description is a full description, using <STRONG>infocmp</STRONG> will
170 show what can be done to change one description to be rel-
173 A capability will get printed with an at-sign (@) if it no
174 longer exists in the first <EM>termname</EM>, but one of the other
175 <EM>termname</EM> entries contains a value for it. A capability's
176 value gets printed if the value in the first <EM>termname</EM> is
177 not found in any of the other <EM>termname</EM> entries, or if the
178 first of the other <EM>termname</EM> entries that has this capabil-
179 ity gives a different value for the capability than that
180 in the first <EM>termname</EM>.
182 The order of the other <EM>termname</EM> entries is significant.
183 Since the terminfo compiler <STRONG>tic</STRONG> does a left-to-right scan
184 of the capabilities, specifying two <STRONG>use=</STRONG> entries that con-
185 tain differing entries for the same capabilities will pro-
186 duce different results depending on the order that the
187 entries are given in. <STRONG>infocmp</STRONG> will flag any such incon-
188 sistencies between the other <EM>termname</EM> entries as they are
191 Alternatively, specifying a capability <EM>after</EM> a <STRONG>use=</STRONG> entry
192 that contains that capability will cause the second speci-
193 fication to be ignored. Using <STRONG>infocmp</STRONG> to recreate a
194 description can be a useful check to make sure that every-
195 thing was specified correctly in the original source
198 Another error that does not cause incorrect compiled
199 files, but will slow down the compilation time, is speci-
200 fying extra <STRONG>use=</STRONG> fields that are superfluous. <STRONG>infocmp</STRONG>
201 will flag any other <EM>termname</EM> <EM>use=</EM> fields that were not
204 <STRONG>Changing</STRONG> <STRONG>Databases</STRONG> <STRONG>[-A</STRONG> <EM>directory</EM>] [-B <EM>directory</EM>]
205 The location of the compiled <STRONG>terminfo</STRONG> database is taken
206 from the environment variable <STRONG>TERMINFO</STRONG> . If the variable
207 is not defined, or the terminal is not found in that loca-
208 tion, the system <STRONG>terminfo</STRONG> database, in <STRONG>/usr/share/ter-</STRONG>
209 <STRONG>minfo</STRONG>, will be used. The options <STRONG>-A</STRONG> and <STRONG>-B</STRONG> may be used to
210 override this location. The <STRONG>-A</STRONG> option will set <STRONG>TERMINFO</STRONG>
211 for the first <EM>termname</EM> and the <STRONG>-B</STRONG> option will set <STRONG>TERMINFO</STRONG>
212 for the other <EM>termnames</EM>. With this, it is possible to
213 compare descriptions for a terminal with the same name
214 located in two different databases. This is useful for
215 comparing descriptions for the same terminal created by
218 <STRONG>Other</STRONG> <STRONG>Options</STRONG>
219 <STRONG>-1</STRONG> causes the fields to be printed out one to a line.
220 Otherwise, the fields will be printed several to a
221 line to a maximum width of 60 characters.
223 <STRONG>-a</STRONG> tells <STRONG>infocmp</STRONG> to retain commented-out capabilities
224 rather than discarding them. Capabilities are com-
225 mented by prefixing them with a period.
227 <STRONG>-E</STRONG> Dump the capabilities of the given terminal as
228 tables, needed in the C initializer for a TERMTYPE
229 structure (the terminal capability structure in the
230 <STRONG><term.h></STRONG>). This option is useful for preparing ver-
231 sions of the curses library hardwired for a given
232 terminal type. The tables are all declared static,
233 and are named according to the type and the name of
234 the corresponding terminal entry.
236 Before ncurses 5.0, the split between the <STRONG>-e</STRONG> and <STRONG>-E</STRONG>
237 options was not needed; but support for extended
238 names required making the arrays of terminal capabil-
239 ities separate from the TERMTYPE structure.
241 <STRONG>-e</STRONG> Dump the capabilities of the given terminal as a C
242 initializer for a TERMTYPE structure (the terminal
243 capability structure in the <STRONG><term.h></STRONG>). This option
244 is useful for preparing versions of the curses
245 library hardwired for a given terminal type.
247 <STRONG>-F</STRONG> compare terminfo files. This assumes that two fol-
248 lowing arguments are filenames. The files are
249 searched for pairwise matches between entries, with
250 two entries considered to match if any of their names
251 do. The report printed to standard output lists
252 entries with no matches in the other file, and
253 entries with more than one match. For entries with
254 exactly one match it includes a difference report.
255 Normally, to reduce the volume of the report, use
256 references are not resolved before looking for dif-
257 ferences, but resolution can be forced by also speci-
258 fying <STRONG>-r</STRONG>.
260 <STRONG>-f</STRONG> Display complex terminfo strings which contain
261 if/then/else/endif expressions indented for readabil-
264 <STRONG>-G</STRONG> Display constant literals in decimal form rather than
265 their character equivalents.
267 <STRONG>-g</STRONG> Display constant character literals in quoted form
268 rather than their decimal equivalents.
270 <STRONG>-i</STRONG> Analyze the initialization (<STRONG>is1</STRONG>, <STRONG>is2</STRONG>, <STRONG>is3</STRONG>), and reset
271 (<STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rs3</STRONG>), strings in the entry. For each
272 string, the code tries to analyze it into actions in
273 terms of the other capabilities in the entry, certain
274 X3.64/ISO 6429/ECMA-48 capabilities, and certain DEC
275 VT-series private modes (the set of recognized spe-
276 cial sequences has been selected for completeness
277 over the existing terminfo database). Each report
278 line consists of the capability name, followed by a
279 colon and space, followed by a printable expansion of
280 the capability string with sections matching recog-
281 nized actions translated into {}-bracketed descrip-
282 tions. Here is a list of the DEC/ANSI special
283 sequences recognized:
287 -----------------------------------------
292 RSR reset scroll region
294 DECSTR soft reset (VT320)
295 S7C1T 7-bit controls (VT220)
297 ISO DEC G0 enable DEC graphics for G0
298 ISO UK G0 enable UK chars for G0
299 ISO US G0 enable US chars for G0
300 ISO DEC G1 enable DEC graphics for G1
301 ISO UK G1 enable UK chars for G1
302 ISO US G1 enable US chars for G1
304 DECPAM application keypad mode
305 DECPNM normal keypad mode
306 DECANSI enter ANSI mode
308 ECMA[+-]AM keyboard action mode
309 ECMA[+-]IRM insert replace mode
310 ECMA[+-]SRM send receive mode
311 ECMA[+-]LNM linefeed mode
313 DEC[+-]CKM application cursor keys
314 DEC[+-]ANM set VT52 mode
316 DEC[+-]COLM 132-column mode
317 DEC[+-]SCLM smooth scroll
318 DEC[+-]SCNM reverse video mode
319 DEC[+-]OM origin mode
320 DEC[+-]AWM wraparound mode
321 DEC[+-]ARM auto-repeat mode
323 It also recognizes a SGR action corresponding to
324 ANSI/ISO 6429/ECMA Set Graphics Rendition, with the
325 values NORMAL, BOLD, UNDERLINE, BLINK, and REVERSE.
326 All but NORMAL may be prefixed with `+' (turn on) or
329 An SGR0 designates an empty highlight sequence
330 (equivalent to {SGR:NORMAL}).
332 <STRONG>-l</STRONG> Set output format to terminfo.
334 <STRONG>-p</STRONG> Ignore padding specifications when comparing strings.
336 <STRONG>-q</STRONG> Make the comparison listing shorter by omitting sub-
337 headings, and using "-" for absent capabilities, "@"
338 for canceled rather than "NULL".
340 <STRONG>-R</STRONG><EM>subset</EM>
341 Restrict output to a given subset. This option is
342 for use with archaic versions of terminfo like those
343 on SVr1, Ultrix, or HP/UX that do not support the
344 full set of SVR4/XSI Curses terminfo; and variants
345 such as AIX that have their own extensions incompati-
346 ble with SVr4/XSI. Available terminfo subsets are
347 "SVr1", "Ultrix", "HP", and "AIX"; see <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
348 for details. You can also choose the subset "BSD"
349 which selects only capabilities with termcap equiva-
350 lents recognized by 4.4BSD.
352 <STRONG>-s</STRONG> <EM>[d|i|l|c]</EM>
353 The <STRONG>-s</STRONG> option sorts the fields within each type
354 according to the argument below:
356 <STRONG>d</STRONG> leave fields in the order that they are stored
357 in the <EM>terminfo</EM> database.
359 <STRONG>i</STRONG> sort by <EM>terminfo</EM> name.
361 <STRONG>l</STRONG> sort by the long C variable name.
363 <STRONG>c</STRONG> sort by the <EM>termcap</EM> name.
365 If the <STRONG>-s</STRONG> option is not given, the fields printed out
366 will be sorted alphabetically by the <STRONG>terminfo</STRONG> name
367 within each type, except in the case of the <STRONG>-C</STRONG> or the
368 <STRONG>-L</STRONG> options, which cause the sorting to be done by the
369 <STRONG>termcap</STRONG> name or the long C variable name, respec-
372 <STRONG>-T</STRONG> eliminates size-restrictions on the generated text.
373 This is mainly useful for testing and analysis, since
374 the compiled descriptions are limited (e.g., 1023 for
375 termcap, 4096 for terminfo).
377 <STRONG>-t</STRONG> tells <STRONG>tic</STRONG> to discard commented-out capabilities.
378 Normally when translating from terminfo to termcap,
379 untranslatable capabilities are commented-out.
381 <STRONG>-V</STRONG> reports the version of ncurses which was used in this
384 <STRONG>-v</STRONG> <EM>n</EM> prints out tracing information on standard error as
385 the program runs. Higher values of n induce greater
388 <STRONG>-w</STRONG> <EM>width</EM>
389 changes the output to <EM>width</EM> characters.
391 <STRONG>-x</STRONG> print information for user-defined capabilities.
392 These are extensions to the terminfo repertoire which
393 can be loaded using the <STRONG>-x</STRONG> option of <STRONG>tic</STRONG>.
398 /usr/share/terminfo Compiled terminal description
403 <H2>EXTENSIONS</H2><PRE>
404 The <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>, <STRONG>-l</STRONG>, <STRONG>-p</STRONG>, <STRONG>-q</STRONG>
405 and <STRONG>-t</STRONG> options are not supported in SVr4 curses.
407 The <STRONG>-r</STRONG> option's notion of `termcap' capabilities is System
408 V Release 4's. Actual BSD curses versions will have a
409 more restricted set. To see only the 4.4BSD set, use <STRONG>-r</STRONG>
410 <STRONG>-RBSD</STRONG>.
415 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.
419 <H2>SEE ALSO</H2><PRE>
420 <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <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>,
421 <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
426 Eric S. Raymond <esr@snark.thyrsus.com> and
427 Thomas E. Dickey <dickey@invisible-island.net>
431 <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>
435 Man(1) output converted with
436 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>