blob: 9c3181ed5c7dffa037d654b672168b663783222a [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04002.\" Copyright 2018-2023,2024 Thomas E. Dickey *
3.\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05304.\" *
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.\"
micky3879b9f5e72025-07-08 18:04:53 -040030.\" $Id: tic.1m,v 1.110 2024/04/27 17:57:06 tom Exp $
31.TH @TIC@ 1M 2024-04-27 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "User commands"
32.ie \n(.g \{\
33.ds `` \(lq
34.ds '' \(rq
35.\}
36.el \{\
37.ie t .ds `` ``
38.el .ds `` ""
39.ie t .ds '' ''
40.el .ds '' ""
41.\}
42.
Steve Kondikae271bc2015-11-15 02:50:53 +010043.de bP
micky3879b9f5e72025-07-08 18:04:53 -040044.ie n .IP \(bu 4
45.el .IP \(bu 2
Steve Kondikae271bc2015-11-15 02:50:53 +010046..
micky3879b9f5e72025-07-08 18:04:53 -040047.
48.ds d @TERMINFO@
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053049.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040050\fB\%@TIC@\fP \-
51compile terminal descriptions for \fIterminfo\fR or \fItermcap\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053052.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040053\fB@TIC@\fP
Steve Kondikae271bc2015-11-15 02:50:53 +010054[\fB\-\
550\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530561\
micky3879b9f5e72025-07-08 18:04:53 -040057a\
58c\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053059C\
Steve Kondikae271bc2015-11-15 02:50:53 +010060D\
micky3879b9f5e72025-07-08 18:04:53 -040061f\
62g\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053063G\
64I\
Steve Kondikae271bc2015-11-15 02:50:53 +010065K\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053066L\
67N\
micky3879b9f5e72025-07-08 18:04:53 -040068q\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053069r\
70s\
71t\
micky3879b9f5e72025-07-08 18:04:53 -040072T\
73U\
74V\
75W\
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053076x\
micky3879b9f5e72025-07-08 18:04:53 -040077\fP]
78[\fB\-e\fP \fIterminal-type-list\fP]
79[\fB\-o\fP \fIdir\fP]
80[\fB\-Q\fP[\fIn\fP]]
81[\fB\-R\fP \fIsubset\fP]
82[\fB\-v\fP[\fIn\fP]]
83[\fB\-w\fP[\fIn\fP]]
84\fIfile\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053085.SH DESCRIPTION
micky3879b9f5e72025-07-08 18:04:53 -040086The \fB@TIC@\fP command translates a \fBterminfo\fP file from source
Steve Kondikae271bc2015-11-15 02:50:53 +010087format into compiled format.
88The compiled format is necessary for use with
micky3879b9f5e72025-07-08 18:04:53 -040089the library routines in \fB\%ncurses\fP(3X).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053090.PP
micky3879b9f5e72025-07-08 18:04:53 -040091As described in \fBterm\fP(5), the database may be either a directory
Steve Kondikae271bc2015-11-15 02:50:53 +010092tree (one file per terminal entry) or a hashed database (one record per entry).
micky3879b9f5e72025-07-08 18:04:53 -040093The \fB@TIC@\fP command writes only one type of entry,
Steve Kondikae271bc2015-11-15 02:50:53 +010094depending on how it was built:
95.bP
96For directory trees, the top-level directory, e.g., /usr/share/terminfo,
97specifies the location of the database.
98.bP
99For hashed databases, a filename is needed.
100If the given file is not found by that name,
101but can be found by adding the suffix ".db",
102then that is used.
103.IP
104The default name for the hashed database is the same as the
105default directory name (only adding a ".db" suffix).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530106.PP
Steve Kondikae271bc2015-11-15 02:50:53 +0100107In either case (directory or hashed database),
108\fB@TIC@\fP will create the container if it does not exist.
micky3879b9f5e72025-07-08 18:04:53 -0400109For a directory, this would be the \*(``terminfo\*('' leaf,
Steve Kondikae271bc2015-11-15 02:50:53 +0100110versus a "terminfo.db" file.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530111.PP
micky3879b9f5e72025-07-08 18:04:53 -0400112The results are normally placed in the system terminfo database \fB\*d\fP.
Steve Kondikae271bc2015-11-15 02:50:53 +0100113The compiled terminal description can be placed
114in a different terminfo database.
115There are two ways to achieve this:
116.bP
117First, you may override the system default either by
118using the \fB\-o\fP option,
micky3879b9f5e72025-07-08 18:04:53 -0400119or by setting the variable \fI\%TERMINFO\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100120in your shell environment to a valid database location.
121.bP
micky3879b9f5e72025-07-08 18:04:53 -0400122Secondly, if \fB@TIC@\fP cannot write in \fI\*d\fP
123or the location specified using your \fI\%TERMINFO\fP variable,
124it looks for the directory \fI$HOME/.terminfo\fP
125(or hashed database \fI$HOME/.terminfo.db)\fP;
Steve Kondikae271bc2015-11-15 02:50:53 +0100126if that location exists, the entry is placed there.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530127.PP
Steve Kondikae271bc2015-11-15 02:50:53 +0100128Libraries that read terminfo entries are expected to check in succession
129.bP
micky3879b9f5e72025-07-08 18:04:53 -0400130a location specified with the \fI\%TERMINFO\fP environment variable,
Steve Kondikae271bc2015-11-15 02:50:53 +0100131.bP
micky3879b9f5e72025-07-08 18:04:53 -0400132\fI$HOME/.terminfo\fP,
Steve Kondikae271bc2015-11-15 02:50:53 +0100133.bP
micky3879b9f5e72025-07-08 18:04:53 -0400134directories listed in the \fI\%TERMINFO_DIRS\fP environment variable,
Steve Kondikae271bc2015-11-15 02:50:53 +0100135.bP
136a compiled-in list of directories (@TERMINFO_DIRS@), and
137.bP
micky3879b9f5e72025-07-08 18:04:53 -0400138the system terminfo database (\fI\*d\fP).
139.PP
140The \fIFetching Compiled Descriptions\fP section in the \fBterminfo\fR(5)
141manual goes into further detail.
142.SS Aliases
143This is the same program as @INFOTOCAP@ and @CAPTOINFO@;
144usually those are linked to, or copied from this program:
145.bP
146When invoked as @INFOTOCAP@, @TIC@ sets the \fB\-I\fP option.
147.bP
148When invoked as @CAPTOINFO@, @TIC@ sets the \fB\-C\fP option.
149.SH OPTIONS
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530150.TP
micky3879b9f5e72025-07-08 18:04:53 -0400151\fB\-0\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100152restricts the output to a single line
153.TP
micky3879b9f5e72025-07-08 18:04:53 -0400154\fB\-1\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530155restricts the output to a single column
156.TP
micky3879b9f5e72025-07-08 18:04:53 -0400157\fB\-a\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100158tells \fB@TIC@\fP to retain commented-out capabilities rather than discarding
159them.
160Capabilities are commented by prefixing them with a period.
micky3879b9f5e72025-07-08 18:04:53 -0400161This sets the \fB\-x\fP option, because it treats the commented-out
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530162entries as user-defined names.
163If the source is termcap, accept the 2-character names required by version 6.
164Otherwise these are ignored.
165.TP
micky3879b9f5e72025-07-08 18:04:53 -0400166\fB\-C\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100167Force source translation to termcap format.
micky3879b9f5e72025-07-08 18:04:53 -0400168Note: this differs from the \fB\-C\fP
169option of \fB@INFOCMP@\fP(1M) in that it does not merely translate capability
Steve Kondikae271bc2015-11-15 02:50:53 +0100170names, but also translates terminfo strings to termcap format.
171Capabilities
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530172that are not translatable are left in the entry under their terminfo names
173but commented out with two preceding dots.
Steve Kondikae271bc2015-11-15 02:50:53 +0100174The actual format used incorporates some improvements for escaped characters
175from terminfo format.
micky3879b9f5e72025-07-08 18:04:53 -0400176For a stricter BSD-compatible translation, add the \fB\-K\fP option.
Steve Kondikae271bc2015-11-15 02:50:53 +0100177.IP
micky3879b9f5e72025-07-08 18:04:53 -0400178If this is combined with \fB\-c\fP, \fB@TIC@\fP makes additional checks
Steve Kondikae271bc2015-11-15 02:50:53 +0100179to report cases where the terminfo values do not have an exact equivalent
180in termcap form.
181For example:
182.RS
183.bP
184\fBsgr\fP usually will not convert, because termcap lacks the ability to
185work with more than two parameters, and because termcap lacks many of
186the arithmetic/logical operators used in terminfo.
187.bP
188capabilities with more than one delay or with delays before the end of
189the string will not convert completely.
190.RE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530191.TP
micky3879b9f5e72025-07-08 18:04:53 -0400192\fB\-c\fP
193tells \fB@TIC@\fP to only check \fIfile\fP for errors,
194including syntax problems and bad use-links.
195If you specify \fB\-C\fP (\fB\-I\fP) with this option, the code
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530196will print warnings about entries which, after use resolution, are more than
Steve Kondikae271bc2015-11-15 02:50:53 +01001971023 (4096) bytes long.
198Due to a fixed buffer length in older termcap libraries,
199as well as buggy checking for the buffer length
200(and a documented limit in terminfo),
201these entries may cause core
202dumps with other implementations.
203.IP
204\fB@TIC@\fP checks string capabilities to ensure that those with parameters
205will be valid expressions.
206It does this check only for the predefined string capabilities;
207those which are defined with the \fB\-x\fP option are ignored.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530208.TP
micky3879b9f5e72025-07-08 18:04:53 -0400209\fB\-D\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100210tells \fB@TIC@\fP to print the database locations that it knows about, and exit.
211The first location shown is the one to which it would write compiled
212terminal descriptions.
213If \fB@TIC@\fP is not able to find a writable database location
214according to the rules summarized above,
215it will print a diagnostic and exit with an error rather than
216printing a list of database locations.
217.TP
micky3879b9f5e72025-07-08 18:04:53 -0400218\fB\-e \fIlist\fR
219Limit writes and translations to the comma-separated \fIlist\fP of
220terminal types.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530221If any name or alias of a terminal matches one of the names in
222the list, the entry will be written or translated as normal.
223Otherwise no output will be generated for it.
224The option value is interpreted as a file containing the list if it
225contains a '/'.
micky3879b9f5e72025-07-08 18:04:53 -0400226(Note: depending on how @TIC@ was compiled,
227this option may require \fB\-I\fP or \fB\-C\fP.)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530228.TP
micky3879b9f5e72025-07-08 18:04:53 -0400229\fB\-f\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530230Display complex terminfo strings which contain if/then/else/endif expressions
231indented for readability.
232.TP
micky3879b9f5e72025-07-08 18:04:53 -0400233\fB\-G\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530234Display constant literals in decimal form
235rather than their character equivalents.
236.TP
micky3879b9f5e72025-07-08 18:04:53 -0400237\fB\-g\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530238Display constant character literals in quoted form
239rather than their decimal equivalents.
240.TP
micky3879b9f5e72025-07-08 18:04:53 -0400241\fB\-I\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530242Force source translation to terminfo format.
243.TP
micky3879b9f5e72025-07-08 18:04:53 -0400244\fB\-K\fP
245Suppress some longstanding \fI\%ncurses\fP extensions to termcap format,
246e.g., "\es" for space.
Steve Kondikae271bc2015-11-15 02:50:53 +0100247.TP
micky3879b9f5e72025-07-08 18:04:53 -0400248\fB\-L\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530249Force source translation to terminfo format
micky3879b9f5e72025-07-08 18:04:53 -0400250using the long C variable names listed in <\fBterm.h\fP>
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530251.TP
micky3879b9f5e72025-07-08 18:04:53 -0400252\fB\-N\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100253Disable smart defaults.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530254Normally, when translating from termcap to terminfo, the compiler makes
255a number of assumptions about the defaults of string capabilities
micky3879b9f5e72025-07-08 18:04:53 -0400256\fBreset1_string\fP, \fBcarriage_return\fP, \fBcursor_left\fP,
257\fBcursor_down\fP, \fBscroll_forward\fP, \fBtab\fP, \fBnewline\fP,
258\fBkey_backspace\fP, \fBkey_left\fP, and \fBkey_down\fP, then attempts
Steve Kondikae271bc2015-11-15 02:50:53 +0100259to use obsolete termcap capabilities to deduce correct values.
260It also
micky3879b9f5e72025-07-08 18:04:53 -0400261normally suppresses output of obsolete termcap capabilities such as \fBbs\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530262This option forces a more literal translation that also preserves the
263obsolete capabilities.
264.TP
micky3879b9f5e72025-07-08 18:04:53 -0400265\fB\-o\fIdir\fR
Steve Kondikae271bc2015-11-15 02:50:53 +0100266Write compiled entries to given database location.
micky3879b9f5e72025-07-08 18:04:53 -0400267Overrides the \fI\%TERMINFO\fP environment variable.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530268.TP
micky3879b9f5e72025-07-08 18:04:53 -0400269\fB\-Q\fIn\fR
270Rather than show source in terminfo (text) format,
271print the compiled (binary) format in hexadecimal or base64 form,
272depending on the option's value:
273.RS 8
274.TP 3
2751
276hexadecimal
277.TP 3
2782
279base64
280.TP 3
2813
282hexadecimal and base64
283.RE
284.TP
285\fB\-q\fP
286Suppress comments and blank lines when showing translated source.
287.TP
288\fB\-R\fIsubset\fR
Steve Kondikae271bc2015-11-15 02:50:53 +0100289Restrict output to a given subset.
290This option is for use with archaic
micky3879b9f5e72025-07-08 18:04:53 -0400291versions of terminfo like those on SVr1, Ultrix, or HP-UX that do not support
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530292the full set of SVR4/XSI Curses terminfo; and outright broken ports like AIX 3.x
Steve Kondikae271bc2015-11-15 02:50:53 +0100293that have their own extensions incompatible with SVr4/XSI.
micky3879b9f5e72025-07-08 18:04:53 -0400294.IP
295Available subsets are
296.RS
297\*(``SVr1\*('',
298\*(``Ultrix\*('',
299\*(``HP\*('',
300\*(``BSD\*('', and
301\*(``AIX\*(''
302.RE
303.IP
304See \fBterminfo\fP(5) for details.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530305.TP
micky3879b9f5e72025-07-08 18:04:53 -0400306\fB\-r\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530307Force entry resolution (so there are no remaining tc capabilities) even
Steve Kondikae271bc2015-11-15 02:50:53 +0100308when doing translation to termcap format.
309This may be needed if you are
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530310preparing a termcap file for a termcap library (such as GNU termcap through
311version 1.3 or BSD termcap through 4.3BSD) that does not handle multiple
312tc capabilities per entry.
313.TP
micky3879b9f5e72025-07-08 18:04:53 -0400314\fB\-s\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100315Summarize the compile by showing the database location into which entries
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530316are written, and the number of entries which are compiled.
317.TP
micky3879b9f5e72025-07-08 18:04:53 -0400318\fB\-T\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530319eliminates size-restrictions on the generated text.
320This is mainly useful for testing and analysis, since the compiled
321descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
322.TP
micky3879b9f5e72025-07-08 18:04:53 -0400323\fB\-t\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100324tells \fB@TIC@\fP to discard commented-out capabilities.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530325Normally when translating from terminfo to termcap,
326untranslatable capabilities are commented-out.
micky3879b9f5e72025-07-08 18:04:53 -0400327.TP
328\fB\-U\fP
Steve Kondikae271bc2015-11-15 02:50:53 +0100329tells \fB@TIC@\fP to not post-process the data after parsing the source file.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530330Normally, it infers data which is commonly missing in older terminfo data,
331or in termcaps.
332.TP
micky3879b9f5e72025-07-08 18:04:53 -0400333\fB\-V\fP
334reports the version of \fI\%ncurses\fP which was used in this program,
335and exits.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530336.TP
micky3879b9f5e72025-07-08 18:04:53 -0400337\fB\-v\fIn\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530338specifies that (verbose) output be written to standard error trace
micky3879b9f5e72025-07-08 18:04:53 -0400339information showing \fB@TIC@\fP's progress.
340.IP
341The optional parameter \fIn\fP is a number from 1 to 9, inclusive,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530342indicating the desired level of detail of information.
micky3879b9f5e72025-07-08 18:04:53 -0400343.RS
344.bP
345If \fI\%ncurses\fP is built without tracing support,
346the optional parameter is ignored.
347.bP
348If \fIn\fP is omitted, the default level is 1.
349.bP
350If \fIn\fP is specified and greater than 1, the level of
351detail is increased, and the output is written (with tracing information)
352to the \*(``trace\*('' file.
353.RE
Steve Kondikae271bc2015-11-15 02:50:53 +0100354.RS
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530355.PP
356The debug flag levels are as follows:
micky3879b9f5e72025-07-08 18:04:53 -0400357.TP 4
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303581
359Names of files created and linked
360.TP
3612
Steve Kondikae271bc2015-11-15 02:50:53 +0100362Information related to the \*(``use\*('' facility
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530363.TP
3643
365Statistics from the hashing algorithm
366.TP
micky3879b9f5e72025-07-08 18:04:53 -04003674
368Details of extended capabilities
369.TP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303705
micky3879b9f5e72025-07-08 18:04:53 -0400371(unused)
372.TP
3736
374(unused)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530375.TP
3767
377Entries into the string-table
378.TP
3798
380List of tokens encountered by scanner
381.TP
3829
383All values computed in construction of the hash table
Steve Kondikae271bc2015-11-15 02:50:53 +0100384.RE
385.TP
micky3879b9f5e72025-07-08 18:04:53 -0400386\fB\-W\fP
387By itself, the \fB\-w\fP option will not force long strings to be wrapped.
388Use the \fB\-W\fP option to do this.
389.IP
390If you specify both \fB\-f\fP and \fB\-W\fP options,
391the latter is ignored when \fB\-f\fP has already split the line.
392.TP
393\fB\-w\fIn\fR
Steve Kondikae271bc2015-11-15 02:50:53 +0100394specifies the width of the output.
395The parameter is optional.
396If it is omitted, it defaults to 60.
397.TP
micky3879b9f5e72025-07-08 18:04:53 -0400398\fB\-x\fP
399Treat unknown capabilities as user-defined (see \fBuser_caps\fP(5)).
Steve Kondikae271bc2015-11-15 02:50:53 +0100400That is, if you supply a capability name which \fB@TIC@\fP does not recognize,
micky3879b9f5e72025-07-08 18:04:53 -0400401it will infer its type (Boolean, number or string) from the syntax and
Steve Kondikae271bc2015-11-15 02:50:53 +0100402make an extended table entry for that.
403User-defined capability strings
404whose name begins with \*(``k\*('' are treated as function keys.
micky3879b9f5e72025-07-08 18:04:53 -0400405.SS Parameters
Steve Kondikae271bc2015-11-15 02:50:53 +0100406.TP
micky3879b9f5e72025-07-08 18:04:53 -0400407\fIfile\fP
408contains one or more \fBterminfo\fP terminal descriptions in source
409format [see \fBterminfo\fP(5)].
Steve Kondikae271bc2015-11-15 02:50:53 +0100410Each description in the file
411describes the capabilities of a particular terminal.
412.IP
micky3879b9f5e72025-07-08 18:04:53 -0400413If \fIfile\fP is \*(``-\*('', then the data is read from the standard input.
414The \fIfile\fP parameter may also be the path of a character-device.
415.SS Processing
416All but one of the capabilities recognized by \fB@TIC@\fP are documented
417in \fBterminfo\fP(5).
418The exception is the \fBuse\fP capability.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530419.PP
micky3879b9f5e72025-07-08 18:04:53 -0400420When a \fBuse\fP=\fIentry\fP\-\fIname\fP field is discovered in a
421terminal entry currently being compiled, \fB@TIC@\fP reads in the binary
422from \fB\*d\fP to complete the entry.
Steve Kondikae271bc2015-11-15 02:50:53 +0100423(Entries created from
micky3879b9f5e72025-07-08 18:04:53 -0400424\fIfile\fP will be used first.
425\fB@TIC@\fP duplicates the capabilities in
426\fIentry\fP\-\fIname\fP for the current entry, with the exception of
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530427those capabilities that explicitly are defined in the current entry.
428.PP
micky3879b9f5e72025-07-08 18:04:53 -0400429When an entry, e.g., \fBentry_name_1\fP, contains a
430\fBuse=\fIentry\fR_\fIname\fR_\fI2\fR field, any canceled
431capabilities in \fIentry\fR_\fIname\fR_\fI2\fP must also appear in
432\fBentry_name_1\fP before \fBuse=\fP for these capabilities to be
433canceled in \fBentry_name_1\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530434.PP
micky3879b9f5e72025-07-08 18:04:53 -0400435Total compiled entries cannot exceed
4364096 bytes in the legacy storage format, or
43732768 using the extended number format.
Steve Kondikae271bc2015-11-15 02:50:53 +0100438The name field cannot
439exceed 512 bytes.
440Terminal names exceeding the maximum alias length
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530441(32 characters on systems with long filenames, 14 characters otherwise)
micky3879b9f5e72025-07-08 18:04:53 -0400442will be truncated to the maximum alias length
443and a warning message will be printed.
444.SH FILES
445.TP
446.I \*d
447compiled terminal description database
448.SH NOTES
449There is some evidence that historic \fB@TIC@\fP implementations treated
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530450description fields with no whitespace in them as additional aliases or
Steve Kondikae271bc2015-11-15 02:50:53 +0100451short names.
micky3879b9f5e72025-07-08 18:04:53 -0400452This \fB@TIC@\fP does not do that, but it does warn when
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530453description fields may be treated that way and check them for dangerous
454characters.
455.SH EXTENSIONS
micky3879b9f5e72025-07-08 18:04:53 -0400456Unlike the SVr4 \fB@TIC@\fP command, this implementation can actually
Steve Kondikae271bc2015-11-15 02:50:53 +0100457compile termcap sources.
458In fact, entries in terminfo and termcap syntax can
459be mixed in a single source file.
micky3879b9f5e72025-07-08 18:04:53 -0400460See \fBterminfo\fP(5) for the list of
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530461termcap names taken to be equivalent to terminfo names.
462.PP
micky3879b9f5e72025-07-08 18:04:53 -0400463The SVr4 manual pages are not clear on the resolution rules for \fBuse\fP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530464capabilities.
micky3879b9f5e72025-07-08 18:04:53 -0400465This implementation of \fB@TIC@\fP will find \fBuse\fP targets anywhere
466in the source file,
467or anywhere in the file tree rooted at
468\fI\%TERMINFO\fP
469(if
470\fI\%TERMINFO\fP is defined),
471or in the user's \fI$HOME/.terminfo\fP database
Steve Kondikae271bc2015-11-15 02:50:53 +0100472(if it exists),
473or (finally) anywhere in the system's file tree of
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530474compiled entries.
475.PP
micky3879b9f5e72025-07-08 18:04:53 -0400476The error messages from this \fB@TIC@\fP have the same format as GNU C
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530477error messages, and can be parsed by GNU Emacs's compile facility.
478.PP
micky3879b9f5e72025-07-08 18:04:53 -0400479Aside from \fB\-c\fP and \fB\-v\fP, options are not portable:
480.bP
481Most of @TIC@'s options
482are not supported by SVr4 \fBtic\fP:
483.sp
484.RS
485\fB\-0\fP
486\fB\-1\fP
487\fB\-C\fP
488\fB\-G\fP
489\fB\-I\fP
490\fB\-N\fP
491\fB\-R\fP
492\fB\-T\fP
493\fB\-V\fP
494\fB\-a\fP
495\fB\-e\fP
496\fB\-f\fP
497\fB\-g\fP
498\fB\-o\fP
499\fB\-r\fP
500\fB\-s\fP
501\fB\-t\fP
502\fB\-x\fP
503.RE
504.bP
505The NetBSD \fBtic\fP supports a few of the \fI\%ncurses\fP options
506.sp
507.RS
508\fB\-a\fP
509\fB\-o\fP
510\fB\-x\fP
511.RE
512.IP
513and adds \fB\-S\fP
514(a feature which does the same thing
515as @INFOCMP@'s \fB\-e\fP and \fB\-E\fP options).
516.PP
517The SVr4 \fB\-c\fP mode does not report bad \*(``use=\*('' links.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530518.PP
519System V does not compile entries to or read entries from your
micky3879b9f5e72025-07-08 18:04:53 -0400520\fI$HOME/.terminfo\fP database unless \fI\%TERMINFO\fP is explicitly set
521to it.
522.SH PORTABILITY
523X/Open Curses, Issue 7 (2009) provides a brief description of \fBtic\fP.
524It lists one option: \fB\-c\fP.
525The omission of \fB\-v\fP is unexpected.
526The change history states that the description is derived from Tru64.
527According to its manual pages, that system also supported the \fB\-v\fP option.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530528.PP
micky3879b9f5e72025-07-08 18:04:53 -0400529Shortly after Issue 7 was released, Tru64 was discontinued.
530As of 2019, the surviving implementations of \fBtic\fP
531are SVr4 (AIX, HP-UX and Solaris),
532\fI\%ncurses\fP
533and NetBSD curses.
534The SVr4 \fBtic\fP programs all support the \fB\-v\fP option.
535The NetBSD \fBtic\fP program follows X/Open's documentation,
536omitting the \fB\-v\fP option.
537.PP
538The X/Open rationale states that some implementations of \fBtic\fP
539read terminal descriptions from the standard input if the \fIfile\fP
540parameter is omitted.
541None of these implementations do that.
542Further, it comments that some may choose to read from \*(''./terminfo.src\*(''
543but that is obsolescent behavior from SVr2,
544and is not (for example) a documented feature of SVr3.
545.SH HISTORY
546System V Release 2 provided a \fBtic\fP utility.
547It accepted a single option: \fB\-v\fP (optionally followed by a number).
548According to Ross Ridge's comment in \fImytinfo\fP,
549this version of \fBtic\fP was
550unable to represent cancelled capabilities.
551.PP
552System V Release 3 provided a different \fBtic\fP utility,
553written by Pavel Curtis,
554(originally named \*(``compile\*('' in \fIpcurses\fP).
555This added an option \fB\-c\fP to check the file for
556errors, with the caveat that errors in \*(``use=\*('' links
557would not be reported.
558System V Release 3 documented a few warning messages which
559did not appear in \fIpcurses\fP.
560While the program itself was changed little as development
561continued with System V Release 4,
562the table of capabilities grew from 180 (\fIpcurses\fP) to 464 (Solaris).
563.PP
564In early development of \fI\%ncurses\fP (1993),
565Zeyd Ben-Halim used the table from \fImytinfo\fP to
566extend the \fIpcurses\fP table to 469 capabilities
567(456 matched SVr4, 8 were only in SVr4, 13 were not in SVr4).
568Of those 13, 11 were ultimately discarded
569(perhaps to match the draft of X/Open Curses).
570The exceptions were
571\fB\%memory_lock_above\fP and
572\fB\%memory_unlock\fP (see \fB\%user_caps\fP(5)).
573.PP
574Eric Raymond incorporated parts of \fImytinfo\fP into \fI\%ncurses\fP
575to implement the termcap-to-terminfo source conversion,
576and extended that to begin development of
577the corresponding terminfo-to-termcap source conversion,
578Thomas Dickey completed that development over the course of several years.
579.PP
580In 1999, Thomas Dickey added the \fB\-x\fP option
581to support user-defined capabilities.
582.PP
583In 2010, Roy Marples provided a \fBtic\fP program
584and terminfo library for NetBSD.
585That implementation adapts several features from \fI\%ncurses\fP,
586including \fB@TIC@\fP's \fB\-x\fP option.
587.PP
588The \fB\-c\fP option tells \fB@TIC@\fP to check for problems in the
589terminfo source file.
590Continued development provides additional checks:
591.bP
592\fIpcurses\fP had 8 warnings
593.bP
594\fI\%ncurses\fP in 1996 had 16 warnings
595.bP
596Solaris (SVr4) curses has 28 warnings
597.bP
598NetBSD tic in 2019 has 19 warnings.
599.bP
600\fI\%ncurses\fP in 2019 has 96 warnings
601.PP
602The checking done in \fI\%ncurses\fP' \fB@TIC@\fP helps with the
603conversion to termcap,
604as well as pointing out errors and inconsistencies.
605It is also used to ensure consistency with the user-defined capabilities.
606There are 527 distinct capabilities in \fI\%ncurses\fP' terminal
607database;
608128 of those are user-defined.
609.SH AUTHORS
Steve Kondikae271bc2015-11-15 02:50:53 +0100610Eric S. Raymond <esr@snark.thyrsus.com>
611and
612.br
micky3879b9f5e72025-07-08 18:04:53 -0400613Thomas E. Dickey <dickey@invisible\-island.net>
614.SH SEE ALSO
615\fB\%@CAPTOINFO@\fP(1M),
616\fB\%@INFOCMP@\fP(1M),
617\fB\%@INFOTOCAP@\fP(1M),
618\fB\%@TOE@\fP(1M),
619\fB\%curses\fP(3X),
620\fB\%term\fP(5),
621\fB\%terminfo\fP(5),
622\fB\%user_caps\fP(5)