]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/infocmp.1m
3a0d1cad5cf1b70128584e60a19774c4a9f71623
[ncurses.git] / man / infocmp.1m
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2012,2013 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.52 2013/01/19 21:23:07 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.
75 In all cases, the boolean
76 fields will be printed first, followed by the numeric fields, followed by the
77 string fields.
78 .SS Default Options
79 If no options are specified and zero or one \fItermnames\fR are specified, the
80 \fB\-I\fR option will be assumed.
81 If more than one \fItermname\fR is specified,
82 the \fB\-d\fR option will be assumed.
83 .SS Comparison Options [\-d] [\-c] [\-n]
84 \fB@INFOCMP@\fR compares the \fBterminfo\fR description of the first terminal
85 \fItermname\fR with each of the descriptions given by the entries for the other
86 terminal's \fItermnames\fR.
87 If a capability is defined for only one of the
88 terminals, the value returned will depend on the type of the capability:
89 \fBF\fR for boolean variables, \fB\-1\fR for integer variables, and \fBNULL\fR
90 for string variables.
91 .PP
92 The \fB\-d\fR option produces a list of each capability that is different
93 between two entries.
94 This option is useful to show the difference between two
95 entries, created by different people, for the same or similar terminals.
96 .PP
97 The \fB\-c\fR option produces a list of each capability that is common between
98 two or more entries.
99 Capabilities that are not set are ignored.
100 This option can be
101 used as a quick check to see if the \fB\-u\fR option is worth using.
102 .PP
103 The \fB\-n\fR option produces a list of each capability that is in none of
104 the given entries.
105 If no \fItermnames\fR are given, the environment variable \fBTERM\fR
106 will be used for both of the \fItermnames\fR.
107 This can be used as a quick
108 check to see if anything was left out of a description.
109 .SS Source Listing Options [\-I] [\-L] [\-C] [\-r]
110 The \fB\-I\fR, \fB\-L\fR, and \fB\-C\fR options will produce a source listing for
111 each terminal named.
112 .
113 .TS
114 center tab(/) ;
115 l l .
116 \fB\-I\fR/use the \fBterminfo\fR names
117 \fB\-L\fR/use the long C variable name listed in <\fBterm.h\fR>
118 \fB\-C\fR/use the \fBtermcap\fR names
119 \fB\-r\fR/when using \fB\-C\fR, put out all capabilities in \fBtermcap\fR form
120 \fB\-K\fR/modifies the \fB\-C\fP option, improving BSD-compatibility.
121 .TE
122 .PP
123 If no \fItermnames\fR are given, the environment variable \fBTERM\fR will be
124 used for the terminal name.
125 .PP
126 The source produced by the \fB\-C\fR option may be used directly as a
127 \fBtermcap\fR entry, but not all parameterized strings can be changed to
128 the \fBtermcap\fR format.
129 \fB@INFOCMP@\fR will attempt to convert most of the
130 parameterized information, and anything not converted will be plainly marked in
131 the output and commented out.
132 These should be edited by hand.
133 .PP
134 For best results when converting to \fBtermcap\fP format,
135 you should use both \fB\-C\fP and \fB\-r\fP.
136 Normally a termcap description is limited to 1023 bytes.
137 @INFOCMP@ trims away less essential parts to make it fit.
138 If you are converting to one of the (rare) termcap implementations
139 which accept an unlimited size of termcap,
140 you may want to add the \fB\-T\fP option.
141 More often however, you must help the termcap implementation,
142 and trim excess whitespace (use the \fB\-0\fP option for that).
143 .PP
144 All padding information for strings will be collected together and placed
145 at the beginning of the string where \fBtermcap\fR expects it.
146 Mandatory
147 padding (padding information with a trailing '/') will become optional.
148 .PP
149 All \fBtermcap\fR variables no longer supported by \fBterminfo\fR, but which
150 are derivable from other \fBterminfo\fR variables, will be output.
151 Not all
152 \fBterminfo\fR capabilities will be translated; only those variables which were
153 part of \fBtermcap\fR will normally be output.
154 Specifying the \fB\-r\fR option
155 will take off this restriction, allowing all capabilities to be output in
156 \fItermcap\fR form.
157 Normally you would use both the \fB\-C\fP and \fB\-r\fP options.
158 The actual format used incorporates some improvements for escaped characters
159 from terminfo format.
160 For a stricter BSD-compatible translation, use the \fB\-K\fR option
161 rather than \fB\-C\fP.
162 .PP
163 Note that because padding is collected to the beginning of the capability, not
164 all capabilities are output.
165 Mandatory padding is not supported.
166 Because
167 \fBtermcap\fR strings are not as flexible, it is not always possible to convert
168 a \fBterminfo\fR string capability into an equivalent \fBtermcap\fR format.
169 A subsequent conversion of the \fBtermcap\fR file back into \fBterminfo\fR format
170 will not necessarily reproduce the original \fBterminfo\fR
171 source.
172 .PP
173 Some common \fBterminfo\fR parameter sequences, their \fBtermcap\fR
174 equivalents, and some terminal types which commonly have such sequences, are:
175 .
176 .TS
177 center tab(/) ;
178 l c l
179 l l l.
180 \fBterminfo/termcap\fR/Representative Terminals
181 =
182 \fB%p1%c/%.\fR/adm
183 \fB%p1%d/%d\fR/hp, ANSI standard, vt100
184 \fB%p1%'x'%+%c/%+x\fR/concept
185 \fB%i/%i\fRq/ANSI standard, vt100
186 \fB%p1%?%'x'%>%t%p1%'y'%+%;/%>xy\fR/concept
187 \fB%p2\fR is printed before \fB%p1/%r\fR/hp
188 .TE
189 .SS Use= Option [\-u]
190 The \fB\-u\fR option produces a \fBterminfo\fR source description of the first
191 terminal \fItermname\fR which is relative to the sum of the descriptions given
192 by the entries for the other terminals \fItermnames\fR.
193 It does this by
194 analyzing the differences between the first \fItermname\fR and the other
195 \fItermnames\fR and producing a description with \fBuse=\fR fields for the
196 other terminals.
197 In this manner, it is possible to retrofit generic terminfo
198 entries into a terminal's description.
199 Or, if two similar terminals exist, but
200 were coded at different times or by different people so that each description
201 is a full description, using \fB@INFOCMP@\fR will show what can be done to change
202 one description to be relative to the other.
203 .PP
204 A capability will get printed with an at-sign (@) if it no longer exists in the
205 first \fItermname\fR, but one of the other \fItermname\fR entries contains a
206 value for it.
207 A capability's value gets printed if the value in the first
208 \fItermname\fR is not found in any of the other \fItermname\fR entries, or if
209 the first of the other \fItermname\fR entries that has this capability gives a
210 different value for the capability than that in the first \fItermname\fR.
211 .PP
212 The order of the other \fItermname\fR entries is significant.
213 Since the
214 terminfo compiler \fB@TIC@\fR does a left-to-right scan of the capabilities,
215 specifying two \fBuse=\fR entries that contain differing entries for the same
216 capabilities will produce different results depending on the order that the
217 entries are given in.
218 \fB@INFOCMP@\fR will flag any such inconsistencies between
219 the other \fItermname\fR entries as they are found.
220 .PP
221 Alternatively, specifying a capability \fIafter\fR a \fBuse=\fR entry that
222 contains that capability will cause the second specification to be ignored.
223 Using \fB@INFOCMP@\fR to recreate a description can be a useful check to make
224 sure that everything was specified correctly in the original source
225 description.
226 .PP
227 Another error that does not cause incorrect compiled files, but will slow down
228 the compilation time, is specifying extra \fBuse=\fR fields that are
229 superfluous.
230 \fB@INFOCMP@\fR will flag any other \fItermname use=\fR fields that
231 were not needed.
232 .SS Changing Databases [\-A \fIdirectory\fR] [\-B \fIdirectory\fR]
233 The location of the compiled \fBterminfo\fR database is taken from the
234 environment variable \fBTERMINFO\fR\ .
235 If the variable is not defined, or the
236 terminal is not found in that location, the system \fBterminfo\fR database,
237 in \fB@TERMINFO@\fR, will be used.
238 The options \fB\-A\fR
239 and \fB\-B\fR may be used to override this location.
240 The \fB\-A\fR option will
241 set \fBTERMINFO\fR for the first \fItermname\fR and the \fB\-B\fR option will
242 set \fBTERMINFO\fR for the other \fItermnames\fR.
243 With this, it is possible to
244 compare descriptions for a terminal with the same name located in two different
245 databases.
246 This is useful for comparing descriptions for the same terminal
247 created by different people.
248 .SS Other Options
249 .TP 5
250 \fB\-0\fR
251 causes the fields to be printed on one line, without wrapping.
252 .TP 5
253 \fB\-1\fR
254 causes the fields to be printed out one to a line.
255 Otherwise,
256 the fields will be printed several to a line to a maximum width
257 of 60 characters.
258 .TP
259 \fB\-a\fR
260 tells \fB@INFOCMP@\fP to retain commented-out capabilities rather than discarding
261 them.
262 Capabilities are commented by prefixing them with a period.
263 .TP
264 \fB\-D\fR
265 tells \fB@INFOCMP@\fP to print the database locations that it knows about, and exit.
266 .TP 5
267 \fB\-E\fR
268 Dump the capabilities of the given terminal as tables, needed in
269 the C initializer for a
270 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
271 This option is useful for preparing versions of the curses library hardwired
272 for a given terminal type.
273 The tables are all declared static, and are named according to the type
274 and the name of the corresponding terminal entry.
275 .sp
276 Before ncurses 5.0, the split between the \fB\-e\fP and \fB\-E\fP
277 options was not needed; but support for extended names required making
278 the arrays of terminal capabilities separate from the TERMTYPE structure.
279 .TP 5
280 \fB\-e\fR
281 Dump the capabilities of the given terminal as a C initializer for a
282 TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fR).
283 This option is useful for preparing versions of the curses library hardwired
284 for a given terminal type.
285 .TP 5
286 \fB\-F\fR
287 compare terminfo files.
288 This assumes that two following arguments are filenames.
289 The files are searched for pairwise matches between
290 entries, with two entries considered to match if any of their names do.
291 The report printed to standard output lists entries with no matches in
292 the other file, and entries with more than one match.
293 For entries
294 with exactly one match it includes a difference report.
295 Normally,
296 to reduce the volume of the report, use references are
297 not resolved before looking for differences, but resolution can be forced
298 by also specifying \fB\-r\fR.
299 .TP 5
300 \fB\-f\fR
301 Display complex terminfo strings which contain if/then/else/endif expressions
302 indented for readability.
303 .TP 5
304 \fB\-G\fR
305 Display constant literals in decimal form
306 rather than their character equivalents.
307 .TP 5
308 \fB\-g\fR
309 Display constant character literals in quoted form
310 rather than their decimal equivalents.
311 .TP 5
312 \fB\-i\fR
313 Analyze the initialization (\fBis1\fR, \fBis2\fR, \fBis3\fR), and reset
314 (\fBrs1\fR, \fBrs2\fR, \fBrs3\fR), strings in the entry.
315 For each string, the
316 code tries to analyze it into actions in terms of the other capabilities in the
317 entry, certain X3.64/ISO 6429/ECMA\-48 capabilities, and certain DEC VT-series
318 private modes (the set of recognized special sequences has been selected for
319 completeness over the existing terminfo database).
320 Each report line consists
321 of the capability name, followed by a colon and space, followed by a printable
322 expansion of the capability string with sections matching recognized actions
323 translated into {}-bracketed descriptions.
324 Here is a list of the DEC/ANSI
325 special sequences recognized:
326 i.
327 .TS
328 center tab(/) ;
329 l l
330 l l.
331 Action/Meaning
332 =
333 RIS/full reset
334 SC/save cursor
335 RC/restore cursor
336 LL/home-down
337 RSR/reset scroll region
338 =
339 DECSTR/soft reset (VT320)
340 S7C1T/7-bit controls (VT220)
341 =
342 ISO DEC G0/enable DEC graphics for G0
343 ISO UK G0/enable UK chars for G0
344 ISO US G0/enable US chars for G0
345 ISO DEC G1/enable DEC graphics for G1
346 ISO UK G1/enable UK chars for G1
347 ISO US G1/enable US chars for G1
348 =
349 DECPAM/application keypad mode
350 DECPNM/normal keypad mode
351 DECANSI/enter ANSI mode
352 =
353 ECMA[+\-]AM/keyboard action mode
354 ECMA[+\-]IRM/insert replace mode
355 ECMA[+\-]SRM/send receive mode
356 ECMA[+\-]LNM/linefeed mode
357 =
358 DEC[+\-]CKM/application cursor keys
359 DEC[+\-]ANM/set VT52 mode
360 DEC[+\-]COLM/132-column mode
361 DEC[+\-]SCLM/smooth scroll
362 DEC[+\-]SCNM/reverse video mode
363 DEC[+\-]OM/origin mode
364 DEC[+\-]AWM/wraparound mode
365 DEC[+\-]ARM/auto-repeat mode
366 .TE
367 .sp
368 It also recognizes a SGR action corresponding to ANSI/ISO 6429/ECMA Set
369 Graphics Rendition, with the values NORMAL, BOLD, UNDERLINE, BLINK, and
370 REVERSE.
371 All but NORMAL may be prefixed with `+' (turn on) or `\-' (turn off).
372 .PP
373 An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
374 .TP 5
375 \fB\-l\fR
376 Set output format to terminfo.
377 .TP 5
378 \fB\-p\fR
379 Ignore padding specifications when comparing strings.
380 .TP 5
381 \fB\-q\fR
382 Make the comparison listing shorter by omitting subheadings, and using
383 "\-" for absent capabilities, "@" for canceled rather than "NULL".
384 .TP 5
385 \fB\-R\fR\fIsubset\fR
386 Restrict output to a given subset.
387 This option is for use with archaic
388 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
389 the full set of SVR4/XSI Curses terminfo; and variants such as AIX
390 that have their own extensions incompatible with SVr4/XSI.
391 Available terminfo
392 subsets are "SVr1", "Ultrix", "HP", and "AIX"; see \fBterminfo\fR(\*n) for
393 details.
394 You can also choose the subset "BSD" which selects only capabilities
395 with termcap equivalents recognized by 4.4BSD.
396 .TP
397 \fB\-s \fR\fI[d|i|l|c]\fR
398 The \fB\-s\fR option sorts the fields within each type according to the argument
399 below:
400 .br
401 .RS 5
402 .TP 5
403 \fBd\fR
404 leave fields in the order that they are stored in the \fIterminfo\fR database.
405 .TP 5
406 \fBi\fR
407 sort by \fIterminfo\fR name.
408 .TP 5
409 \fBl\fR
410 sort by the long C variable name.
411 .TP 5
412 \fBc\fR
413 sort by the \fItermcap\fR name.
414 .RE
415 .IP
416 If the \fB\-s\fR option is not given, the fields printed out will be
417 sorted alphabetically by the \fBterminfo\fR name within each type,
418 except in the case of the \fB\-C\fR or the \fB\-L\fR options, which cause the
419 sorting to be done by the \fBtermcap\fR name or the long C variable
420 name, respectively.
421 .TP 5
422 \fB\-T\fR
423 eliminates size-restrictions on the generated text.
424 This is mainly useful for testing and analysis, since the compiled
425 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
426 .TP
427 \fB\-t\fR
428 tells \fB@TIC@\fP to discard commented-out capabilities.
429 Normally when translating from terminfo to termcap,
430 untranslatable capabilities are commented-out.
431 .TP 5
432 \fB\-U\fR
433 tells \fB@INFOCMP@\fP to not post-process the data after parsing the source file.
434 This feature helps when comparing the actual contents of two source files,
435 since it excludes the inferences that \fB@INFOCMP@\fP makes to fill in missing
436 data.
437 .TP 5
438 \fB\-V\fR
439 reports the version of ncurses which was used in this program, and exits.
440 .TP 5
441 \fB\-v\fR \fIn\fR
442 prints out tracing information on standard error as the program runs.
443 Higher values of n induce greater verbosity.
444 .TP 5
445 \fB\-w\fR \fIwidth\fR
446 changes the output to \fIwidth\fR characters.
447 .TP
448 \fB\-x\fR
449 print information for user-defined capabilities.
450 These are extensions to the terminfo repertoire which can be loaded
451 using the \fB\-x\fR option of \fB@TIC@\fP.
452 .SH FILES
453 .TP 20
454 \*d
455 Compiled terminal description database.
456 .SH EXTENSIONS
457 The
458 \fB\-0\fR,
459 \fB\-1\fR,
460 \fB\-E\fR,
461 \fB\-F\fR,
462 \fB\-G\fR,
463 \fB\-R\fR,
464 \fB\-T\fR,
465 \fB\-V\fR,
466 \fB\-a\fR,
467 \fB\-e\fR,
468 \fB\-f\fR,
469 \fB\-g\fR,
470 \fB\-i\fR,
471 \fB\-l\fR,
472 \fB\-p\fR,
473 \fB\-q\fR and
474 \fB\-t\fR
475 options are not supported in SVr4 curses.
476 .PP
477 The \fB\-r\fR option's notion of `termcap' capabilities is System V Release 4's.
478 Actual BSD curses versions will have a more restricted set.
479 To see only the
480 4.4BSD set, use \fB\-r\fR \fB\-RBSD\fR.
481 .SH BUGS
482 The \fB\-F\fR option of \fB@INFOCMP@\fR(1M) should be a \fB@TOE@\fR(1M) mode.
483 .SH SEE ALSO
484 \fB@CAPTOINFO@\fR(1M),
485 \fB@INFOTOCAP@\fR(1M),
486 \fB@TIC@\fR(1M),
487 \fB@TOE@\fR(1M),
488 \fBcurses\fR(3X),
489 \fBterminfo\fR(\*n).
490 .sp
491 http://invisible-island.net/ncurses/tctest.html
492 .PP
493 This describes \fBncurses\fR
494 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
495 .SH AUTHOR
496 Eric S. Raymond <esr@snark.thyrsus.com>
497 and
498 .br
499 Thomas E. Dickey <dickey@invisible-island.net>