tic(1)
๐ NAME ๐
okay so bestie, welcome to the tic(1) page from User commands. tic - compile terminal descriptions for terminfo or termcap. That's the whole name vibe, no cap.
โจ SYNOPSIS โจ
tic [-01acCDfgGIKLNqrstTUVWx] [-e terminal-type-list] [-o dir] [-Q[n]]
[-R subset] [-v[n]] [-w[n]] file
๐ฆ DESCRIPTION ๐ฆ
Okay so tic translates a terminfo file from source format into the compiled format used by the ncurses(3NCURSES) library. It's giving compiler energy, but for terminal descriptions. ๐
As described in term(5), 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. lowkey important.
- For directory trees, the top-level directory, such as
/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. it's giving organized, bestie. ๐
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
-ooption, or by setting the variableTERMINFOin the process environment to a valid database location. - Secondly, if
ticcannot write in/etc/terminfoor the location specified using yourTERMINFOvariable, 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 by the
TERMINFOenvironment variable, $HOME/.terminfo,- directories listed in the
TERMINFO_DIRSenvironment variable, - a compiled-in list of directories (
/etc/terminfo:/lib/terminfo:/usr/share/terminfo), and - the system terminfo database (
/etc/terminfo).
Section โFetching Compiled Descriptionsโ in terminfo(5) goes into further detail. iykyk. โจ
๐ Aliases ๐
tic is the same program as infotocap and captoinfo; usually those are linked to, or copied from, this program. iconic.
- When invoked as
infotocap,ticsets the-Ioption. - When invoked as
captoinfo,ticsets the-Coption.
โจ OPTIONS โจ
okay bestie, this is the part where we go through EVERY single flag, and there are a lot of them, so hydrate ๐
-0โ restricts the output to a single line.-1โ restricts the output to a single column.-aโ tellsticto retain commented-out capabilities rather than discarding them. Capabilities are commented by prefixing them with a period.-aimplies-x, becausetictreats the commented-out entries as user-defined names. If the source is in termcap format,ticaccepts the 2-character names required by version 6. Otherwise these are ignored.-Cโ Force source translation to termcap format. Note: this option differs from the-Coption ofinfocmp(1)in that it does not merely translate capability names, but also translates terminfo string capability values to termcap format.ticleaves capabilities that are not translatable 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 terminfo format. For a stricter BSD-compatible translation, specify-Kas well.
If -C is combined with -c, tic makes additional checks, reporting cases where terminfo capability values do not have an exact equivalent in termcap syntax. For example:
sgrusually does not convert, because termcap is unable to work with more than two parameters, and because termcap's language for encoding parameterized capabilities lacks many of terminfo's arithmetic and logical operators.
-cโ tellsticto perform only validation of file, including syntax problems and invalid "use" references; no output is produced. If you specify-C(-I) with this option,ticwarns about entries that, after "use" resolution, exceed 1023 (4096) bytes. Due to a fixed buffer length in older termcap libraries, as well as buggy checking of the buffer length (and a documented limit in terminfo), these entries may cause core dumps with other implementations.
๐ bestie, "core dumps with other implementations" is not a vibe, that's a crash. just know it.
tic checks string capabilities to ensure that those with parameters are valid expressions. It validates only standard string capabilities, ignoring those defined with the -x option.
-Dโ tellsticto print the database locations that it knows about, and exit. The first location shown is the one to which it would write compiled terminal descriptions. Ifticis 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.-elist โ Limit writes and translations to the comma-separated list of terminal types. 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 howticwas compiled, this option may require-Ior-C.)-fโ Display complex terminfo strings which containif/then/else/endifexpressions indented for readability. ๐ so pretty, so readable.-Gโ Display constant literals in decimal form rather than their character equivalents.-gโ Display constant character literals in quoted form rather than their decimal equivalents.-Iโ Force source translation to terminfo format.-Kโ Suppress some longstanding ncurses extensions to termcap format, e.g.,"\s"for space.-Lโ Force source translation to terminfo format using the long C variable names listed in<term.h>-Nโ Disable smart defaults. Normally, when translating from termcap to terminfo, the compiler makes a number of assumptions about the defaults of string capabilitiesreset1_string,carriage_return,cursor_left,cursor_down,scroll_forward,tab,newline,key_backspace,key_left, andkey_down, then attempts to use obsolete termcap capabilities to deduce correct values. It also normally suppresses output of obsolete termcap capabilities such asbs. This option forces a more literal translation that also preserves the obsolete capabilities.-odir โ Write compiled entries to given database location. Overrides theTERMINFOenvironment variable.-Qn โ Rather than show source in terminfo (text) format, print the compiled (binary) format in hexadecimal or base64 form, depending on the option's value:- hexadecimal
- base64
- hexadecimal and base64
-qโ Suppress comments and blank lines when showing translated source.-Rsubset โ 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.
๐ "outright broken" โ the manpage said it, not me. i'm just the messenger.
Available subsets are "SVr1", "Ultrix", "HP", "BSD", and "AIX"
See terminfo(5) for details.
-rโ Force entry resolution (so there are no remainingtccapabilities) even when doing 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 multipletccapabilities per entry.-sโ Summarize the compile by showing the database location into which entries are written, and the number of entries which are compiled.-Tโ eliminates size-restrictions on the generated text. This is mainly useful for testing and analysis, since the compiled descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).-tโ tellsticto discard commented-out capabilities. Normally when translating from terminfo to termcap, untranslatable capabilities are commented-out.-Uโ tellsticto not post-process the data after parsing the source file. Normally, it infers data which is commonly missing in older terminfo data, or in termcaps.-Vโ reports the version of ncurses which was used in this program, and exits.-vn โ specifies that (verbose) output be written to standard error trace information showingtic's progress.
The optional parameter n is a number from 1 to 9, inclusive, indicating the desired level of detail of information.
- If ncurses is built without tracing support, the optional parameter is ignored.
- If n is omitted, the default level is 1.
- If n is specified and greater than 1, the level of detail is increased, and the output is written (with tracing information) to the "trace" file.
The debug flag levels are as follows:
- Names of files created and linked
- Information related to the "use" facility
- Statistics from the hashing algorithm
- Details of extended capabilities
- (unused)
- (unused)
- Entries into the string-table
- List of tokens encountered by scanner
- All values computed in construction of the hash table
๐ง level 9 is giving full main character energy, that's the whole hash table construction, no crumbs.
-Wโ By itself, the-woption will not force long strings to be wrapped. Use the-Woption to do this.
If you specify both -f and -W options, the latter is ignored when -f has already split the line.
-wn โ specifies the width of the output. The parameter is optional. If it is omitted, it defaults to 60.-xโ Treat unknown capabilities as user-defined (seeuser_caps(5)). That is, if you supply a capability name whichticdoes not recognize, it will infer its type (Boolean, number or string) from the syntax and make an extended table entry for that. User-defined capability strings whose name begins with "k" are treated as function keys.
๐ธ Parameters ๐ธ
- file โ contains one or more terminfo terminal descriptions in source format; see
terminfo(5). Each description in the file describes the capabilities of a particular terminal type.
If file is -, the data are read from the standard input stream. The file parameter may also be the path of a character device.
๐ Processing ๐
terminfo(5) documents all but one of the capabilities recognized by tic. The exception is the use capability, which enables a terminal type description to incorporate others by reference.
tic serially reads and compiles terminal type descriptions; at any given time, the program compiles at most one current entry. When tic encounters a use=entry-name field in the current entry, it reads the compiled description of entry-name from /etc/terminfo to complete the current entry. If tic has already compiled a description of entry-name preceding the current entry in file, tic uses it preferentially. tic duplicates the capabilities in entry-name for the current entry, excepting those that the current entry explicitly defines. The foregoing has implications for capability cancellation. When entry-1 declares "use=entry-2", any canceled capabilities in entry-2 must also appear in entry-1 prior to "use=entry-2" for these capabilities to be canceled in entry-1.
๐ญ okay that cancellation paragraph is lowkey a tongue twister but it's real and it matters, don't skip it.
Compiled entries cannot exceed 4096 bytes in the legacy storage format, or 32768 using the extended number format. The name field cannot exceed 512 bytes. Terminal names exceeding the maximum alias length (32 characters on systems with long filenames, 14 characters otherwise) will be truncated to the maximum alias length and a warning message will be printed.
๐ FILES ๐
/etc/terminfoโ compiled terminal description database
โญ NOTES โญ
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 characters.
โจ EXTENSIONS โจ
okay so this is where ncurses tic is just built different from the SVr4 one ๐
Unlike the SVr4 tic command, ncurses tic can compile termcap sources. and not just can โ entries in terminfo and termcap syntax can be mixed together in a single source file, fr fr. no need to pick a side, bestie. ๐ซถ
go check terminfo(5) for the list of termcap capability names that ncurses tic treats as equivalent to terminfo names. iykyk.
so the SVr4 man pages are kinda vague on the resolution rules for โuseโ capabilities ๐ but ncurses's tic? she's thorough. she finds โuseโ targets:
- anywhere in the source file, or
- anywhere in the file tree rooted at the location in the
TERMINFOenvironment variable (ifTERMINFOis defined), or - in the user's
$HOME/.terminfodatabase (if it exists), or - (finally) anywhere in the system's collection of compiled entries.
like she will find it. main character energy. ๐
The error messages from ncurses tic have the same format as GNU C error messages, and can be parsed by GNU Emacs's โcompileโ facility. cute and functional, we love that.
Aside from-cand-v, options are not portable. ๐จ like, do not expect anyone else'sticto understand them.
- Most of ncurses
tic's options are not supported by SVr4tic.
-0 -1 -C -G -I -N -R -T -V -a -e -f -g -o -r -s -t -x
- NetBSD
ticsupports a few of the ncursesticoptions.
-a -o -x
- NetBSD
ticalso adds-S, a feature which does the same thing as ncursesinfocmp's-eand-Eoptions.
SVr4 tic's -c mode does not report bad โuseโ links. ๐
And SVr4 does not compile entries to or read entries from your $HOME/.terminfo database unless the TERMINFO environment variable is explicitly set to it. so set it, bestie, or she won't even look. ๐
๐ PORTABILITY ๐
X/Open Curses Issue 7 (2009) provides a brief description of tic. it lists exactly one option: -c. The omission of -v is, honestly, unexpected. ๐ The change history states that the description is derived from Tru64. And according to its manual pages, that system also supported the -v option. so likeโฆ where did it go. ๐ญ
Shortly after Issue 7 was released, Tru64 was discontinued. As of 2019, the surviving implementations 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. rule follower behavior, respect. ๐ง
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. nope. Further, it comments that some may choose to read from โ./terminfo.srcโ but that is obsolescent behavior from SVr2, and is not (for example) a documented feature of SVr3. so like, ancient lore. ๐
๐ HISTORY ๐
gather round besties, we're doing a little timeline moment. โญ
- System V Release 2 provided a
ticutility. It accepted a single option:-v(optionally followed by a number). According to Ross Ridge's comment inmytinfo, this version ofticwas unable to represent canceled capabilities. ๐ฌ - System V Release 3 provided a different
ticutility, written by Pavel Curtis, (originally named โcompileโ inpcurses). This added an option-cto 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 inpcurses. 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). the glow-up, honestly. โจ - In early development of ncurses (1993), Zeyd Ben-Halim used the table from
mytinfoto extend thepcursestable 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 werememory_lock_aboveandmemory_unlock(seeuser_caps(5)). the two survivors. iconic. ๐ - Eric Raymond incorporated parts of
mytinfointo 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 several years. a multi-year arc, we stan a slow burn. ๐ - In 1999, Thomas Dickey added the
-xoption to support user-defined capabilities. - In 2010, Roy Marples provided a
ticprogram and terminfo library for NetBSD. That implementation adapts several features from ncurses, includingtic's-xoption.
The -c option tells tic to check for problems in the terminfo source file. Continued development provides additional checks:
pcurseshad 8 warnings.- ncurses in 1996 had 16 warnings.
- Solaris (SVr4) curses has 28 warnings.
- NetBSD
ticin 2019 has 19 warnings. - ncurses in 2019 has 96 warnings.
The checking done in ncurses's 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's terminal database; 128 of those are user-defined. not her keeping receipts on literally everything ๐ญ๐
๐ AUTHORS ๐
Eric S. Raymond <esr@snark.thyrsus.com> and Thomas E. Dickey <dickey@invisible-island.net>
๐ฆ SEE ALSO ๐ฆ
captoinfo(1)infocmp(1)infotocap(1)toe(1)ncurses(3NCURSES)term(5)terminfo(5)user_caps(5)
and that's a wrap on the whole page, bestie!! ๐ this was ncurses 6.6, dated 2025-11-11, and it's all about tic(1). go compile something gorgeous. ๐
๐ธโจ
๐ฆ where this page comes from
- ubuntu resolute: ncurses-bin 6.6+20251231-1 ยท MIT/X11
- ubuntu stonking: ncurses-bin 6.6+20260608-2 ยท MIT/X11
- Copyright 2018-2024,2025 Thomas E. Dickey
- Copyright 1998-2016,2017 Free Software Foundation, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms