2 ****************************************************************************
3 * Copyright 2018-2020,2021 Thomas E. Dickey *
4 * Copyright 1998-2016,2017 Free Software Foundation, Inc. *
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: *
14 * The above copyright notice and this permission notice shall be included *
15 * in all copies or substantial portions of the Software. *
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. *
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 *
29 ****************************************************************************
30 * @Id: tic.1m,v 1.79 2021/06/17 21:30:22 tom Exp @
32 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
35 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
36 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
37 <TITLE>@TIC@ 1M</TITLE>
38 <link rel="author" href="mailto:bug-ncurses@gnu.org">
39 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
42 <H1 class="no-header">@TIC@ 1M</H1>
44 <B><A HREF="tic.1M.html">tic(1M)</A></B> <B><A HREF="tic.1M.html">tic(1M)</A></B>
49 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
50 <B>tic</B> - the <I>terminfo</I> entry-description compiler
53 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
54 <B>tic</B> [<B>-01CDGIKLNTUVWacfgqrstx</B>] [<B>-e</B> <I>names</I>] [<B>-o</B> <I>dir</I>] [<B>-Q</B>[<I>n</I>]] [<B>-R</B> <I>subset</I>]
55 [<B>-v</B>[<I>n</I>]] [<B>-w</B>[<I>n</I>]] <I>file</I>
58 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
59 The <B>tic</B> command translates a <B>terminfo</B> file from source format into
60 compiled format. The compiled format is necessary for use with the
61 library routines in <B><A HREF="ncurses.3X.html">ncurses(3X)</A></B>.
63 As described in <B><A HREF="term.5.html">term(5)</A></B>, the database may be either a directory tree
64 (one file per terminal entry) or a hashed database (one record per
65 entry). The <B>tic</B> command writes only one type of entry, depending on
68 <B>o</B> For directory trees, the top-level directory, e.g.,
69 /usr/share/terminfo, specifies the location of the database.
71 <B>o</B> For hashed databases, a filename is needed. If the given file is
72 not found by that name, but can be found by adding the suffix
73 ".db", then that is used.
75 The default name for the hashed database is the same as the default
76 directory name (only adding a ".db" suffix).
78 In either case (directory or hashed database), <B>tic</B> will create the
79 container if it does not exist. For a directory, this would be the
80 "terminfo" leaf, versus a "terminfo.db" file.
82 The results are normally placed in the system terminfo database
83 <B>/usr/share/terminfo</B>. The compiled terminal description can be placed
84 in a different terminfo database. There are two ways to achieve this:
86 <B>o</B> First, you may override the system default either by using the <B>-o</B>
87 option, or by setting the variable <B>TERMINFO</B> in your shell
88 environment to a valid database location.
90 <B>o</B> Secondly, if <B>tic</B> cannot write in <I>/usr/share/terminfo</I> or the
91 location specified using your TERMINFO variable, it looks for the
92 directory <I>$HOME/.terminfo</I> (or hashed database <I>$HOME/.terminfo.db)</I>;
93 if that location exists, the entry is placed there.
95 Libraries that read terminfo entries are expected to check in
98 <B>o</B> a location specified with the TERMINFO environment variable,
100 <B>o</B> <I>$HOME/.terminfo</I>,
102 <B>o</B> directories listed in the TERMINFO_DIRS environment variable,
104 <B>o</B> a compiled-in list of directories (no default value), and
106 <B>o</B> the system terminfo database (<I>/usr/share/terminfo</I>).
109 </PRE><H3><a name="h3-ALIASES">ALIASES</a></H3><PRE>
110 This is the same program as infotocap and captoinfo; usually those are
111 linked to, or copied from this program:
113 <B>o</B> When invoked as infotocap, tic sets the <B>-I</B> option.
115 <B>o</B> When invoked as captoinfo, tic sets the <B>-C</B> option.
118 </PRE><H3><a name="h3-OPTIONS">OPTIONS</a></H3><PRE>
119 <B>-0</B> restricts the output to a single line
121 <B>-1</B> restricts the output to a single column
123 <B>-a</B> tells <B>tic</B> to retain commented-out capabilities rather than
124 discarding them. Capabilities are commented by prefixing them
125 with a period. This sets the <B>-x</B> option, because it treats the
126 commented-out entries as user-defined names. If the source is
127 termcap, accept the 2-character names required by version 6.
128 Otherwise these are ignored.
130 <B>-C</B> Force source translation to termcap format. Note: this differs
131 from the <B>-C</B> option of <B><A HREF="infocmp.1M.html">infocmp(1M)</A></B> in that it does not merely
132 translate capability names, but also translates terminfo strings
133 to termcap format. Capabilities that are not translatable are
134 left in the entry under their terminfo names but commented out
135 with two preceding dots. The actual format used incorporates
136 some improvements for escaped characters from terminfo format.
137 For a stricter BSD-compatible translation, add the <B>-K</B> option.
139 If this is combined with <B>-c</B>, <B>tic</B> makes additional checks to
140 report cases where the terminfo values do not have an exact
141 equivalent in termcap form. For example:
143 <B>o</B> <B>sgr</B> usually will not convert, because termcap lacks the
144 ability to work with more than two parameters, and because
145 termcap lacks many of the arithmetic/logical operators used
148 <B>o</B> capabilities with more than one delay or with delays before
149 the end of the string will not convert completely.
151 <B>-c</B> tells <B>tic</B> to only check <I>file</I> for errors, including syntax
152 problems and bad use-links. If you specify <B>-C</B> (<B>-I</B>) with this
153 option, the code will print warnings about entries which, after
154 use resolution, are more than 1023 (4096) bytes long. Due to a
155 fixed buffer length in older termcap libraries, as well as buggy
156 checking for the buffer length (and a documented limit in
157 terminfo), these entries may cause core dumps with other
160 <B>tic</B> checks string capabilities to ensure that those with
161 parameters will be valid expressions. It does this check only
162 for the predefined string capabilities; those which are defined
163 with the <B>-x</B> option are ignored.
165 <B>-D</B> tells <B>tic</B> to print the database locations that it knows about,
166 and exit. The first location shown is the one to which it would
167 write compiled terminal descriptions. If <B>tic</B> is not able to
168 find a writable database location according to the rules
169 summarized above, it will print a diagnostic and exit with an
170 error rather than printing a list of database locations.
172 <B>-e</B> <I>names</I>
173 Limit writes and translations to the following comma-separated
174 list of terminals. If any name or alias of a terminal matches
175 one of the names in the list, the entry will be written or
176 translated as normal. Otherwise no output will be generated for
177 it. The option value is interpreted as a file containing the
178 list if it contains a '/'. (Note: depending on how tic was
179 compiled, this option may require <B>-I</B> or <B>-C</B>.)
181 <B>-f</B> Display complex terminfo strings which contain
182 if/then/else/endif expressions indented for readability.
184 <B>-G</B> Display constant literals in decimal form rather than their
185 character equivalents.
187 <B>-g</B> Display constant character literals in quoted form rather than
188 their decimal equivalents.
190 <B>-I</B> Force source translation to terminfo format.
192 <B>-K</B> Suppress some longstanding ncurses extensions to termcap format,
193 e.g., "\s" for space.
195 <B>-L</B> Force source translation to terminfo format using the long C
196 variable names listed in <<B>term.h</B>>
198 <B>-N</B> Disable smart defaults. Normally, when translating from termcap
199 to terminfo, the compiler makes a number of assumptions about
200 the defaults of string capabilities <B>reset1_string</B>,
201 <B>carriage_return</B>, <B>cursor_left</B>, <B>cursor_down</B>, <B>scroll_forward</B>, <B>tab</B>,
202 <B>newline</B>, <B>key_backspace</B>, <B>key_left</B>, and <B>key_down</B>, then attempts to
203 use obsolete termcap capabilities to deduce correct values. It
204 also normally suppresses output of obsolete termcap capabilities
205 such as <B>bs</B>. This option forces a more literal translation that
206 also preserves the obsolete capabilities.
208 <B>-o</B><I>dir</I> Write compiled entries to given database location. Overrides
209 the TERMINFO environment variable.
211 <B>-Q</B><I>n</I> Rather than show source in terminfo (text) format, print the
212 compiled (binary) format in hexadecimal or base64 form,
213 depending on the option's value:
219 3 hexadecimal and base64
221 <B>-q</B> Suppress comments and blank lines when showing translated
224 <B>-R</B><I>subset</I>
225 Restrict output to a given subset. This option is for use with
226 archaic versions of terminfo like those on SVr1, Ultrix, or
227 HP/UX that do not support the full set of SVR4/XSI Curses
228 terminfo; and outright broken ports like AIX 3.x that have their
229 own extensions incompatible with SVr4/XSI. Available subsets
230 are "SVr1", "Ultrix", "HP", "BSD" and "AIX"; see <B><A HREF="terminfo.5.html">terminfo(5)</A></B> for
233 <B>-r</B> Force entry resolution (so there are no remaining tc
234 capabilities) even when doing translation to termcap format.
235 This may be needed if you are preparing a termcap file for a
236 termcap library (such as GNU termcap through version 1.3 or BSD
237 termcap through 4.3BSD) that does not handle multiple tc
238 capabilities per entry.
240 <B>-s</B> Summarize the compile by showing the database location into
241 which entries are written, and the number of entries which are
244 <B>-T</B> eliminates size-restrictions on the generated text. This is
245 mainly useful for testing and analysis, since the compiled
246 descriptions are limited (e.g., 1023 for termcap, 4096 for
249 <B>-t</B> tells <B>tic</B> to discard commented-out capabilities. Normally when
250 translating from terminfo to termcap, untranslatable
251 capabilities are commented-out.
253 <B>-U</B> tells <B>tic</B> to not post-process the data after parsing the source
254 file. Normally, it infers data which is commonly missing in older
255 terminfo data, or in termcaps.
257 <B>-V</B> reports the version of ncurses which was used in this program, and
260 <B>-v</B><I>n</I> specifies that (verbose) output be written to standard error trace
261 information showing <B>tic</B>'s progress.
263 The optional parameter <I>n</I> is a number from 1 to 10, inclusive,
264 indicating the desired level of detail of information. If ncurses
265 is built without tracing support, the optional parameter is
266 ignored. If <I>n</I> is omitted, the default level is 1. If <I>n</I> is
267 specified and greater than 1, the level of detail is increased.
269 The debug flag levels are as follows:
271 1 Names of files created and linked
273 2 Information related to the "use" facility
275 3 Statistics from the hashing algorithm
277 5 String-table memory allocations
279 7 Entries into the string-table
281 8 List of tokens encountered by scanner
283 9 All values computed in construction of the hash table
285 If the debug level <I>n</I> is not given, it is taken to be one.
287 <B>-W</B> By itself, the <B>-w</B> option will not force long strings to be
288 wrapped. Use the <B>-W</B> option to do this.
290 If you specify both <B>-f</B> and <B>-W</B> options, the latter is ignored when
291 <B>-f</B> has already split the line.
293 <B>-w</B><I>n</I> specifies the width of the output. The parameter is optional. If
294 it is omitted, it defaults to 60.
296 <B>-x</B> Treat unknown capabilities as user-defined (see <B>user_caps(5)</B>).
297 That is, if you supply a capability name which <B>tic</B> does not
298 recognize, it will infer its type (boolean, number or string) from
299 the syntax and make an extended table entry for that. User-
300 defined capability strings whose name begins with "k" are treated
304 </PRE><H3><a name="h3-PARAMETERS">PARAMETERS</a></H3><PRE>
305 <I>file</I> contains one or more <B>terminfo</B> terminal descriptions in source
306 format [see <B><A HREF="terminfo.5.html">terminfo(5)</A></B>]. Each description in the file
307 describes the capabilities of a particular terminal.
309 If <I>file</I> is "-", then the data is read from the standard input.
310 The <I>file</I> parameter may also be the path of a character-device.
313 </PRE><H3><a name="h3-PROCESSING">PROCESSING</a></H3><PRE>
314 All but one of the capabilities recognized by <B>tic</B> are documented in
315 <B><A HREF="terminfo.5.html">terminfo(5)</A></B>. The exception is the <B>use</B> capability.
317 When a <B>use</B>=<I>entry</I>-<I>name</I> field is discovered in a terminal entry currently
318 being compiled, <B>tic</B> reads in the binary from <B>/usr/share/terminfo</B> to
319 complete the entry. (Entries created from <I>file</I> will be used first.
320 <B>tic</B> duplicates the capabilities in <I>entry</I>-<I>name</I> for the current entry,
321 with the exception of those capabilities that explicitly are defined in
324 When an entry, e.g., <B>entry_name_1</B>, contains a <B>use=</B><I>entry</I>_<I>name</I>_<I>2</I> field,
325 any canceled capabilities in <I>entry</I>_<I>name</I>_<I>2</I> must also appear in
326 <B>entry_name_1</B> before <B>use=</B> for these capabilities to be canceled in
329 Total compiled entries cannot exceed 4096 bytes. The name field cannot
330 exceed 512 bytes. Terminal names exceeding the maximum alias length
331 (32 characters on systems with long filenames, 14 characters otherwise)
332 will be truncated to the maximum alias length and a warning message
336 </PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
337 System V Release 2 provided a <B>tic</B> utility. It accepted a single
338 option: <B>-v</B> (optionally followed by a number). According to Ross
339 Ridge's comment in <I>mytinfo</I>, this version of <B>tic</B> was unable to represent
340 cancelled capabilities.
342 System V Release 3 provided a different <B>tic</B> utility, written by Pavel
343 Curtis, (originally named "compile" in <I>pcurses</I>). This added an option
344 <B>-c</B> to check the file for errors, with the caveat that errors in "use="
345 links would not be reported. System V Release 3 documented a few
346 warning messages which did not appear in <I>pcurses</I>. While the program
347 itself was changed little as development continued with System V
348 Release 4, the table of capabilities grew from 180 (<I>pcurses</I>) to 464
351 In early development of ncurses (1993), Zeyd Ben-Halim used the table
352 from <I>mytinfo</I> to extend the <I>pcurses</I> table to 469 capabilities (456
353 matched SVr4, 8 were only in SVr4, 13 were not in SVr4). Of those 13,
354 11 were ultimately discarded (perhaps to match the draft of X/Open
355 Curses). The exceptions were <B>memory_lock_above</B> and <B>memory_unlock</B> (see
356 <B><A HREF="user_caps.5.html">user_caps(5)</A></B>).
358 Eric Raymond incorporated parts of <I>mytinfo</I> into ncurses to implement
359 the termcap-to-terminfo source conversion, and extended that to begin
360 development of the corresponding terminfo-to-termcap source conversion,
361 Thomas Dickey completed that development over the course of several
364 In 1999, Thomas Dickey added the <B>-x</B> option to support user-defined
367 In 2010, Roy Marples provided a <B>tic</B> program and terminfo library for
368 NetBSD. That implementation adapts several features from ncurses,
369 including <B>tic</B>'s <B>-x</B> option.
371 The <B>-c</B> option tells <B>tic</B> to check for problems in the terminfo source
372 file. Continued development provides additional checks:
374 <B>o</B> <I>pcurses</I> had 8 warnings
376 <B>o</B> ncurses in 1996 had 16 warnings
378 <B>o</B> Solaris (SVr4) curses has 28 warnings
380 <B>o</B> NetBSD tic in 2019 has 19 warnings.
382 <B>o</B> ncurses in 2019 has 96 warnings
384 The checking done in ncurses' <B>tic</B> helps with the conversion to termcap,
385 as well as pointing out errors and inconsistencies. It is also used to
386 ensure consistency with the user-defined capabilities. There are 527
387 distinct capabilities in ncurses' terminal database; 128 of those are
391 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
392 X/Open Curses, Issue 7 (2009) provides a brief description of <B>tic</B>. It
393 lists one option: <B>-c</B>. The omission of <B>-v</B> is unexpected. The change
394 history states that the description is derived from True64 UNIX.
395 According to its manual pages, that system also supported the <B>-v</B>
398 Shortly after Issue 7 was released, Tru64 was discontinued. As of
399 2019, the surviving implementations of <B>tic</B> are SVr4 (AIX, HP-UX and
400 Solaris), ncurses and NetBSD curses. The SVr4 <B>tic</B> programs all support
401 the <B>-v</B> option. The NetBSD <B>tic</B> program follows X/Open's documentation,
402 omitting the <B>-v</B> option.
404 The X/Open rationale states that some implementations of <B>tic</B> read
405 terminal descriptions from the standard input if the <I>file</I> parameter is
406 omitted. None of these implementations do that. Further, it comments
407 that some may choose to read from "./terminfo.src" but that is
408 obsolescent behavior from SVr2, and is not (for example) a documented
412 </PRE><H3><a name="h3-COMPATIBILITY">COMPATIBILITY</a></H3><PRE>
413 There is some evidence that historic <B>tic</B> implementations treated
414 description fields with no whitespace in them as additional aliases or
415 short names. This <B>tic</B> does not do that, but it does warn when
416 description fields may be treated that way and check them for dangerous
420 </PRE><H3><a name="h3-EXTENSIONS">EXTENSIONS</a></H3><PRE>
421 Unlike the SVr4 <B>tic</B> command, this implementation can actually compile
422 termcap sources. In fact, entries in terminfo and termcap syntax can
423 be mixed in a single source file. See <B><A HREF="terminfo.5.html">terminfo(5)</A></B> for the list of
424 termcap names taken to be equivalent to terminfo names.
426 The SVr4 manual pages are not clear on the resolution rules for <B>use</B>
427 capabilities. This implementation of <B>tic</B> will find <B>use</B> targets
428 anywhere in the source file, or anywhere in the file tree rooted at
429 <B>TERMINFO</B> (if <B>TERMINFO</B> is defined), or in the user's <I>$HOME/.terminfo</I>
430 database (if it exists), or (finally) anywhere in the system's file
431 tree of compiled entries.
433 The error messages from this <B>tic</B> have the same format as GNU C error
434 messages, and can be parsed by GNU Emacs's compile facility.
436 Aside from <B>-c</B> and <B>-v</B>, options are not portable:
438 <B>o</B> Most of tic's options are not supported by SVr4 <B>tic</B>:
440 <B>-0</B> <B>-1</B> <B>-C</B> <B>-G</B> <B>-I</B> <B>-N</B> <B>-R</B> <B>-T</B> <B>-V</B> <B>-a</B> <B>-e</B> <B>-f</B> <B>-g</B> <B>-o</B> <B>-r</B> <B>-s</B> <B>-t</B> <B>-x</B>
442 <B>o</B> The NetBSD <B>tic</B> supports a few of the ncurses options
444 <B>-a</B> <B>-o</B> <B>-x</B>
446 and adds <B>-S</B> (a feature which does the same thing as infocmp's <B>-e</B>
447 and <B>-E</B> options).
449 The SVr4 <B>-c</B> mode does not report bad "use=" links.
451 System V does not compile entries to or read entries from your
452 <I>$HOME/.terminfo</I> database unless TERMINFO is explicitly set to it.
455 </PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
456 <B>/usr/share/terminfo/?/*</B>
457 Compiled terminal description database.
460 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
461 <B><A HREF="captoinfo.1M.html">captoinfo(1M)</A></B>, <B><A HREF="infocmp.1M.html">infocmp(1M)</A></B>, <B><A HREF="infotocap.1M.html">infotocap(1M)</A></B>, <B><A HREF="toe.1M.html">toe(1M)</A></B>, <B><A HREF="curses.3X.html">curses(3X)</A></B>,
462 <B><A HREF="term.5.html">term(5)</A></B>. <B><A HREF="terminfo.5.html">terminfo(5)</A></B>. <B><A HREF="user_caps.5.html">user_caps(5)</A></B>.
464 This describes <B>ncurses</B> version 6.2 (patch 20210612).
467 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
468 Eric S. Raymond <esr@snark.thyrsus.com> and
469 Thomas E. Dickey <dickey@invisible-island.net>
473 <B><A HREF="tic.1M.html">tic(1M)</A></B>
477 <li><a href="#h2-NAME">NAME</a></li>
478 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
479 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
481 <li><a href="#h3-ALIASES">ALIASES</a></li>
482 <li><a href="#h3-OPTIONS">OPTIONS</a></li>
483 <li><a href="#h3-PARAMETERS">PARAMETERS</a></li>
484 <li><a href="#h3-PROCESSING">PROCESSING</a></li>
487 <li><a href="#h2-HISTORY">HISTORY</a></li>
488 <li><a href="#h2-PORTABILITY">PORTABILITY</a>
490 <li><a href="#h3-COMPATIBILITY">COMPATIBILITY</a></li>
491 <li><a href="#h3-EXTENSIONS">EXTENSIONS</a></li>
494 <li><a href="#h2-FILES">FILES</a></li>
495 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
496 <li><a href="#h2-AUTHOR">AUTHOR</a></li>