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 9, inclusive, indi‐
216            cating the desired level of detail of information.
217
218            •   If  ncurses is built without tracing support, the optional pa‐
219                rameter is ignored.
220
221            •   If n is omitted, the default level is 1.
222
223            •   If n is specified and greater than 1, the level of  detail  is
224                increased,  and  the  output is written (with tracing informa‐
225                tion) to the “trace” file.
226
227            The debug flag levels are as follows:
228
229            1   Names of files created and linked
230
231            2   Information related to the “use” facility
232
233            3   Statistics from the hashing algorithm
234
235            4   Details of extended capabilities
236
237            5   (unused)
238
239            6   (unused)
240
241            7   Entries into the string-table
242
243            8   List of tokens encountered by scanner
244
245            9   All values computed in construction of the hash table
246
247       -W   By itself, the -w  option  will  not  force  long  strings  to  be
248            wrapped.  Use the -W option to do this.
249
250            If  you specify both -f and -W options, the latter is ignored when
251            -f has already split the line.
252
253       -wn  specifies the width of the output.  The parameter is optional.  If
254            it is omitted, it defaults to 60.
255
256       -x   Treat  unknown  capabilities  as  user-defined (see user_caps(5)).
257            That is, if you supply a capability name which tic does not recog‐
258            nize,  it will infer its type (boolean, number or string) from the
259            syntax and make an extended table entry  for  that.   User-defined
260            capability strings whose name begins with “k” are treated as func‐
261            tion keys.
262
263   PARAMETERS
264       file   contains one or more terminfo terminal  descriptions  in  source
265              format  [see  terminfo(5)].   Each  description  in the file de‐
266              scribes the capabilities of a particular terminal.
267
268              If file is “-”, then the data is read from the  standard  input.
269              The file parameter may also be the path of a character-device.
270
271   PROCESSING
272       All  but  one  of  the capabilities recognized by tic are documented in
273       terminfo(5).  The exception is the use capability.
274
275       When a use=entry-name field is discovered in a terminal entry currently
276       being  compiled,  tic  reads  in the binary from /usr/share/terminfo to
277       complete the entry.  (Entries created from file  will  be  used  first.
278       tic  duplicates  the  capabilities in entry-name for the current entry,
279       with the exception of those capabilities that explicitly are defined in
280       the current entry.
281
282       When  an  entry, e.g., entry_name_1, contains a use=entry_name_2 field,
283       any canceled capabilities in  entry_name_2  must  also  appear  in  en‐
284       try_name_1  before  use=  for  these capabilities to be canceled in en‐
285       try_name_1.
286
287       Total compiled entries cannot exceed 4096 bytes.  The name field cannot
288       exceed  512  bytes.   Terminal names exceeding the maximum alias length
289       (32 characters on systems with long filenames, 14 characters otherwise)
290       will  be  truncated  to  the maximum alias length and a warning message
291       will be printed.
292

HISTORY

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

PORTABILITY

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

FILES

407       /usr/share/terminfo/?/*
408            Compiled terminal description database.
409

SEE ALSO

411       captoinfo(1M),   infocmp(1M),   infotocap(1M),   toe(1M),   curses(3X),
412       term(5).  terminfo(5).  user_caps(5).
413
414       This describes ncurses version 6.4 (patch 20230520).
415

AUTHOR

417       Eric S. Raymond <esr@snark.thyrsus.com> and
418       Thomas E. Dickey <dickey@invisible-island.net>
419
420
421
422                                                                       tic(1M)
Impressum