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