]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/infocmp.1m
ncurses 5.9 - patch 20111224
[ncurses.git] / man / infocmp.1m
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: infocmp.1m,v 1.50 2011/12/17 23:15:19 tom Exp $
31 .TH @INFOCMP@ 1M ""
32 .ds n 5
33 .ds d @TERMINFO@
34 .SH NAME
35 \fB@INFOCMP@\fR \- compare or print out \fIterminfo\fR descriptions
36 .SH SYNOPSIS
37 \fB@INFOCMP@\fR [\fB\-\
38 1\
39 C\
40 D\
41 E\
42 F\
43 G\
44 I\
45 K\
46 L\
47 T\
48 U\
49 V\
50 c\
51 d\
52 e\
53 g\
54 i\
55 l\
56 n\
57 p\
58 q\
59 r\
60 t\
61 u\
62 x\
63 \fR]
64 .br
65       [\fB\-v\fR \fIn\fR] [\fB\-s d\fR| \fBi\fR| \fBl\fR| \fBc\fR] [\fB\-R \fR\fBsubset\fR]
66 .br
67       [\fB\-w\fR\ \fIwidth\fR] [\fB\-A\fR\ \fIdirectory\fR] [\fB\-B\fR\ \fIdirectory\fR]
68 .br
69       [\fItermname\fR...]
70 .SH DESCRIPTION
71 \fB@INFOCMP@\fR can be used to compare a binary \fBterminfo\fR entry with other
72 terminfo entries, rewrite a \fBterminfo\fR description to take advantage of the
73 \fBuse=\fR terminfo field, or print out a \fBterminfo\fR description from the
74 binary file (\fBterm\fR) in a variety of formats.  In all cases, the boolean
75 fields will be printed first, followed by the numeric fields, followed by the
76 string fields.
77 .SS Default Options
78 If no options are specified and zero or one \fItermnames\fR are specified, the
79 \fB\-I\fR option will be assumed.  If more than one \fItermname\fR is specified,
80 the \fB\-d\fR option will be assumed.
81 .SS Comparison Options [\-d] [\-c] [\-n]
82 \fB@INFOCMP@\fR compares the \fBterminfo\fR description of the first terminal
83 \fItermname\fR with each of the descriptions given by the entries for the other
84 terminal's \fItermnames\fR.  If a capability is defined for only one of the
85 terminals, the value returned will depend on the type of the capability:
86 \fBF\fR for boolean variables, \fB\-1\fR for integer variables, and \fBNULL\fR
87 for string variables.
88 .PP
89 The \fB\-d\fR option produces a list of each capability that is different
90 between two entries.  This option is useful to show the difference between two
91 entries, created by different people, for the same or similar terminals.
92 .PP
93 The \fB\-c\fR option produces a list of each capability that is common between
94 two entries.  Capabilities that are not set are ignored.  This option can be
95 used as a quick check to see if the \fB\-u\fR option is worth using.
96 .PP
97 The \fB\-n\fR option produces a list of each capability that is in neither
98 entry.  If no \fItermnames\fR are given, the environment variable \fBTERM\fR
99 will be used for both of the \fItermnames\fR.  This can be used as a quick
100 check to see if anything was left out of a description.
101 .SS Source Listing Options [\-I] [\-L] [\-C] [\-r]
102 The \fB\-I\fR, \fB\-L\fR, and \fB\-C\fR options will produce a source listing for
103 each terminal named.
104 .
105 .TS
106 center tab(/) ;
107 l l .
108 \fB\-I\fR/use the \fBterminfo\fR names
109 \fB\-L\fR/use the long C variable name listed in <\fBterm.h\fR>
110 \fB\-C\fR/use the \fBtermcap\fR names
111 \fB\-r\fR/when using \fB\-C\fR, put out all capabilities in \fBtermcap\fR form
112 \fB\-K\fR/modifies the \fB\-C\fP option, improving BSD-compatibility.
113 .TE
114 .PP
115 If no \fItermnames\fR are given, the environment variable \fBTERM\fR will be
116 used for the terminal name.
117 .PP
118 The source produced by the \fB\-C\fR option may be used directly as a
119 \fBtermcap\fR entry, but not all parameterized strings can be changed to
120 the \fBtermcap\fR format.  \fB@INFOCMP@\fR will attempt to convert most of the
121 parameterized information, and anything not converted will be plainly marked in
122 the output and commented out.  These should be edited by hand.
123 .PP
124 All padding information for strings will be collected together and placed
125 at the beginning of the string where \fBtermcap\fR expects it.  Mandatory
126 padding (padding information with a trailing '/') will become optional.
127 .PP
128 All \fBtermcap\fR variables no longer supported by \fBterminfo\fR, but which
129 are derivable from other \fBterminfo\fR variables, will be output.  Not all
130 \fBterminfo\fR capabilities will be translated; only those variables which were
131 part of \fBtermcap\fR will normally be output.  Specifying the \fB\-r\fR option
132 will take off this restriction, allowing all capabilities to be output in
133 \fItermcap\fR form.
134 Normally you would use both the \fB\-C\fP and \fB\-r\fP options.
135 The actual format used incorporates some improvements for escaped characters
136 from terminfo format.
137 For a stricter BSD-compatible translation, use the \fB\-K\fR option
138 rather than \fB\-C\fP.
139 .PP
140 Note that because padding is collected to the beginning of the capability, not
141 all capabilities are output.  Mandatory padding is not supported.  Because
142 \fBtermcap\fR strings are not as flexible, it is not always possible to convert
143 a \fBterminfo\fR string capability into an equivalent \fBtermcap\fR format.  A
144 subsequent conversion of the \fBtermcap\fR file back into \fBterminfo\fR format
145 will not necessarily reproduce the original \fBterminfo\fR
146 source.
147 .PP
148 Some common \fBterminfo\fR parameter sequences, their \fBtermcap\fR
149 equivalents, and some terminal types which commonly have such sequences, are:
150 .
151 .TS
152 center tab(/) ;
153 l c l
154 l l l.
155 \fBterminfo/termcap\fR/Representative Terminals
156 =
157 \fB%p1%c/%.\fR/adm
158 \fB%p1%d/%d\fR/hp, ANSI standard, vt100
159 \fB%p1%'x'%+%c/%+x\fR/concept
160 \fB%i/%i\fRq/ANSI standard, vt100
161 \fB%p1%?%'x'%>%t%p1%'y'%+%;/%>xy\fR/concept
162 \fB%p2\fR is printed before \fB%p1/%r\fR/hp
163 .TE
164 .SS Use= Option [\-u]
165 The \fB\-u\fR option produces a \fBterminfo\fR source description of the first
166 terminal \fItermname\fR which is relative to the sum of the descriptions given
167 by the entries for the other terminals \fItermnames\fR.  It does this by
168 analyzing the differences between the first \fItermname\fR and the other
169 \fItermnames\fR and producing a description with \fBuse=\fR fields for the
170 other terminals.  In this manner, it is possible to retrofit generic terminfo
171 entries into a terminal's description.  Or, if two similar terminals exist, but
172 were coded at different times or by different people so that each description
173 is a full description, using \fB@INFOCMP@\fR will show what can be done to change
174 one description to be relative to the other.
175 .PP
176 A capability will get printed with an at-sign (@) if it no longer exists in the
177 first \fItermname\fR, but one of the other \fItermname\fR entries contains a
178 value for it.  A capability's value gets printed if the value in the first
179 \fItermname\fR is not found in any of the other \fItermname\fR entries, or if
180 the first of the other \fItermname\fR entries that has this capability gives a
181 different value for the capability than that in the first \fItermname\fR.
182 .PP
183 The order of the other \fItermname\fR entries is significant.  Since the
184 terminfo compiler \fB@TIC@\fR does a left-to-right scan of the capabilities,
185 specifying two \fBuse=\fR entries that contain differing entries for the same
186 capabilities will produce different results depending on the order that the
187 entries are given in.  \fB@INFOCMP@\fR will flag any such inconsistencies between
188 the other \fItermname\fR entries as they are found.
189 .PP
190 Alternatively, specifying a capability \fIafter\fR a \fBuse=\fR entry that
191 contains that capability will cause the second specification to be ignored.
192 Using \fB@INFOCMP@\fR to recreate a description can be a useful check to make
193 sure that everything was specified correctly in the original source
194 description.
195 .PP
196 Another error that does not cause incorrect compiled files, but will slow down
197 the compilation time, is specifying extra \fBuse=\fR fields that are
198 superfluous.  \fB@INFOCMP@\fR will flag any other \fItermname use=\fR fields that
199 were not needed.
200 .SS Changing Databases [\-A \fIdirectory\fR] [\-B \fIdirectory\fR]
201 The location of the compiled \fBterminfo\fR database is taken from the
202 environment variable \fBTERMINFO\fR .  If the variable is not defined, or the
203 terminal is not found in that location, the system \fBterminfo\fR database,
204 in \fB@TERMINFO@\fR, will be used.  The options \fB\-A\fR
205 and \fB\-B\fR may be used to override this location.  The \fB\-A\fR option will
206 set \fBTERMINFO\fR for the first \fItermname\fR and the \fB\-B\fR option will
207 set \fBTERMINFO\fR for the other \fItermnames\fR.  With this, it is possible to
208 compare descriptions for a terminal with the same name located in two different
209 databases.  This is useful for comparing descriptions for the same terminal
210 created by different people.
211 .SS Other Options
212 .TP 5
213 \fB\-0\fR
214 causes the fields to be printed on one line, without wrapping.
215 .TP 5
216 \fB\-1\fR
217 causes the fields to be printed out one to a line.  Otherwise,
218 the fields will be printed several to a line to a maximum width
219 of 60 characters.
220 .TP
221 \fB\-a\fR
222 tells \fB@INFOCMP@\fP to retain commented-out capabilities rather than discarding
223 them.  Capabilities are commented by prefixing them with a period.
224 .TP
225 \fB\-D\fR
226 tells \fB@INFOCMP@\fP to print the database locations that it knows about, and exit.
227 .TP 5
228 \fB\-E\fR
229 Dump the capabilities of the given terminal as tables, needed in
230 the C initializer for a
231 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
232 This option is useful for preparing versions of the curses library hardwired
233 for a given terminal type.
234 The tables are all declared static, and are named according to the type
235 and the name of the corresponding terminal entry.
236 .sp
237 Before ncurses 5.0, the split between the \fB\-e\fP and \fB\-E\fP
238 options was not needed; but support for extended names required making
239 the arrays of terminal capabilities separate from the TERMTYPE structure.
240 .TP 5
241 \fB\-e\fR
242 Dump the capabilities of the given terminal as a C initializer for a
243 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
244 This option is useful for preparing versions of the curses library hardwired
245 for a given terminal type.
246 .TP 5
247 \fB\-F\fR
248 compare terminfo files.  This assumes that two following arguments are
249 filenames.  The files are searched for pairwise matches between
250 entries, with two entries considered to match if any of their names do.
251 The report printed to standard output lists entries with no matches in
252 the other file, and entries with more than one match.  For entries
253 with exactly one match it includes a difference report.  Normally,
254 to reduce the volume of the report, use references are
255 not resolved before looking for differences, but resolution can be forced
256 by also specifying \fB\-r\fR.
257 .TP 5
258 \fB\-f\fR
259 Display complex terminfo strings which contain if/then/else/endif expressions
260 indented for readability.
261 .TP 5
262 \fB\-G\fR
263 Display constant literals in decimal form
264 rather than their character equivalents.
265 .TP 5
266 \fB\-g\fR
267 Display constant character literals in quoted form
268 rather than their decimal equivalents.
269 .TP 5
270 \fB\-i\fR
271 Analyze the initialization (\fBis1\fR, \fBis2\fR, \fBis3\fR), and reset
272 (\fBrs1\fR, \fBrs2\fR, \fBrs3\fR), strings in the entry.  For each string, the
273 code tries to analyze it into actions in terms of the other capabilities in the
274 entry, certain X3.64/ISO 6429/ECMA\-48 capabilities, and certain DEC VT-series
275 private modes (the set of recognized special sequences has been selected for
276 completeness over the existing terminfo database).  Each report line consists
277 of the capability name, followed by a colon and space, followed by a printable
278 expansion of the capability string with sections matching recognized actions
279 translated into {}-bracketed descriptions.  Here is a list of the DEC/ANSI
280 special sequences recognized:
281 i.
282 .TS
283 center tab(/) ;
284 l l
285 l l.
286 Action/Meaning
287 =
288 RIS/full reset
289 SC/save cursor
290 RC/restore cursor
291 LL/home-down
292 RSR/reset scroll region
293 =
294 DECSTR/soft reset (VT320)
295 S7C1T/7-bit controls (VT220)
296 =
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
303 =
304 DECPAM/application keypad mode
305 DECPNM/normal keypad mode
306 DECANSI/enter ANSI mode
307 =
308 ECMA[+\-]AM/keyboard action mode
309 ECMA[+\-]IRM/insert replace mode
310 ECMA[+\-]SRM/send receive mode
311 ECMA[+\-]LNM/linefeed mode
312 =
313 DEC[+\-]CKM/application cursor keys
314 DEC[+\-]ANM/set VT52 mode
315 DEC[+\-]COLM/132-column mode
316 DEC[+\-]SCLM/smooth scroll
317 DEC[+\-]SCNM/reverse video mode
318 DEC[+\-]OM/origin mode
319 DEC[+\-]AWM/wraparound mode
320 DEC[+\-]ARM/auto-repeat mode
321 .TE
322 .sp
323 It also recognizes a SGR action corresponding to ANSI/ISO 6429/ECMA Set
324 Graphics Rendition, with the values NORMAL, BOLD, UNDERLINE, BLINK, and
325 REVERSE.  All but NORMAL may be prefixed with `+' (turn on) or `\-' (turn off).
326 .PP
327 An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
328 .TP 5
329 \fB\-l\fR
330 Set output format to terminfo.
331 .TP 5
332 \fB\-p\fR
333 Ignore padding specifications when comparing strings.
334 .TP 5
335 \fB\-q\fR
336 Make the comparison listing shorter by omitting subheadings, and using
337 "\-" for absent capabilities, "@" for canceled rather than "NULL".
338 .TP 5
339 \fB\-R\fR\fIsubset\fR
340 Restrict output to a given subset.  This option is for use with archaic
341 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
342 the full set of SVR4/XSI Curses terminfo; and variants such as AIX
343 that have their own extensions incompatible with SVr4/XSI.  Available terminfo
344 subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for
345 details.  You can also choose the subset "BSD" which selects only capabilities
346 with termcap equivalents recognized by 4.4BSD.
347 .TP
348 \fB\-s \fR\fI[d|i|l|c]\fR
349 The \fB\-s\fR option sorts the fields within each type according to the argument
350 below:
351 .br
352 .RS 5
353 .TP 5
354 \fBd\fR
355 leave fields in the order that they are stored in the \fIterminfo\fR database.
356 .TP 5
357 \fBi\fR
358 sort by \fIterminfo\fR name.
359 .TP 5
360 \fBl\fR
361 sort by the long C variable name.
362 .TP 5
363 \fBc\fR
364 sort by the \fItermcap\fR name.
365 .RE
366 .IP
367 If the \fB\-s\fR option is not given, the fields printed out will be
368 sorted alphabetically by the \fBterminfo\fR name within each type,
369 except in the case of the \fB\-C\fR or the \fB\-L\fR options, which cause the
370 sorting to be done by the \fBtermcap\fR name or the long C variable
371 name, respectively.
372 .TP 5
373 \fB\-T\fR
374 eliminates size-restrictions on the generated text.
375 This is mainly useful for testing and analysis, since the compiled
376 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
377 .TP
378 \fB\-t\fR
379 tells \fB@TIC@\fP to discard commented-out capabilities.
380 Normally when translating from terminfo to termcap,
381 untranslatable capabilities are commented-out.
382 .TP 5
383 \fB\-U\fR
384 tells \fB@INFOCMP@\fP to not post-process the data after parsing the source file.
385 This feature helps when comparing the actual contents of two source files,
386 since it excludes the inferences that \fB@INFOCMP@\fP makes to fill in missing
387 data.
388 .TP 5
389 \fB\-V\fR
390 reports the version of ncurses which was used in this program, and exits.
391 .TP 5
392 \fB\-v\fR \fIn\fR
393 prints out tracing information on standard error as the program runs.
394 Higher values of n induce greater verbosity.
395 .TP 5
396 \fB\-w\fR \fIwidth\fR
397 changes the output to \fIwidth\fR characters.
398 .TP
399 \fB\-x\fR
400 print information for user-defined capabilities.
401 These are extensions to the terminfo repertoire which can be loaded
402 using the \fB\-x\fR option of \fB@TIC@\fP.
403 .SH FILES
404 .TP 20
405 \*d
406 Compiled terminal description database.
407 .SH EXTENSIONS
408 The
409 \fB\-0\fR,
410 \fB\-1\fR,
411 \fB\-E\fR,
412 \fB\-F\fR,
413 \fB\-G\fR,
414 \fB\-R\fR,
415 \fB\-T\fR,
416 \fB\-V\fR,
417 \fB\-a\fR,
418 \fB\-e\fR,
419 \fB\-f\fR,
420 \fB\-g\fR,
421 \fB\-i\fR,
422 \fB\-l\fR,
423 \fB\-p\fR,
424 \fB\-q\fR and
425 \fB\-t\fR
426 options are not supported in SVr4 curses.
427 .PP
428 The \fB\-r\fR option's notion of `termcap' capabilities is System V Release 4's.
429 Actual BSD curses versions will have a more restricted set.  To see only the
430 4.4BSD set, use \fB\-r\fR \fB\-RBSD\fR.
431 .SH BUGS
432 The \fB\-F\fR option of \fB@INFOCMP@\fR(1M) should be a \fB@TOE@\fR(1M) mode.
433 .SH SEE ALSO
434 \fB@CAPTOINFO@\fR(1M),
435 \fB@INFOTOCAP@\fR(1M),
436 \fB@TIC@\fR(1M),
437 \fB@TOE@\fR(1M),
438 \fBcurses\fR(3X),
439 \fBterminfo\fR(\*n).
440 .PP
441 This describes \fBncurses\fR
442 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
443 .SH AUTHOR
444 Eric S. Raymond <esr@snark.thyrsus.com>
445 and
446 .br
447 Thomas E. Dickey <dickey@invisible-island.net>