# tic(1) - man - phpMan

[tic(1)](https://www.chedong.com/phpMan.php/man/tic/1/markdown)                                 General Commands Manual                                [tic(1)](https://www.chedong.com/phpMan.php/man/tic/1/markdown)



## NAME
       **tic** - the _terminfo_ entry-description compiler

## SYNOPSIS
       **tic** [**-01CDGIKLNTUVWacfgqrstx**] [**-e** _names_] [**-o** _dir_] [**-Q**[_n_]] [**-R** _subset_] [**-v**[_n_]] [**-w**[_n_]] _file_

## DESCRIPTION
       The **tic** command translates a **terminfo** file from source format into compiled format.  The com‐
       piled format is necessary for use with the library routines in [**ncurses**(3NCURSES)](https://www.chedong.com/phpMan.php/man/ncurses/3NCURSES/markdown).

       As described in [**term**(5)](https://www.chedong.com/phpMan.php/man/term/5/markdown), the database may be either a directory tree (one file  per  terminal
       entry)  or a hashed database (one record per entry).  The **tic** command writes only one type of
       entry, depending on how it was built:

       •   For directory trees, the top-level directory, e.g.,  /usr/share/terminfo,  specifies  the
           location of the database.

       •   For hashed databases, a filename is needed.  If the given file is not found by that name,
           but can be found by adding the suffix ".db", then that is used.

           The default name for the hashed database is the same as the default directory name  (only
           adding a ".db" suffix).

       In  either  case (directory or hashed database), **tic** will create the container if it does not
       exist.  For a directory, this would be the “terminfo” leaf, versus a "terminfo.db" file.

       The results are normally placed in the system terminfo database **/etc/terminfo**.  The  compiled
       terminal  description  can be placed in a different terminfo database.  There are two ways to
       achieve this:

       •   First, you may override the system default either by using the **-o** option, or  by  setting
           the variable **TERMINFO** in your shell environment to a valid database location.

       •   Secondly,  if **tic** cannot write in _/etc/terminfo_ or the location specified using your TER‐
           MINFO  variable,  it  looks  for  the  directory  _$HOME/.terminfo_  (or  hashed   database
           _$HOME/.terminfo.db)_; if that location exists, the entry is placed there.

       Libraries that read terminfo entries are expected to check in succession

       •   a location specified with the TERMINFO environment variable,

       •   _$HOME/.terminfo_,

       •   directories listed in the TERMINFO_DIRS environment variable,

       •   a compiled-in list of directories (no default value), and

       •   the system terminfo database (_/etc/terminfo_).

   **ALIASES**
       This  is  the same program as infotocap and captoinfo; usually those are linked to, or copied
       from this program:

       •   When invoked as infotocap, tic sets the **-I** option.

       •   When invoked as captoinfo, tic sets the **-C** option.

   **OPTIONS**
### -0

### -1

### -a
              ties  are commented by prefixing them with a period.  This sets the **-x** option, because
              it treats the commented-out entries as user-defined names.  If the source is  termcap,
              accept the 2-character names required by version 6.  Otherwise these are ignored.

### -C -C
              [**infocmp**(1)](https://www.chedong.com/phpMan.php/man/infocmp/1/markdown) in that it does not merely translate capability names, but also  translates
              terminfo  strings  to termcap format.  Capabilities that are not translatable are left
              in the entry under their terminfo names but commented out  with  two  preceding  dots.
              The actual format used incorporates some improvements for escaped characters from ter‐
              minfo format.  For a stricter BSD-compatible translation, add the **-K** option.

              If this is combined with **-c**, **tic** makes additional checks to  report  cases  where  the
              terminfo values do not have an exact equivalent in termcap form.  For example:

              •   **sgr**  usually will not convert, because termcap lacks the ability to work with more
                  than two parameters, and because termcap lacks many of the arithmetic/logical  op‐
                  erators used in terminfo.

              •   capabilities  with more than one delay or with delays before the end of the string
                  will not convert completely.

### -c
              If  you  specify  **-C** (**-I**) with this option, the code will print warnings about entries
              which, after use resolution, are more than 1023 (4096) bytes long.   Due  to  a  fixed
              buffer  length  in  older  termcap libraries, as well as buggy checking for the buffer
              length (and a documented limit in terminfo), these entries may cause core  dumps  with
              other implementations.

              **tic**  checks string capabilities to ensure that those with parameters will be valid ex‐
              pressions.  It does this check only for  the  predefined  string  capabilities;  those
              which are defined with the **-x** option are ignored.

### -D
              location shown is the one to which it would write compiled terminal descriptions.   If
              **tic** is not able to find a writable database location according to the rules summarized
              above, it will print a diagnostic and exit with an error rather than printing  a  list
              of database locations.

### -e
              Limit  writes and translations to the following comma-separated list of terminals.  If
              any name or alias of a terminal matches one of the names in the list, the  entry  will
              be  written  or  translated  as normal.  Otherwise no output will be generated for it.
              The option value is interpreted as a file containing the list if it  contains  a  '/'.
              (Note: depending on how tic was compiled, this option may require **-I** or **-C**.)

### -f
              for readability.

### -G

### -g
              lents.

### -I

### -K

### -L
              <**term.h**>

### -N
              piler  makes  a  number  of  assumptions about the defaults of string capabilities **re**‐‐
              **set1**___**string**, **carriage**___**return**, **cursor**___**left**, **cursor**___**down**, **scroll**___**forward**, **tab**,  **newline**,
              **key**___**backspace**, **key**___**left**, and **key**___**down**, then attempts to use obsolete termcap capabili‐
              ties to deduce correct values.  It also normally suppresses output of obsolete termcap
              capabilities such as **bs**.  This option forces a more literal translation that also pre‐
              serves the obsolete capabilities.

### -o
              variable.

### -Q
              in hexadecimal or base64 form, depending on the option's value:

               1  hexadecimal

               2  base64

               3  hexadecimal and base64

### -q

### -R
              Restrict output to a given subset.  This option is for use with  archaic  versions  of
              terminfo  like  those  on  SVr1,  Ultrix, or HP-UX that do not support the full set of
              SVR4/XSI Curses terminfo; and outright broken ports like AIX 3.x that have  their  own
              extensions  incompatible with SVr4/XSI.  Available subsets are “SVr1”, “Ultrix”, “HP”,
              “BSD” and “AIX”; see [**terminfo**(5)](https://www.chedong.com/phpMan.php/man/terminfo/5/markdown) for details.

### -r
              translation to termcap format.  This may be needed if you are preparing a termcap file
              for a termcap library (such as GNU termcap through version 1.3 or BSD termcap  through
              4.3BSD) that does not handle multiple tc capabilities per entry.

### -s
              and the number of entries which are compiled.

### -T
              and  analysis,  since  the  compiled descriptions are limited (e.g., 1023 for termcap,
              4096 for terminfo).

### -t
              minfo to termcap, untranslatable capabilities are commented-out.

### -U
            fers data which is commonly missing in older terminfo data, or in termcaps.

### -V

### -v
            **tic**'s progress.

            The  optional  parameter  _n_  is a number from 1 to 10, inclusive, indicating the desired
            level of detail of information.  If ncurses is built without tracing  support,  the  op‐
            tional  parameter  is ignored.  If _n_ is omitted, the default level is 1.  If _n_ is speci‐
            fied and greater than 1, the level of detail is increased.

            The debug flag levels are as follows:

            1      Names of files created and linked

            2      Information related to the “use” facility

            3      Statistics from the hashing algorithm

            5      String-table memory allocations

            7      Entries into the string-table

            8      List of tokens encountered by scanner

            9      All values computed in construction of the hash table

            If the debug level _n_ is not given, it is taken to be one.

### -W -w -W
            to do this.

            If  you  specify both **-f** and **-W** options, the latter is ignored when **-f** has already split
            the line.

### -w
            faults to 60.

### -x
            capability name which **tic** does not recognize, it will infer its type (boolean, number or
            string)  from  the syntax and make an extended table entry for that.  User-defined capa‐
            bility strings whose name begins with “k” are treated as function keys.

   **PARAMETERS**
       _file_   contains one or more  **terminfo**  terminal  descriptions  in  source  format  [see  **ter**‐‐
              [**minfo**(5)](https://www.chedong.com/phpMan.php/man/minfo/5/markdown)].   Each  description  in the file describes the capabilities of a particular
              terminal.

              If _file_ is “-”, then the data is read from the standard input.  The _file_ parameter may
              also be the path of a character-device.

   **PROCESSING**
       All  but one of the capabilities recognized by **tic** are documented in [**terminfo**(5)](https://www.chedong.com/phpMan.php/man/terminfo/5/markdown).  The excep‐
       tion is the **use** capability.

       When a **use**=_entry_-_name_ field is discovered in a terminal entry currently being  compiled,  **tic**
       reads  in  the  binary  from **/etc/terminfo** to complete the entry.  (Entries created from _file_
       will be used first.  **tic** duplicates the capabilities in _entry_-_name_  for  the  current  entry,
       with the exception of those capabilities that explicitly are defined in the current entry.

       When  an entry, e.g., **entry**___**name**___**1**, contains a **use=**_entry___name___2_ field, any canceled capabili‐
       ties in _entry___name___2_ must also appear in **entry**___**name**___**1** before **use=** for these  capabilities  to
       be canceled in **entry**___**name**___**1**.

       Total  compiled  entries  cannot  exceed 4096 bytes.  The name field cannot exceed 512 bytes.
       Terminal names exceeding the maximum alias length (32 characters on systems with  long  file‐
       names,  14  characters otherwise) will be truncated to the maximum alias length and a warning
       message will be printed.

## HISTORY
       System V Release 2 provided a **tic** utility.  It accepted a single option: **-v** (optionally  fol‐
       lowed  by  a  number).  According to Ross Ridge's comment in _mytinfo_, this version of **tic** was
       unable to represent cancelled capabilities.

       System V Release 3 provided a different **tic** utility, written  by  Pavel  Curtis,  (originally
       named  “compile” in _pcurses_).  This added an option **-c** to check the file for errors, with the
       caveat that errors in “use=” links would not be reported.  System V Release  3  documented  a
       few  warning  messages which did not appear in _pcurses_.  While the program itself was changed
       little as development continued with System V Release 4, the table of capabilities grew  from
       180 (_pcurses_) to 464 (Solaris).

       In  early development of ncurses (1993), Zeyd Ben-Halim used the table from _mytinfo_ to extend
       the _pcurses_ table to 469 capabilities (456 matched SVr4, 8 were only in SVr4, 13 were not  in
       SVr4).   Of  those  13,  11  were  ultimately discarded (perhaps to match the draft of X/Open
       Curses).  The exceptions were **memory**___**lock**___**above** and **memory**___**unlock** (see **user**___**[caps**(5)](https://www.chedong.com/phpMan.php/man/caps/5/markdown)).

       Eric Raymond incorporated parts of _mytinfo_ into ncurses to implement the  termcap-to-terminfo
       source  conversion,  and extended that to begin development of the corresponding terminfo-to-
       termcap source conversion, Thomas Dickey completed that development over the course  of  sev‐
       eral years.

       In 1999, Thomas Dickey added the **-x** option to support user-defined capabilities.

       In  2010, Roy Marples provided a **tic** program and terminfo library for NetBSD.  That implemen‐
       tation adapts several features from ncurses, including **tic**'s **-x** option.

       The **-c** option tells **tic** to check for problems in the terminfo source file.  Continued  devel‐
       opment provides additional checks:

       •   _pcurses_ had 8 warnings

       •   ncurses in 1996 had 16 warnings

       •   Solaris (SVr4) curses has 28 warnings

       •   NetBSD tic in 2019 has 19 warnings.

       •   ncurses in 2019 has 96 warnings

       The  checking  done in ncurses' **tic** helps with the conversion to termcap, as well as pointing
       out errors and inconsistencies.  It is also used to ensure consistency with the  user-defined
       capabilities.   There  are  527  distinct  capabilities in ncurses' terminal database; 128 of
       those are user-defined.

## PORTABILITY
       X/Open Curses, Issue 7 (2009) provides a brief description of **tic**.  It lists one option:  **-c**.
       The  omission of **-v** is unexpected.  The change history states that the description is derived
       from True64 UNIX.  According to its manual pages, that system also supported the **-v** option.

       Shortly after Issue 7 was released, Tru64 was discontinued.  As of 2019, the surviving imple‐
       mentations of **tic** are SVr4 (AIX, HP-UX and Solaris), ncurses and NetBSD curses.  The SVr4 **tic**
       programs all support the **-v** option.  The NetBSD **tic** program follows  X/Open's  documentation,
       omitting the **-v** option.

       The  X/Open rationale states that some implementations of **tic** read terminal descriptions from
       the standard input if the _file_ parameter is omitted.  None of these implementations do  that.
       Further,  it comments that some may choose to read from ”./terminfo.src” but that is obsoles‐
       cent behavior from SVr2, and is not (for example) a documented feature of SVr3.

   **COMPATIBILITY**
       There is some evidence that historic **tic** implementations treated description fields  with  no
       whitespace  in  them as additional aliases or short names.  This **tic** does not do that, but it
       does warn when description fields may be treated that way and check them for dangerous  char‐
       acters.

   **EXTENSIONS**
       Unlike  the  SVr4  **tic** command, this implementation can actually compile termcap sources.  In
       fact, entries in terminfo and termcap syntax can be mixed in a single source file.  See  **ter**‐‐
       [**minfo**(5)](https://www.chedong.com/phpMan.php/man/minfo/5/markdown) for the list of termcap names taken to be equivalent to terminfo names.

       The  SVr4  manual pages are not clear on the resolution rules for **use** capabilities.  This im‐
       plementation of **tic** will find **use** targets anywhere in the source file,  or  anywhere  in  the
       file tree rooted at **TERMINFO** (if **TERMINFO** is defined), or in the user's _$HOME/.terminfo_ data‐
       base (if it exists), or (finally) anywhere in the system's file tree of compiled entries.

       The error messages from this **tic** have the same format as GNU C error  messages,  and  can  be
       parsed by GNU Emacs's compile facility.

       Aside from **-c** and **-v**, options are not portable:

       •   Most of tic's options are not supported by SVr4 **tic**:

           **-0** **-1** **-C** **-G** **-I** **-N** **-R** **-T** **-V** **-a** **-e** **-f** **-g** **-o** **-r** **-s** **-t** **-x**

       •   The NetBSD **tic**  supports a few of the ncurses options

           **-a** **-o** **-x**

           and adds **-S** (a feature which does the same thing as infocmp's **-e** and **-E** options).

       The SVr4 **-c** mode does not report bad “use=” links.

       System  V  does not compile entries to or read entries from your _$HOME/.terminfo_ database un‐
       less TERMINFO is explicitly set to it.

## FILES
       **/etc/terminfo/?/***
            Compiled terminal description database.

## SEE ALSO
       [**captoinfo**(1)](https://www.chedong.com/phpMan.php/man/captoinfo/1/markdown), [**infocmp**(1)](https://www.chedong.com/phpMan.php/man/infocmp/1/markdown), [**infotocap**(1)](https://www.chedong.com/phpMan.php/man/infotocap/1/markdown),  [**toe**(1)](https://www.chedong.com/phpMan.php/man/toe/1/markdown),  [**ncurses**(3NCURSES)](https://www.chedong.com/phpMan.php/man/ncurses/3NCURSES/markdown),  [**term**(5)](https://www.chedong.com/phpMan.php/man/term/5/markdown).   [**terminfo**(5)](https://www.chedong.com/phpMan.php/man/terminfo/5/markdown).
       **user**___**[caps**(5)](https://www.chedong.com/phpMan.php/man/caps/5/markdown).

       This describes **ncurses** version 6.3 (patch 20211021).

## AUTHOR
       Eric S. Raymond <<esr@snark.thyrsus.com>> and
       Thomas E. Dickey <<dickey@invisible-island.net>>



                                                                                              [tic(1)](https://www.chedong.com/phpMan.php/man/tic/1/markdown)
