blob: 5f92c96dd63b8663c588fd9ff49d0f33443709ae [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301'\" t
2.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04003.\" Copyright 2018-2023,2024 Thomas E. Dickey *
4.\" Copyright 1998-2017,2018 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05305.\" *
6.\" Permission is hereby granted, free of charge, to any person obtaining a *
7.\" copy of this software and associated documentation files (the *
8.\" "Software"), to deal in the Software without restriction, including *
9.\" without limitation the rights to use, copy, modify, merge, publish, *
10.\" distribute, distribute with modifications, sublicense, and/or sell *
11.\" copies of the Software, and to permit persons to whom the Software is *
12.\" furnished to do so, subject to the following conditions: *
13.\" *
14.\" The above copyright notice and this permission notice shall be included *
15.\" in all copies or substantial portions of the Software. *
16.\" *
17.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24.\" *
25.\" Except as contained in this notice, the name(s) of the above copyright *
26.\" holders shall not be used in advertising or otherwise to promote the *
27.\" sale, use or other dealings in this Software without prior written *
28.\" authorization. *
29.\"***************************************************************************
30.\"
micky3879b9f5e72025-07-08 18:04:53 -040031.\" $Id: infocmp.1m,v 1.109 2024/03/16 15:35:01 tom Exp $
32.TH @INFOCMP@ 1M 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "User commands"
33.ie \n(.g \{\
34.ds `` \(lq
35.ds '' \(rq
36.ds ' \(aq
37.\}
38.el \{\
39.ie t .ds `` ``
40.el .ds `` ""
41.ie t .ds '' ''
42.el .ds '' ""
43.ie t .ds ' \(aq
44.el .ds ' '
45.\}
46.
Steve Kondikae271bc2015-11-15 02:50:53 +010047.de bP
micky3879b9f5e72025-07-08 18:04:53 -040048.ie n .IP \(bu 4
49.el .IP \(bu 2
Steve Kondikae271bc2015-11-15 02:50:53 +010050..
micky3879b9f5e72025-07-08 18:04:53 -040051.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053052.ds d @TERMINFO@
53.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040054\fB@INFOCMP@\fP \-
55compare or print out \fIterminfo\fP descriptions
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053056.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040057\fB@INFOCMP@\fP [\fB\-\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530581\
micky3879b9f5e72025-07-08 18:04:53 -040059c\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053060C\
micky3879b9f5e72025-07-08 18:04:53 -040061d\
Steve Kondikae271bc2015-11-15 02:50:53 +010062D\
micky3879b9f5e72025-07-08 18:04:53 -040063e\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053064E\
65F\
micky3879b9f5e72025-07-08 18:04:53 -040066g\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053067G\
micky3879b9f5e72025-07-08 18:04:53 -040068i\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053069I\
Steve Kondikae271bc2015-11-15 02:50:53 +010070K\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053071l\
micky3879b9f5e72025-07-08 18:04:53 -040072L\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053073n\
74p\
75q\
76r\
77t\
micky3879b9f5e72025-07-08 18:04:53 -040078T\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053079u\
micky3879b9f5e72025-07-08 18:04:53 -040080U\
81V\
82W\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053083x\
micky3879b9f5e72025-07-08 18:04:53 -040084\fP]
85 [\fB\-v\fR \fIn\fR] [\fB\-s d\fR| \fBi\fR| \fBl\fR| \fBc\fR] [\fB\-Q\fR \fIn\fR] [\fB\-R \fBsubset\fR]
86 [\fB\-w\fP\ \fIwidth\fP] [\fB\-A\fP\ \fIdirectory\fP] [\fB\-B\fP\ \fIdirectory\fP]
87 [\fIterminal-type\fP ...]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053088.SH DESCRIPTION
micky3879b9f5e72025-07-08 18:04:53 -040089\fB@INFOCMP@\fP can be used to compare a binary \fBterminfo\fP entry with other
90terminfo entries, rewrite a \fBterminfo\fP description to take advantage of the
91\fBuse=\fP terminfo field, or print out a \fBterminfo\fP description from the
92binary file (\fBterm\fP) in a variety of formats.
93In all cases, the Boolean
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053094fields will be printed first, followed by the numeric fields, followed by the
95string fields.
micky3879b9f5e72025-07-08 18:04:53 -040096.SS "Default Options"
97If no options are specified and zero or one \fIterminal-types\fP are
98specified,
99the
100\fB\-I\fP option will be assumed.
101If more than one \fIterminal-type\fP is specified,
102the \fB\-d\fP option will be assumed.
103.SS "Comparison Options [\-d] [\-c] [\-n]"
104\fB@INFOCMP@\fP compares the \fBterminfo\fP description of the first terminal
105\fIterminal-type\fP with each of the descriptions given by the entries
106for the other terminal's \fIterminal-types\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +0100107If a capability is defined for only one of the
micky3879b9f5e72025-07-08 18:04:53 -0400108terminals, the value returned depends on the type of the capability:
109.bP
110\fBF\fP for missing Boolean variables
111.bP
112\fBNULL\fP for missing integer or string variables
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530113.PP
micky3879b9f5e72025-07-08 18:04:53 -0400114Use the \fB\-q\fP option to show the distinction between
115\fIabsent\fP and \fIcancelled\fP capabilities.
116.PP
117These options produce a list which you can use to compare two
118or more terminal descriptions:
119.TP 5
120\fB\-d\fP
121produces a list of each capability that is \fIdifferent\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100122between two entries.
micky3879b9f5e72025-07-08 18:04:53 -0400123Each item in the list shows \*(``:\*('' after the capability name,
124followed by the capability values, separated by a comma.
125.TP
126\fB\-c\fP
127produces a list of each capability that is \fIcommon\fP between
Steve Kondikae271bc2015-11-15 02:50:53 +0100128two or more entries.
micky3879b9f5e72025-07-08 18:04:53 -0400129Missing capabilities are ignored.
130Each item in the list shows \*(``=\*('' after the capability name,
131followed by the capability value.
132.IP
133The \fB\-u\fP option provides a related output,
134showing the first terminal description rewritten to use the second
135as a building block via the \*(``use=\*('' clause.
136.TP
137\fB\-n\fP
138produces a list of each capability that is in \fInone\fP of the given entries.
139Each item in the list shows \*(``!\*('' before the capability name.
140.IP
141Normally only the conventional capabilities are shown.
142Use the \fB\-x\fP option to add the BSD-compatibility
143capabilities (names prefixed with \*(``OT\*('').
144.IP
145If no \fIterminal-types\fP are given,
146\fB@INFOCMP@\fP uses the environment variable \fITERM\fP
147for each of the \fIterminal-types\fP.
148.SS "Source Listing Options [\-I] [\-L] [\-C] [\-r]"
149The \fB\-I\fP, \fB\-L\fP, and \fB\-C\fP options will produce
150a source listing for each terminal named.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530151.PP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530152.TS
micky3879b9f5e72025-07-08 18:04:53 -0400153center;
154Lb L.
155\-I use \fIterminfo\fP capability codes
156\-L use \*(``long\*('' capability names
157\-C use \fItermcap\fP capability codes
158\-r with \fB\-C\fP, include nonstandard capabilities
159\-K with \fB\-C\fP, improve BSD compatibility
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530160.TE
161.PP
micky3879b9f5e72025-07-08 18:04:53 -0400162If no \fIterminal-types\fP are given,
163the environment variable \fITERM\fP will be used for the terminal name.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530164.PP
micky3879b9f5e72025-07-08 18:04:53 -0400165The source produced by the \fB\-C\fP option may be used directly as a
166\fBtermcap\fP entry, but not all parameterized strings can be changed to
167the \fBtermcap\fP format.
168\fB@INFOCMP@\fP will attempt to convert most of the
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530169parameterized information, and anything not converted will be plainly marked in
Steve Kondikae271bc2015-11-15 02:50:53 +0100170the output and commented out.
171These should be edited by hand.
172.PP
173For best results when converting to \fBtermcap\fP format,
174you should use both \fB\-C\fP and \fB\-r\fP.
175Normally a termcap description is limited to 1023 bytes.
micky3879b9f5e72025-07-08 18:04:53 -0400176\fB@INFOCMP@\fP trims away less essential parts to make it fit.
Steve Kondikae271bc2015-11-15 02:50:53 +0100177If you are converting to one of the (rare) termcap implementations
178which accept an unlimited size of termcap,
179you may want to add the \fB\-T\fP option.
180More often however, you must help the termcap implementation,
181and trim excess whitespace (use the \fB\-0\fP option for that).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530182.PP
183All padding information for strings will be collected together and placed
micky3879b9f5e72025-07-08 18:04:53 -0400184at the beginning of the string where \fBtermcap\fP expects it.
Steve Kondikae271bc2015-11-15 02:50:53 +0100185Mandatory
micky3879b9f5e72025-07-08 18:04:53 -0400186padding (padding information with a trailing \*(``/\*('') will become optional.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530187.PP
micky3879b9f5e72025-07-08 18:04:53 -0400188All \fBtermcap\fP variables no longer supported by \fBterminfo\fP, but which
189are derivable from other \fBterminfo\fP variables, will be output.
Steve Kondikae271bc2015-11-15 02:50:53 +0100190Not all
micky3879b9f5e72025-07-08 18:04:53 -0400191\fBterminfo\fP capabilities will be translated; only those variables which were
192part of \fBtermcap\fP will normally be output.
193Specifying the \fB\-r\fP option
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530194will take off this restriction, allowing all capabilities to be output in
micky3879b9f5e72025-07-08 18:04:53 -0400195\fItermcap\fP form.
Steve Kondikae271bc2015-11-15 02:50:53 +0100196Normally you would use both the \fB\-C\fP and \fB\-r\fP options.
197The actual format used incorporates some improvements for escaped characters
198from terminfo format.
micky3879b9f5e72025-07-08 18:04:53 -0400199For a stricter BSD-compatible translation, use the \fB\-K\fP option
Steve Kondikae271bc2015-11-15 02:50:53 +0100200rather than \fB\-C\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530201.PP
202Note that because padding is collected to the beginning of the capability, not
Steve Kondikae271bc2015-11-15 02:50:53 +0100203all capabilities are output.
204Mandatory padding is not supported.
205Because
micky3879b9f5e72025-07-08 18:04:53 -0400206\fBtermcap\fP strings are not as flexible, it is not always possible to convert
207a \fBterminfo\fP string capability into an equivalent \fBtermcap\fP format.
208A subsequent conversion of the \fBtermcap\fP file
209back into \fBterminfo\fP format
210will not necessarily reproduce the original \fBterminfo\fP source.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530211.PP
micky3879b9f5e72025-07-08 18:04:53 -0400212Some common \fBterminfo\fP parameter sequences, their \fBtermcap\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530213equivalents, and some terminal types which commonly have such sequences, are:
micky3879b9f5e72025-07-08 18:04:53 -0400214.PP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530215.TS
micky3879b9f5e72025-07-08 18:04:53 -0400216center;
217Lf(BI) Lf(BI) L
218Lb Lb L.
219terminfo termcap Terminal Types
220_
221.\" ansi-m cup (adm3a has other stuff in between, more like concept)
222%p1%c %. ansi\-m
223.\" ansi cub, vt100 cub
224%p1%d %d ansi, vt100
225.\" vt52 cup (via vt52-basic)
226%p1%\*' \*'%+%c %+x vt52
227.\" ansi cup, vt100 cup
228%i %iq ansi, vt100
229.\" annarbor4080 cup
230%p1%?%\*'x\*'%>%t%p1%\*'y\*'%+%; %>xy annarbor4080
231.\" hpgeneric cup
232%p2\fR\|.\|.\|.\|\fP%p1 %r hpgeneric
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530233.TE
micky3879b9f5e72025-07-08 18:04:53 -0400234.SS "Use= Option [\-u]"
235The \fB\-u\fP option produces a \fBterminfo\fP source description of the first
236terminal \fIterminal-type\fP which is relative to the sum of the
237descriptions given by the entries for the other \fIterminal-types\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +0100238It does this by
micky3879b9f5e72025-07-08 18:04:53 -0400239analyzing the differences between the first \fIterminal-types\fP and the
240other \fIterminal-types\fP and producing a description with \fBuse=\fP
241fields for the other terminals.
Steve Kondikae271bc2015-11-15 02:50:53 +0100242In this manner, it is possible to retrofit generic terminfo
243entries into a terminal's description.
244Or, if two similar terminals exist, but
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530245were coded at different times or by different people so that each description
micky3879b9f5e72025-07-08 18:04:53 -0400246is a full description, using \fB@INFOCMP@\fP
247will show what can be done to change
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530248one description to be relative to the other.
249.PP
micky3879b9f5e72025-07-08 18:04:53 -0400250A capability will be printed with an at-sign (@) if it no longer exists in the
251first \fIterminal-type\fP,
252but one of the other \fIterminal-type\fP entries contains a value for
253it.
254A capability's value will be printed if the value in the first
255\fIterminal-type\fP is not found in any of the other \fIterminal-type\fP
256entries,
257or if the first of the other \fIterminal-type\fP entries that has this
258capability gives a different value for the capability than that in the
259first \fIterminal-type\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530260.PP
micky3879b9f5e72025-07-08 18:04:53 -0400261The order of the other \fIterminal-type\fP entries is significant.
Steve Kondikae271bc2015-11-15 02:50:53 +0100262Since the
micky3879b9f5e72025-07-08 18:04:53 -0400263terminfo compiler \fB@TIC@\fP does a left-to-right scan of the capabilities,
264specifying two \fBuse=\fP entries that contain differing entries for the same
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530265capabilities will produce different results depending on the order that the
Steve Kondikae271bc2015-11-15 02:50:53 +0100266entries are given in.
micky3879b9f5e72025-07-08 18:04:53 -0400267\fB@INFOCMP@\fP will flag any such inconsistencies between
268the other \fIterminal-type\fP entries as they are found.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530269.PP
micky3879b9f5e72025-07-08 18:04:53 -0400270Alternatively, specifying a capability \fIafter\fP a \fBuse=\fP entry that
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530271contains that capability will cause the second specification to be ignored.
micky3879b9f5e72025-07-08 18:04:53 -0400272Using \fB@INFOCMP@\fP to recreate a description can be a useful check to make
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530273sure that everything was specified correctly in the original source
274description.
275.PP
276Another error that does not cause incorrect compiled files, but will slow down
micky3879b9f5e72025-07-08 18:04:53 -0400277the compilation time, is specifying extra \fBuse=\fP fields that are
Steve Kondikae271bc2015-11-15 02:50:53 +0100278superfluous.
micky3879b9f5e72025-07-08 18:04:53 -0400279\fB@INFOCMP@\fP will flag any other \fIterminal-type use=\fP fields that
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530280were not needed.
micky3879b9f5e72025-07-08 18:04:53 -0400281.SS "Changing Databases [\-A \fIdirectory\fR] [\-B \fIdirectory\fR]"
282Like other \fI\%ncurses\fP utilities,
283\fB@INFOCMP@\fP looks for the terminal descriptions in several places.
284You can use the \fI\%TERMINFO\fP and \fI\%TERMINFO_DIRS\fP environment
285variables to override the compiled-in default list of places to search.
286See \fBcurses\fP(3X), as well as
287the \fIFetching Compiled Descriptions\fP section in \fBterminfo\fR(5).
Steve Kondikae271bc2015-11-15 02:50:53 +0100288.PP
micky3879b9f5e72025-07-08 18:04:53 -0400289You can also use the options \fB\-A\fP
290and \fB\-B\fP to override the list of places to search
Steve Kondikae271bc2015-11-15 02:50:53 +0100291when comparing terminal descriptions:
292.bP
micky3879b9f5e72025-07-08 18:04:53 -0400293The \fB\-A\fP option sets the location for the first \fIterminal-type\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100294.bP
micky3879b9f5e72025-07-08 18:04:53 -0400295The \fB\-B\fP option sets the location for the other
296\fIterminal-types\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +0100297.PP
298Using these options, it is possible to
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530299compare descriptions for a terminal with the same name located in two different
Steve Kondikae271bc2015-11-15 02:50:53 +0100300databases.
301For instance,
302you can use this feature for comparing descriptions for the same terminal
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530303created by different people.
micky3879b9f5e72025-07-08 18:04:53 -0400304.SS "Other Options"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530305.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400306\fB\-0\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100307causes the fields to be printed on one line, without wrapping.
308.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400309\fB\-1\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100310causes the fields to be printed out one to a line.
311Otherwise,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530312the fields will be printed several to a line to a maximum width
313of 60 characters.
314.TP
micky3879b9f5e72025-07-08 18:04:53 -0400315\fB\-a\fP
316tells \fB@INFOCMP@\fP to retain commented-out capabilities
317rather than discarding them.
Steve Kondikae271bc2015-11-15 02:50:53 +0100318Capabilities are commented by prefixing them with a period.
319.TP
micky3879b9f5e72025-07-08 18:04:53 -0400320\fB\-D\fP
321tells \fB@INFOCMP@\fP to print the database locations that it knows about,
322and exit.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530323.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400324\fB\-E\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530325Dump the capabilities of the given terminal as tables, needed in
326the C initializer for a
micky3879b9f5e72025-07-08 18:04:53 -0400327TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fP).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530328This option is useful for preparing versions of the curses library hardwired
329for a given terminal type.
330The tables are all declared static, and are named according to the type
331and the name of the corresponding terminal entry.
332.sp
micky3879b9f5e72025-07-08 18:04:53 -0400333Before \fI\%ncurses\fP 5.0,
334the split between the \fB\-e\fP and \fB\-E\fP options was not needed;
335but support for extended names required making the arrays of terminal
336capabilities separate from the TERMTYPE structure.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530337.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400338\fB\-e\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530339Dump the capabilities of the given terminal as a C initializer for a
micky3879b9f5e72025-07-08 18:04:53 -0400340TERMTYPE structure (the terminal capability structure in the \fB<term.h>\fP).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530341This option is useful for preparing versions of the curses library hardwired
342for a given terminal type.
343.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400344\fB\-F\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100345compare terminfo files.
346This assumes that two following arguments are filenames.
347The files are searched for pairwise matches between
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530348entries, with two entries considered to match if any of their names do.
349The report printed to standard output lists entries with no matches in
Steve Kondikae271bc2015-11-15 02:50:53 +0100350the other file, and entries with more than one match.
351For entries
352with exactly one match it includes a difference report.
353Normally,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530354to reduce the volume of the report, use references are
355not resolved before looking for differences, but resolution can be forced
micky3879b9f5e72025-07-08 18:04:53 -0400356by also specifying \fB\-r\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530357.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400358\fB\-f\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530359Display complex terminfo strings which contain if/then/else/endif expressions
360indented for readability.
361.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400362\fB\-G\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530363Display constant literals in decimal form
364rather than their character equivalents.
365.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400366\fB\-g\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530367Display constant character literals in quoted form
368rather than their decimal equivalents.
369.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400370\fB\-i\fP
371Analyze the initialization (\fBis1\fP, \fBis2\fP, \fBis3\fP), and reset
372(\fBrs1\fP, \fBrs2\fP, \fBrs3\fP), strings in the entry,
Steve Kondikae271bc2015-11-15 02:50:53 +0100373as well as those used for starting/stopping cursor-positioning mode
374(\fBsmcup\fP, \fBrmcup\fP) as well as starting/stopping keymap mode
375(\fBsmkx\fP, \fBrmkx\fP).
376.IP
377For each string, the
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530378code tries to analyze it into actions in terms of the other capabilities in the
Steve Kondikae271bc2015-11-15 02:50:53 +0100379entry, certain X3.64/ISO 6429/ECMA\-48 capabilities, and certain DEC VT-series
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530380private modes (the set of recognized special sequences has been selected for
Steve Kondikae271bc2015-11-15 02:50:53 +0100381completeness over the existing terminfo database).
382Each report line consists
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530383of the capability name, followed by a colon and space, followed by a printable
384expansion of the capability string with sections matching recognized actions
Steve Kondikae271bc2015-11-15 02:50:53 +0100385translated into {}-bracketed descriptions.
386.IP
387Here is a list of the DEC/ANSI
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530388special sequences recognized:
micky3879b9f5e72025-07-08 18:04:53 -0400389.PP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530390.TS
micky3879b9f5e72025-07-08 18:04:53 -0400391center;
392L L.
393Action Meaning
394_
395RIS full reset
396SC save cursor
397RC restore cursor
398LL home-down
399RSR reset scroll region
400_
401DECSTR soft reset (VT320)
402S7C1T 7-bit controls (VT220)
403_
404ISO DEC G0 enable DEC graphics for G0
405ISO UK G0 enable UK chars for G0
406ISO US G0 enable US chars for G0
407ISO DEC G1 enable DEC graphics for G1
408ISO UK G1 enable UK chars for G1
409ISO US G1 enable US chars for G1
410_
411DECPAM application keypad mode
412DECPNM normal keypad mode
413DECANSI enter ANSI mode
414_
415ECMA[+\-]AM keyboard action mode
416ECMA[+\-]IRM insert replace mode
417ECMA[+\-]SRM send receive mode
418ECMA[+\-]LNM linefeed mode
419_
420DEC[+\-]CKM application cursor keys
421DEC[+\-]ANM set VT52 mode
422DEC[+\-]COLM 132-column mode
423DEC[+\-]SCLM smooth scroll
424DEC[+\-]SCNM reverse video mode
425DEC[+\-]OM origin mode
426DEC[+\-]AWM wraparound mode
427DEC[+\-]ARM auto-repeat mode
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530428.TE
429.sp
430It also recognizes a SGR action corresponding to ANSI/ISO 6429/ECMA Set
431Graphics Rendition, with the values NORMAL, BOLD, UNDERLINE, BLINK, and
Steve Kondikae271bc2015-11-15 02:50:53 +0100432REVERSE.
micky3879b9f5e72025-07-08 18:04:53 -0400433All but NORMAL may be prefixed with
434.RS
435.bP
436\*(``+\*('' (turn on) or
437.bP
438\*(``\-\*('' (turn off).
439.RE
Steve Kondikae271bc2015-11-15 02:50:53 +0100440.IP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530441An SGR0 designates an empty highlight sequence (equivalent to {SGR:NORMAL}).
442.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400443\fB\-l\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530444Set output format to terminfo.
445.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400446\fB\-p\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530447Ignore padding specifications when comparing strings.
448.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400449\fB\-Q\fP \fIn\fP
450Rather than show source in terminfo (text) format,
451print the compiled (binary) format in hexadecimal or base64 form,
452depending on the option's value:
453.RS 8
454.TP 3
4551
456hexadecimal
457.TP 3
4582
459base64
460.TP 3
4613
462hexadecimal and base64
463.RE
464.IP
465For example, this prints the compiled terminfo value as a string
466which could be assigned to the \fI\%TERMINFO\fP environment variable:
467.PP
468.RS 9
469.EX
470@INFOCMP@ \-0 \-q \-Q2
471.EE
472.RE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530473.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400474\fB\-q\fP
475This makes the output a little shorter:
476.RS
477.bP
478Make the comparison listing shorter by omitting subheadings, and using
479\*(``\-\*('' for absent capabilities, \*(``@\*(''
480for canceled rather than \*(``NULL\*(''.
481.bP
482However, show differences between absent and cancelled capabilities.
483.bP
484Omit the \*(``Reconstructed from\*('' comment for source listings.
485.RE
486.TP 5
487\fB\-R\fIsubset\fR
Steve Kondikae271bc2015-11-15 02:50:53 +0100488Restrict output to a given subset.
489This option is for use with archaic
micky3879b9f5e72025-07-08 18:04:53 -0400490versions of terminfo like those on SVr1, Ultrix, or HP-UX that do not support
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530491the full set of SVR4/XSI Curses terminfo; and variants such as AIX
Steve Kondikae271bc2015-11-15 02:50:53 +0100492that have their own extensions incompatible with SVr4/XSI.
micky3879b9f5e72025-07-08 18:04:53 -0400493.RS
494.bP
Steve Kondikae271bc2015-11-15 02:50:53 +0100495Available terminfo
micky3879b9f5e72025-07-08 18:04:53 -0400496subsets are \*(``SVr1\*('', \*(``Ultrix\*('', \*(``HP\*('', and \*(``AIX\*('';
497see \fBterminfo\fP(5) for details.
498.bP
499You can also choose the subset \*(``BSD\*('' which selects only capabilities
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530500with termcap equivalents recognized by 4.4BSD.
micky3879b9f5e72025-07-08 18:04:53 -0400501.bP
502If you select any other value for \fB\-R\fP,
503it is the same as no subset, i.e., all capabilities are used.
504.RE
505.IP
506A few options override the subset selected with \fB\-R\fP,
507if they are processed later in the command parameters:
508.RS
509.TP 5
510\fB\-C\fP
511sets the \*(``BSD\*('' subset as a side-effect.
512.TP 5
513\fB\-I\fP
514sets the subset to all capabilities.
515.TP 5
516\fB\-r\fP
517sets the subset to all capabilities.
518.RE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530519.TP
micky3879b9f5e72025-07-08 18:04:53 -0400520\fB\-s \fI[d|i|l|c]\fR
521The \fB\-s\fP option sorts the fields within each type according to the argument
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530522below:
523.br
524.RS 5
525.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400526\fBd\fP
527leave fields in the order that they are stored in the \fIterminfo\fP database.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530528.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400529\fBi\fP
530sort by \fIterminfo\fP name.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530531.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400532\fBl\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530533sort by the long C variable name.
534.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400535\fBc\fP
536sort by the \fItermcap\fP name.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530537.RE
538.IP
micky3879b9f5e72025-07-08 18:04:53 -0400539If the \fB\-s\fP option is not given, the fields printed out will be
540sorted alphabetically by the \fBterminfo\fP name within each type,
541except in the case of the \fB\-C\fP or the \fB\-L\fP options, which cause the
542sorting to be done by the \fBtermcap\fP name or the long C variable
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530543name, respectively.
544.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400545\fB\-T\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530546eliminates size-restrictions on the generated text.
547This is mainly useful for testing and analysis, since the compiled
548descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
549.TP
micky3879b9f5e72025-07-08 18:04:53 -0400550\fB\-t\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100551tells \fB@TIC@\fP to discard commented-out capabilities.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530552Normally when translating from terminfo to termcap,
553untranslatable capabilities are commented-out.
554.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400555\fB\-U\fP
556tells \fB@INFOCMP@\fP to not post-process the data
557after parsing the source file.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530558This feature helps when comparing the actual contents of two source files,
559since it excludes the inferences that \fB@INFOCMP@\fP makes to fill in missing
560data.
561.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400562\fB\-V\fP
563reports the version of \fI\%ncurses\fP which was used in this program,
564and exits.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530565.TP 5
micky3879b9f5e72025-07-08 18:04:53 -0400566\fB\-v\fP \fIn\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530567prints out tracing information on standard error as the program runs.
micky3879b9f5e72025-07-08 18:04:53 -0400568.IP
569The optional parameter \fIn\fP is a number from 1 to 10, inclusive,
570indicating the desired level of detail of information.
571If \fI\%ncurses\fP is built without tracing support,
572the optional parameter is ignored.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530573.TP
micky3879b9f5e72025-07-08 18:04:53 -0400574\fB\-W\fP
575By itself, the \fB\-w\fP option will not force long strings to be wrapped.
576Use the \fB\-W\fP option to do this.
577.TP 5
578\fB\-w\fP \fIwidth\fP
579changes the output to \fIwidth\fP characters.
580.TP
581\fB\-x\fP
582print information for user-defined capabilities (see \fBuser_caps\fP(5).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530583These are extensions to the terminfo repertoire which can be loaded
micky3879b9f5e72025-07-08 18:04:53 -0400584using the \fB\-x\fP option of \fB@TIC@\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530585.SH FILES
micky3879b9f5e72025-07-08 18:04:53 -0400586.TP
587.I \*d
588compiled terminal description database
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530589.SH EXTENSIONS
590The
micky3879b9f5e72025-07-08 18:04:53 -0400591\fB\-0\fP,
592\fB\-1\fP,
593\fB\-E\fP,
594\fB\-F\fP,
595\fB\-G\fP,
596\fB\-Q\fP,
597\fB\-R\fP,
598\fB\-T\fP,
599\fB\-V\fP,
600\fB\-a\fP,
601\fB\-e\fP,
602\fB\-f\fP,
603\fB\-g\fP,
604\fB\-i\fP,
605\fB\-l\fP,
606\fB\-p\fP,
607\fB\-q\fP and
608\fB\-t\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530609options are not supported in SVr4 curses.
610.PP
micky3879b9f5e72025-07-08 18:04:53 -0400611SVr4 infocmp does not distinguish between absent and cancelled capabilities.
612Also, it shows missing integer capabilities as \fB\-1\fP
613(the internal value used to represent missing integers).
614This implementation shows those as \*(``NULL\*('',
615for consistency with missing strings.
616.PP
617The \fB\-r\fP option's notion of \*(``termcap\*('' capabilities
618is System V Release 4's.
Steve Kondikae271bc2015-11-15 02:50:53 +0100619Actual BSD curses versions will have a more restricted set.
620To see only the
micky3879b9f5e72025-07-08 18:04:53 -04006214.4BSD set, use \fB\-r\fP \fB\-RBSD\fP.
622.SH PORTABILITY
623X/Open Curses, Issue 7 (2009) provides a description of \fBinfocmp\fP.
624It does not mention the options used for converting to termcap format.
625.SH HISTORY
626Although System V Release 2 provided a terminfo library,
627it had no documented tool for decompiling the terminal descriptions.
628Tony Hansen (AT&T) wrote the first \fBinfocmp\fP in early 1984,
629for System V Release 3.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530630.PP
micky3879b9f5e72025-07-08 18:04:53 -0400631Eric Raymond used the AT&T documentation in 1995 to provide an equivalent
632\fB@INFOCMP@\fP for \fI\%ncurses\fP.
633In addition, he added a few new features such as:
634.bP
635the \fB\-e\fP option, to support \fIfallback\fP
636(compiled-in) terminal descriptions
637.bP
638the \fB\-i\fP option, to help with analysis
639.PP
640Later, Thomas Dickey added the \fB\-x\fP (user-defined capabilities)
641option, and the \fB\-E\fP option to support fallback entries with
642user-defined capabilities.
643.PP
644For a complete list, see the \fIEXTENSIONS\fP section.
645.PP
646In 2010, Roy Marples provided an \fBinfocmp\fP program for NetBSD.
647It is less capable than the SVr4 or \fI\%ncurses\fP versions
648(e.g., it lacks the sorting options documented in X/Open),
649but does include the \fB\-x\fP option adapted from \fI\%ncurses\fP.
650.SH BUGS
651The \fB\-F\fP option of \fB\%@INFOCMP@\fP(1M) should be a
652\fB\%@TOE@\fP(1M) mode.
653.SH AUTHORS
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530654Eric S. Raymond <esr@snark.thyrsus.com>
655and
656.br
micky3879b9f5e72025-07-08 18:04:53 -0400657Thomas E. Dickey <dickey@invisible\-island.net>
658.SH SEE ALSO
659\fB\%@CAPTOINFO@\fP(1M),
660\fB\%@INFOTOCAP@\fP(1M),
661\fB\%@TIC@\fP(1M),
662\fB\%@TOE@\fP(1M),
663\fB\%curses\fP(3X),
664\fB\%terminfo\fP(5),
665\fB\%user_caps\fP(5)
666.PP
667https://invisible\-island.net/ncurses/tctest.html