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

HISTORY

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

PORTABILITY

331       X/Open  Curses, Issue 7 (2009) provides a brief description of tic.  It
332       lists one option: -c.  The omission of -v is  unexpected.   The  change
333       history  states  that  the  description  is  derived  from True64 UNIX.
334       According to its manual  pages,  that  system  also  supported  the  -v
335       option.
336
337       Shortly  after  Issue  7  was  released, Tru64 was discontinued.  As of
338       2019, the surviving implementations of tic are  SVr4  (AIX,  HP-UX  and
339       Solaris), ncurses and NetBSD curses.
340
341       The  X/Open rationale states that some implementations of tic read ter‐
342       minal descriptions from the standard input if  the  file  parameter  is
343       omitted.   None of these implementations do that.  Further, it comments
344       that some may choose to read from ”./terminfo.src” but that is obsoles‐
345       cent  behavior from SVr2, and is not (for example) a documented feature
346       of SVr3.
347
348   COMPATIBILITY
349       There is  some  evidence  that  historic  tic  implementations  treated
350       description  fields with no whitespace in them as additional aliases or
351       short names.  This tic does not do that, but it does warn when descrip‐
352       tion  fields may be treated that way and check them for dangerous char‐
353       acters.
354
355   EXTENSIONS
356       Unlike the SVr4 tic command, this implementation can  actually  compile
357       termcap  sources.   In fact, entries in terminfo and termcap syntax can
358       be mixed in a single source file.  See  terminfo(5)  for  the  list  of
359       termcap names taken to be equivalent to terminfo names.
360
361       The  SVr4  manual  pages  are not clear on the resolution rules for use
362       capabilities.  This implementation of tic will find  use  targets  any‐
363       where  in  the source file, or anywhere in the file tree rooted at TER‐
364       MINFO (if TERMINFO is defined), or in the user's $HOME/.terminfo  data‐
365       base (if it exists), or (finally) anywhere in the system's file tree of
366       compiled entries.
367
368       The error messages from this tic have the same format as  GNU  C  error
369       messages, and can be parsed by GNU Emacs's compile facility.
370
371       The  -0, -1, -C, -G, -I, -N, -R, -T, -V, -a, -e, -f, -g, -o, -r, -s, -t
372       and -x options are not supported under SVr4.  The SVr4 -c mode does not
373       report bad “use=” links.
374
375       System  V  does  not  compile  entries  to  or  read  entries from your
376       $HOME/.terminfo database unless TERMINFO is explicitly set to it.
377

FILES

379       /usr/share/terminfo/?/*
380            Compiled terminal description database.
381

SEE ALSO

383       infocmp(1M),   captoinfo(1M),   infotocap(1M),   toe(1M),   curses(3X),
384       term(5).  terminfo(5).  user_caps(5).
385
386       This describes ncurses version 6.1 (patch 20190803).
387

AUTHOR

389       Eric S. Raymond <esr@snark.thyrsus.com> and
390       Thomas E. Dickey <dickey@invisible-island.net>
391
392
393
394                                                                       tic(1M)
Impressum