1tic(1M)                                                                tic(1M)
2
3
4

NAME

6       tic - the terminfo entry-description compiler
7

SYNOPSIS

9       tic  [-01CDGIKLNTUVWacfgqrstx]  [-e names] [-o dir] [-Q[n]] [-R subset]
10       [-v[n]] [-w[n]] file
11

DESCRIPTION

13       The tic command translates a terminfo file from source format into com‐
14       piled  format.   The  compiled format is necessary for use with the li‐
15       brary routines in ncurses(3X).
16
17       As described in term(5), the database may be either  a  directory  tree
18       (one  file per terminal entry) or a hashed database (one record per en‐
19       try).  The tic command writes only one type of entry, depending on  how
20       it was built:
21
22       •   For directory trees, the top-level directory, e.g., /usr/share/ter‐
23           minfo, specifies the location of the database.
24
25       •   For hashed databases, a filename is needed.  If the given  file  is
26           not  found  by  that  name,  but  can be found by adding the suffix
27           ".db", then that is used.
28
29           The default name for the hashed database is the same as the default
30           directory name (only adding a ".db" suffix).
31
32       In either case (directory or hashed database), tic will create the con‐
33       tainer if it does not exist.  For a directory, this would be the  “ter‐
34       minfo” leaf, versus a "terminfo.db" file.
35
36       The  results  are  normally  placed  in  the  system  terminfo database
37       /usr/share/terminfo.  The compiled terminal description can  be  placed
38       in a different terminfo database.  There are two ways to achieve this:
39
40       •   First,  you  may override the system default either by using the -o
41           option, or by setting the variable TERMINFO in your shell  environ‐
42           ment to a valid database location.
43
44       •   Secondly,  if  tic cannot write in /usr/share/terminfo or the loca‐
45           tion specified using your TERMINFO variable, it looks for  the  di‐
46           rectory $HOME/.terminfo (or hashed database $HOME/.terminfo.db); if
47           that location exists, the entry is placed there.
48
49       Libraries that read terminfo entries are expected to check  in  succes‐
50       sion
51
52       •   a location specified with the TERMINFO environment variable,
53
54$HOME/.terminfo,
55
56       •   directories listed in the TERMINFO_DIRS environment variable,
57
58       •   a compiled-in list of directories (no default value), and
59
60       •   the system terminfo database (/usr/share/terminfo).
61
62   ALIASES
63       This  is the same program as infotocap and captoinfo; usually those are
64       linked to, or copied from this program:
65
66       •   When invoked as infotocap, tic sets the -I option.
67
68       •   When invoked as captoinfo, tic sets the -C option.
69
70   OPTIONS
71       -0     restricts the output to a single line
72
73       -1     restricts the output to a single column
74
75       -a     tells tic to retain commented-out capabilities rather than  dis‐
76              carding them.  Capabilities are commented by prefixing them with
77              a period.  This sets the -x option, because it treats  the  com‐
78              mented-out  entries  as  user-defined  names.   If the source is
79              termcap, accept the 2-character names  required  by  version  6.
80              Otherwise these are ignored.
81
82       -C     Force  source translation to termcap format.  Note: this differs
83              from the -C option of infocmp(1M) in that  it  does  not  merely
84              translate capability names, but also translates terminfo strings
85              to termcap format.  Capabilities that are not  translatable  are
86              left  in  the entry under their terminfo names but commented out
87              with two preceding dots.  The actual  format  used  incorporates
88              some  improvements  for escaped characters from terminfo format.
89              For a stricter BSD-compatible translation, add the -K option.
90
91              If this is combined with -c, tic makes additional checks to  re‐
92              port cases where the terminfo values do not have an exact equiv‐
93              alent in termcap form.  For example:
94
95sgr usually will not  convert,  because  termcap  lacks  the
96                  ability  to  work with more than two parameters, and because
97                  termcap lacks many of the arithmetic/logical operators  used
98                  in terminfo.
99
100              •   capabilities  with more than one delay or with delays before
101                  the end of the string will not convert completely.
102
103       -c     tells tic to only check file for errors, including syntax  prob‐
104              lems  and  bad  use-links.  If you specify -C (-I) with this op‐
105              tion, the code will print warnings about  entries  which,  after
106              use  resolution, are more than 1023 (4096) bytes long.  Due to a
107              fixed buffer length in older termcap libraries, as well as buggy
108              checking  for  the buffer length (and a documented limit in ter‐
109              minfo), these entries may cause core dumps with other  implemen‐
110              tations.
111
112              tic checks string capabilities to ensure that those with parame‐
113              ters will be valid expressions.  It does this check only for the
114              predefined string capabilities; those which are defined with the
115              -x option are ignored.
116
117       -D     tells tic to print the database locations that it  knows  about,
118              and exit.  The first location shown is the one to which it would
119              write compiled terminal descriptions.  If tic  is  not  able  to
120              find  a writable database location according to the rules summa‐
121              rized above, it will print a diagnostic and exit with  an  error
122              rather than printing a list of database locations.
123
124       -e names
125              Limit  writes  and translations to the following comma-separated
126              list of terminals.  If any name or alias of a  terminal  matches
127              one  of  the  names  in  the  list, the entry will be written or
128              translated as normal.  Otherwise no output will be generated for
129              it.   The  option  value is interpreted as a file containing the
130              list if it contains a '/'.  (Note: depending on how tic was com‐
131              piled, this option may require -I or -C.)
132
133       -f     Display  complex terminfo strings which contain if/then/else/en‐
134              dif expressions indented for readability.
135
136       -G     Display constant literals in  decimal  form  rather  than  their
137              character equivalents.
138
139       -g     Display  constant  character literals in quoted form rather than
140              their decimal equivalents.
141
142       -I     Force source translation to terminfo format.
143
144       -K     Suppress some longstanding ncurses extensions to termcap format,
145              e.g., "\s" for space.
146
147       -L     Force  source  translation  to  terminfo format using the long C
148              variable names listed in <term.h>
149
150       -N     Disable smart defaults.  Normally, when translating from termcap
151              to  terminfo,  the  compiler makes a number of assumptions about
152              the defaults of string capabilities reset1_string,  carriage_re‐
153              turn,  cursor_left,  cursor_down,  scroll_forward, tab, newline,
154              key_backspace, key_left, and key_down, then attempts to use  ob‐
155              solete  termcap  capabilities to deduce correct values.  It also
156              normally suppresses output of obsolete termcap capabilities such
157              as  bs.  This option forces a more literal translation that also
158              preserves the obsolete capabilities.
159
160       -odir  Write compiled entries to given  database  location.   Overrides
161              the TERMINFO environment variable.
162
163       -Qn    Rather  than  show  source  in terminfo (text) format, print the
164              compiled (binary) format in hexadecimal or base64 form,  depend‐
165              ing on the option's value:
166
167               1  hexadecimal
168
169               2  base64
170
171               3  hexadecimal and base64
172
173       -q     Suppress  comments  and  blank  lines  when  showing  translated
174              source.
175
176       -Rsubset
177              Restrict output to a given subset.  This option is for use  with
178              archaic  versions of terminfo like those on SVr1, Ultrix, or HP-
179              UX that do not support the full set of SVR4/XSI Curses terminfo;
180              and  outright  broken ports like AIX 3.x that have their own ex‐
181              tensions incompatible  with  SVr4/XSI.   Available  subsets  are
182              “SVr1”, “Ultrix”, “HP”, “BSD” and “AIX”; see terminfo(5) for de‐
183              tails.
184
185       -r     Force entry resolution (so there are no remaining  tc  capabili‐
186              ties)  even  when doing translation to termcap format.  This may
187              be needed if you are preparing a termcap file for a termcap  li‐
188              brary  (such  as  GNU termcap through version 1.3 or BSD termcap
189              through 4.3BSD) that does not handle  multiple  tc  capabilities
190              per entry.
191
192       -s     Summarize  the  compile  by  showing  the database location into
193              which entries are written, and the number of entries  which  are
194              compiled.
195
196       -T     eliminates  size-restrictions  on  the  generated text.  This is
197              mainly useful for testing and analysis, since the  compiled  de‐
198              scriptions  are  limited  (e.g., 1023 for termcap, 4096 for ter‐
199              minfo).
200
201       -t     tells tic to discard commented-out capabilities.  Normally  when
202              translating  from  terminfo to termcap, untranslatable capabili‐
203              ties are commented-out.
204
205       -U   tells tic to not post-process the data after  parsing  the  source
206            file.  Normally, it infers data which is commonly missing in older
207            terminfo data, or in termcaps.
208
209       -V   reports the version of ncurses which was used in this program, and
210            exits.
211
212       -vn  specifies that (verbose) output be written to standard error trace
213            information showing tic's progress.
214
215            The optional parameter n is a number from 1 to 10, inclusive,  in‐
216            dicating  the  desired level of detail of information.  If ncurses
217            is built without tracing support, the optional  parameter  is  ig‐
218            nored.   If  n is omitted, the default level is 1.  If n is speci‐
219            fied and greater than 1, the level of detail is increased.
220
221            The debug flag levels are as follows:
222
223            1      Names of files created and linked
224
225            2      Information related to the “use” facility
226
227            3      Statistics from the hashing algorithm
228
229            5      String-table memory allocations
230
231            7      Entries into the string-table
232
233            8      List of tokens encountered by scanner
234
235            9      All values computed in construction of the hash table
236
237            If the debug level n is not given, it is taken to be one.
238
239       -W   By itself, the -w  option  will  not  force  long  strings  to  be
240            wrapped.  Use the -W option to do this.
241
242            If  you specify both -f and -W options, the latter is ignored when
243            -f has already split the line.
244
245       -wn  specifies the width of the output.  The parameter is optional.  If
246            it is omitted, it defaults to 60.
247
248       -x   Treat  unknown  capabilities  as  user-defined (see user_caps(5)).
249            That is, if you supply a capability name which tic does not recog‐
250            nize,  it will infer its type (boolean, number or string) from the
251            syntax and make an extended table entry  for  that.   User-defined
252            capability strings whose name begins with “k” are treated as func‐
253            tion keys.
254
255   PARAMETERS
256       file   contains one or more terminfo terminal  descriptions  in  source
257              format  [see  terminfo(5)].   Each  description  in the file de‐
258              scribes the capabilities of a particular terminal.
259
260              If file is “-”, then the data is read from the  standard  input.
261              The file parameter may also be the path of a character-device.
262
263   PROCESSING
264       All  but  one  of  the capabilities recognized by tic are documented in
265       terminfo(5).  The exception is the use capability.
266
267       When a use=entry-name field is discovered in a terminal entry currently
268       being  compiled,  tic  reads  in the binary from /usr/share/terminfo to
269       complete the entry.  (Entries created from file  will  be  used  first.
270       tic  duplicates  the  capabilities in entry-name for the current entry,
271       with the exception of those capabilities that explicitly are defined in
272       the current entry.
273
274       When  an  entry, e.g., entry_name_1, contains a use=entry_name_2 field,
275       any canceled capabilities in  entry_name_2  must  also  appear  in  en‐
276       try_name_1  before  use=  for  these capabilities to be canceled in en‐
277       try_name_1.
278
279       Total compiled entries cannot exceed 4096 bytes.  The name field cannot
280       exceed  512  bytes.   Terminal names exceeding the maximum alias length
281       (32 characters on systems with long filenames, 14 characters otherwise)
282       will  be  truncated  to  the maximum alias length and a warning message
283       will be printed.
284

HISTORY

286       System V Release 2 provided a tic utility.  It accepted  a  single  op‐
287       tion:  -v (optionally followed by a number).  According to Ross Ridge's
288       comment in mytinfo, this version of tic was unable  to  represent  can‐
289       celled capabilities.
290
291       System  V  Release 3 provided a different tic utility, written by Pavel
292       Curtis, (originally named “compile” in pcurses).  This added an  option
293       -c  to check the file for errors, with the caveat that errors in “use=”
294       links would not be reported.  System V Release 3 documented a few warn‐
295       ing messages which did not appear in pcurses.  While the program itself
296       was changed little as development continued with System  V  Release  4,
297       the table of capabilities grew from 180 (pcurses) to 464 (Solaris).
298
299       In  early  development of ncurses (1993), Zeyd Ben-Halim used the table
300       from mytinfo to extend the  pcurses  table  to  469  capabilities  (456
301       matched  SVr4, 8 were only in SVr4, 13 were not in SVr4).  Of those 13,
302       11 were ultimately discarded (perhaps to  match  the  draft  of  X/Open
303       Curses).   The exceptions were memory_lock_above and memory_unlock (see
304       user_caps(5)).
305
306       Eric Raymond incorporated parts of mytinfo into  ncurses  to  implement
307       the  termcap-to-terminfo  source conversion, and extended that to begin
308       development of the corresponding terminfo-to-termcap source conversion,
309       Thomas  Dickey  completed  that  development over the course of several
310       years.
311
312       In 1999, Thomas Dickey added the -x option to support user-defined  ca‐
313       pabilities.
314
315       In  2010,  Roy  Marples provided a tic program and terminfo library for
316       NetBSD.  That implementation adapts several features from ncurses,  in‐
317       cluding tic's -x option.
318
319       The  -c  option  tells tic to check for problems in the terminfo source
320       file.  Continued development provides additional checks:
321
322pcurses had 8 warnings
323
324       •   ncurses in 1996 had 16 warnings
325
326       •   Solaris (SVr4) curses has 28 warnings
327
328       •   NetBSD tic in 2019 has 19 warnings.
329
330       •   ncurses in 2019 has 96 warnings
331
332       The checking done in ncurses' tic helps with the conversion to termcap,
333       as well as pointing out errors and inconsistencies.  It is also used to
334       ensure consistency with the user-defined capabilities.  There  are  527
335       distinct  capabilities  in ncurses' terminal database; 128 of those are
336       user-defined.
337

PORTABILITY

339       X/Open Curses, Issue 7 (2009) provides a brief description of tic.   It
340       lists  one  option:  -c.  The omission of -v is unexpected.  The change
341       history states that the description is derived from True64  UNIX.   Ac‐
342       cording to its manual pages, that system also supported the -v option.
343
344       Shortly  after  Issue  7  was  released, Tru64 was discontinued.  As of
345       2019, the surviving implementations of tic are SVr4 (AIX, HP-UX and So‐
346       laris),  ncurses  and NetBSD curses.  The SVr4 tic programs all support
347       the -v option.  The NetBSD tic program follows X/Open's  documentation,
348       omitting the -v option.
349
350       The  X/Open rationale states that some implementations of tic read ter‐
351       minal descriptions from the standard input if  the  file  parameter  is
352       omitted.   None of these implementations do that.  Further, it comments
353       that some may choose to read from ”./terminfo.src” but that is obsoles‐
354       cent  behavior from SVr2, and is not (for example) a documented feature
355       of SVr3.
356
357   COMPATIBILITY
358       There is some evidence that historic tic  implementations  treated  de‐
359       scription  fields  with  no whitespace in them as additional aliases or
360       short names.  This tic does not do that, but it does warn when descrip‐
361       tion  fields may be treated that way and check them for dangerous char‐
362       acters.
363
364   EXTENSIONS
365       Unlike the SVr4 tic command, this implementation can  actually  compile
366       termcap  sources.   In fact, entries in terminfo and termcap syntax can
367       be mixed in a single source file.  See  terminfo(5)  for  the  list  of
368       termcap names taken to be equivalent to terminfo names.
369
370       The SVr4 manual pages are not clear on the resolution rules for use ca‐
371       pabilities.  This implementation of tic will find use targets  anywhere
372       in the source file, or anywhere in the file tree rooted at TERMINFO (if
373       TERMINFO is defined), or in the user's $HOME/.terminfo database (if  it
374       exists),  or  (finally)  anywhere in the system's file tree of compiled
375       entries.
376
377       The error messages from this tic have the same format as  GNU  C  error
378       messages, and can be parsed by GNU Emacs's compile facility.
379
380       Aside from -c and -v, options are not portable:
381
382       •   Most of tic's options are not supported by SVr4 tic:
383
384           -0 -1 -C -G -I -N -R -T -V -a -e -f -g -o -r -s -t -x
385
386       •   The NetBSD tic  supports a few of the ncurses options
387
388           -a -o -x
389
390           and  adds  -S  (a feature which does the same thing as infocmp's -e
391           and -E options).
392
393       The SVr4 -c mode does not report bad “use=” links.
394
395       System V does  not  compile  entries  to  or  read  entries  from  your
396       $HOME/.terminfo database unless TERMINFO is explicitly set to it.
397

FILES

399       /usr/share/terminfo/?/*
400            Compiled terminal description database.
401

SEE ALSO

403       captoinfo(1M),   infocmp(1M),   infotocap(1M),   toe(1M),   curses(3X),
404       term(5).  terminfo(5).  user_caps(5).
405
406       This describes ncurses version 6.3 (patch 20220501).
407

AUTHOR

409       Eric S. Raymond <esr@snark.thyrsus.com> and
410       Thomas E. Dickey <dickey@invisible-island.net>
411
412
413
414                                                                       tic(1M)
Impressum