]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/tic.1m
ncurses 6.2 - patch 20210724
[ncurses.git] / man / tic.1m
1 .\"***************************************************************************
2 .\" Copyright 2018-2020,2021 Thomas E. Dickey                                *
3 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: tic.1m,v 1.79 2021/06/17 21:30:22 tom Exp $
31 .TH @TIC@ 1M ""
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .ds n 5
37 .ds d @TERMINFO@
38 .de bP
39 .ie n  .IP \(bu 4
40 .el    .IP \(bu 2
41 ..
42 .SH NAME
43 \fB@TIC@\fR \- the \fIterminfo\fR entry-description compiler
44 .SH SYNOPSIS
45 \fB@TIC@\fR
46 [\fB\-\
47 0\
48 1\
49 C\
50 D\
51 G\
52 I\
53 K\
54 L\
55 N\
56 T\
57 U\
58 V\
59 W\
60 a\
61 c\
62 f\
63 g\
64 q\
65 r\
66 s\
67 t\
68 x\
69 \fR]
70 [\fB\-e\fR \fInames\fR]
71 [\fB\-o\fR \fIdir\fR]
72 [\fB\-Q\fR[\fIn\fR]]
73 [\fB\-R\fR \fIsubset\fR]
74 [\fB\-v\fR[\fIn\fR]]
75 [\fB\-w\fR[\fIn\fR]]
76 \fIfile\fR
77 .br
78 .SH DESCRIPTION
79 The \fB@TIC@\fR command translates a \fBterminfo\fR file from source
80 format into compiled format.
81 The compiled format is necessary for use with
82 the library routines in \fBncurses\fR(3X).
83 .PP
84 As described in \fBterm\fR(\*n), the database may be either a directory
85 tree (one file per terminal entry) or a hashed database (one record per entry).
86 The \fB@TIC@\fR command writes only one type of entry,
87 depending on how it was built:
88 .bP
89 For directory trees, the top-level directory, e.g., /usr/share/terminfo,
90 specifies the location of the database.
91 .bP
92 For hashed databases, a filename is needed.
93 If the given file is not found by that name,
94 but can be found by adding the suffix ".db",
95 then that is used.
96 .IP
97 The default name for the hashed database is the same as the
98 default directory name (only adding a ".db" suffix).
99 .PP
100 In either case (directory or hashed database),
101 \fB@TIC@\fP will create the container if it does not exist.
102 For a directory, this would be the \*(``terminfo\*('' leaf,
103 versus a "terminfo.db" file.
104 .PP
105 The results are normally placed in the system terminfo database \fB\*d\fR.
106 The compiled terminal description can be placed
107 in a different terminfo database.
108 There are two ways to achieve this:
109 .bP
110 First, you may override the system default either by
111 using the \fB\-o\fP option,
112 or by setting the variable \fBTERMINFO\fR
113 in your shell environment to a valid database location.
114 .bP
115 Secondly, if \fB@TIC@\fR cannot write in \fI\*d\fR
116 or the location specified using your TERMINFO variable,
117 it looks for the directory \fI$HOME/.terminfo\fR
118 (or hashed database \fI$HOME/.terminfo.db)\fR;
119 if that location exists, the entry is placed there.
120 .PP
121 Libraries that read terminfo entries are expected to check in succession
122 .bP
123 a location specified with the TERMINFO environment variable,
124 .bP
125 \fI$HOME/.terminfo\fR,
126 .bP
127 directories listed in the TERMINFO_DIRS environment variable,
128 .bP
129 a compiled-in list of directories (@TERMINFO_DIRS@), and
130 .bP
131 the system terminfo database (\fI\*d\fR).
132 .SS ALIASES
133 .PP
134 This is the same program as @INFOTOCAP@ and @CAPTOINFO@;
135 usually those are linked to, or copied from this program:
136 .bP
137 When invoked as @INFOTOCAP@, @TIC@ sets the \fB\-I\fP option.
138 .bP
139 When invoked as @CAPTOINFO@, @TIC@ sets the \fB\-C\fP option.
140 .SS OPTIONS
141 .TP
142 \fB\-0\fR
143 restricts the output to a single line
144 .TP
145 \fB\-1\fR
146 restricts the output to a single column
147 .TP
148 \fB\-a\fR
149 tells \fB@TIC@\fP to retain commented-out capabilities rather than discarding
150 them.
151 Capabilities are commented by prefixing them with a period.
152 This sets the \fB\-x\fR option, because it treats the commented-out
153 entries as user-defined names.
154 If the source is termcap, accept the 2-character names required by version 6.
155 Otherwise these are ignored.
156 .TP
157 \fB\-C\fR
158 Force source translation to termcap format.
159 Note: this differs from the \fB\-C\fR
160 option of \fB@INFOCMP@\fR(1M) in that it does not merely translate capability
161 names, but also translates terminfo strings to termcap format.
162 Capabilities
163 that are not translatable are left in the entry under their terminfo names
164 but commented out with two preceding dots.
165 The actual format used incorporates some improvements for escaped characters
166 from terminfo format.
167 For a stricter BSD-compatible translation, add the \fB\-K\fR option.
168 .IP
169 If this is combined with \fB\-c\fR, \fB@TIC@\fR makes additional checks
170 to report cases where the terminfo values do not have an exact equivalent
171 in termcap form.
172 For example:
173 .RS
174 .bP
175 \fBsgr\fP usually will not convert, because termcap lacks the ability to
176 work with more than two parameters, and because termcap lacks many of
177 the arithmetic/logical operators used in terminfo.
178 .bP
179 capabilities with more than one delay or with delays before the end of
180 the string will not convert completely.
181 .RE
182 .TP
183 \fB\-c\fR
184 tells \fB@TIC@\fP to only check \fIfile\fR for errors,
185 including syntax problems and bad use-links.
186 If you specify \fB\-C\fR (\fB\-I\fR) with this option, the code
187 will print warnings about entries which, after use resolution, are more than
188 1023 (4096) bytes long.
189 Due to a fixed buffer length in older termcap libraries,
190 as well as buggy checking for the buffer length
191 (and a documented limit in terminfo),
192 these entries may cause core
193 dumps with other implementations.
194 .IP
195 \fB@TIC@\fP checks string capabilities to ensure that those with parameters
196 will be valid expressions.
197 It does this check only for the predefined string capabilities;
198 those which are defined with the \fB\-x\fP option are ignored.
199 .TP
200 \fB\-D\fR
201 tells \fB@TIC@\fP to print the database locations that it knows about, and exit.
202 The first location shown is the one to which it would write compiled
203 terminal descriptions.
204 If \fB@TIC@\fP is not able to find a writable database location
205 according to the rules summarized above,
206 it will print a diagnostic and exit with an error rather than
207 printing a list of database locations.
208 .TP
209 \fB\-e \fR\fInames\fR
210 Limit writes and translations to the following comma-separated list of
211 terminals.
212 If any name or alias of a terminal matches one of the names in
213 the list, the entry will be written or translated as normal.
214 Otherwise no output will be generated for it.
215 The option value is interpreted as a file containing the list if it
216 contains a '/'.
217 (Note: depending on how @TIC@ was compiled,
218 this option may require \fB\-I\fR or \fB\-C\fR.)
219 .TP
220 \fB\-f\fR
221 Display complex terminfo strings which contain if/then/else/endif expressions
222 indented for readability.
223 .TP
224 \fB\-G\fR
225 Display constant literals in decimal form
226 rather than their character equivalents.
227 .TP
228 \fB\-g\fR
229 Display constant character literals in quoted form
230 rather than their decimal equivalents.
231 .TP
232 \fB\-I\fR
233 Force source translation to terminfo format.
234 .TP
235 \fB\-K\fR
236 Suppress some longstanding ncurses extensions to termcap format,
237 e.g., "\\s" for space.
238 .TP
239 \fB\-L\fR
240 Force source translation to terminfo format
241 using the long C variable names listed in <\fBterm.h\fR>
242 .TP
243 \fB\-N\fR
244 Disable smart defaults.
245 Normally, when translating from termcap to terminfo, the compiler makes
246 a number of assumptions about the defaults of string capabilities
247 \fBreset1_string\fR, \fBcarriage_return\fR, \fBcursor_left\fR,
248 \fBcursor_down\fR, \fBscroll_forward\fR, \fBtab\fR, \fBnewline\fR,
249 \fBkey_backspace\fR, \fBkey_left\fR, and \fBkey_down\fR, then attempts
250 to use obsolete termcap capabilities to deduce correct values.
251 It also
252 normally suppresses output of obsolete termcap capabilities such as \fBbs\fR.
253 This option forces a more literal translation that also preserves the
254 obsolete capabilities.
255 .TP
256 \fB\-o\fR\fIdir\fR
257 Write compiled entries to given database location.
258 Overrides the TERMINFO environment variable.
259 .TP
260 \fB\-Q\fR\fIn\fR
261 Rather than show source in terminfo (text) format,
262 print the compiled (binary) format in hexadecimal or base64 form,
263 depending on the option's value:
264 .RS 8
265 .TP 3
266 1
267 hexadecimal
268 .TP 3
269 2
270 base64
271 .TP 3
272 3
273 hexadecimal and base64
274 .RE
275 .TP
276 \fB\-q\fR
277 Suppress comments and blank lines when showing translated source.
278 .TP
279 \fB\-R\fR\fIsubset\fR
280 Restrict output to a given subset.
281 This option is for use with archaic
282 versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support
283 the full set of SVR4/XSI Curses terminfo; and outright broken ports like AIX 3.x
284 that have their own extensions incompatible with SVr4/XSI.
285 Available subsets
286 are \*(``SVr1\*('', \*(``Ultrix\*('', \*(``HP\*('', \*(``BSD\*('' and \*(``AIX\*('';
287 see \fBterminfo\fR(\*n) for details.
288 .TP
289 \fB\-r\fR
290 Force entry resolution (so there are no remaining tc capabilities) even
291 when doing translation to termcap format.
292 This may be needed if you are
293 preparing a termcap file for a termcap library (such as GNU termcap through
294 version 1.3 or BSD termcap through 4.3BSD) that does not handle multiple
295 tc capabilities per entry.
296 .TP
297 \fB\-s\fR
298 Summarize the compile by showing the database location into which entries
299 are written, and the number of entries which are compiled.
300 .TP
301 \fB\-T\fR
302 eliminates size-restrictions on the generated text.
303 This is mainly useful for testing and analysis, since the compiled
304 descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo).
305 .TP
306 \fB\-t\fR
307 tells \fB@TIC@\fP to discard commented-out capabilities.
308 Normally when translating from terminfo to termcap,
309 untranslatable capabilities are commented-out.
310 .TP 5
311 \fB\-U\fR
312 tells \fB@TIC@\fP to not post-process the data after parsing the source file.
313 Normally, it infers data which is commonly missing in older terminfo data,
314 or in termcaps.
315 .TP
316 \fB\-V\fR
317 reports the version of ncurses which was used in this program, and exits.
318 .TP
319 \fB\-v\fR\fIn\fR
320 specifies that (verbose) output be written to standard error trace
321 information showing \fB@TIC@\fR's progress.
322 .IP
323 The optional parameter \fIn\fR is a number from 1 to 10, inclusive,
324 indicating the desired level of detail of information.
325 If ncurses is built without tracing support, the optional parameter is ignored.
326 If \fIn\fR is omitted, the default level is 1.
327 If \fIn\fR is specified and greater than 1, the level of
328 detail is increased.
329 .RS
330 .PP
331 The debug flag levels are as follows:
332 .TP
333 1
334 Names of files created and linked
335 .TP
336 2
337 Information related to the \*(``use\*('' facility
338 .TP
339 3
340 Statistics from the hashing algorithm
341 .TP
342 5
343 String-table memory allocations
344 .TP
345 7
346 Entries into the string-table
347 .TP
348 8
349 List of tokens encountered by scanner
350 .TP
351 9
352 All values computed in construction of the hash table
353 .LP
354 If the debug level \fIn\fR is not given, it is taken to be one.
355 .RE
356 .TP
357 \fB\-W\fR
358 By itself, the \fB\-w\fP option will not force long strings to be wrapped.
359 Use the \fB\-W\fP option to do this.
360 .IP
361 If you specify both \fB\-f\fP and \fB\-W\fP options,
362 the latter is ignored when \fB\-f\fP has already split the line.
363 .TP
364 \fB\-w\fR\fIn\fR
365 specifies the width of the output.
366 The parameter is optional.
367 If it is omitted, it defaults to 60.
368 .TP
369 \fB\-x\fR
370 Treat unknown capabilities as user-defined (see \fBuser_caps(\*n)\fP).
371 That is, if you supply a capability name which \fB@TIC@\fP does not recognize,
372 it will infer its type (boolean, number or string) from the syntax and
373 make an extended table entry for that.
374 User-defined capability strings
375 whose name begins with \*(``k\*('' are treated as function keys.
376 .SS PARAMETERS
377 .TP
378 \fIfile\fR
379 contains one or more \fBterminfo\fR terminal descriptions in source
380 format [see \fBterminfo\fR(\*n)].
381 Each description in the file
382 describes the capabilities of a particular terminal.
383 .IP
384 If \fIfile\fR is \*(``-\*('', then the data is read from the standard input.
385 The \fIfile\fR parameter may also be the path of a character-device.
386 .SS PROCESSING
387 .PP
388 All but one of the capabilities recognized by \fB@TIC@\fR are documented
389 in \fBterminfo\fR(\*n).
390 The exception is the \fBuse\fR capability.
391 .PP
392 When a \fBuse\fR=\fIentry\fR\-\fIname\fR field is discovered in a
393 terminal entry currently being compiled, \fB@TIC@\fR reads in the binary
394 from \fB\*d\fR to complete the entry.
395 (Entries created from
396 \fIfile\fR will be used first.
397 \fB@TIC@\fR duplicates the capabilities in
398 \fIentry\fR\-\fIname\fR for the current entry, with the exception of
399 those capabilities that explicitly are defined in the current entry.
400 .PP
401 When an entry, e.g., \fBentry_name_1\fR, contains a
402 \fBuse=\fR\fIentry\fR_\fIname\fR_\fI2\fR field, any canceled
403 capabilities in \fIentry\fR_\fIname\fR_\fI2\fR must also appear in
404 \fBentry_name_1\fR before \fBuse=\fR for these capabilities to be
405 canceled in \fBentry_name_1\fR.
406 .PP
407 Total compiled entries cannot exceed 4096 bytes.
408 The name field cannot
409 exceed 512 bytes.
410 Terminal names exceeding the maximum alias length
411 (32 characters on systems with long filenames, 14 characters otherwise)
412 will be truncated to the maximum alias length
413 and a warning message will be printed.
414 .SH HISTORY
415 .PP
416 System V Release 2 provided a \fBtic\fP utility.
417 It accepted a single option: \fB\-v\fP (optionally followed by a number).
418 According to Ross Ridge's comment in \fImytinfo\fP,
419 this version of \fBtic\fP was
420 unable to represent cancelled capabilities.
421 .PP
422 System V Release 3 provided a different \fBtic\fP utility,
423 written by Pavel Curtis,
424 (originally named \*(``compile\*('' in \fIpcurses\fP).
425 This added an option \fB\-c\fP to check the file for
426 errors, with the caveat that errors in \*(``use=\*('' links
427 would not be reported.
428 System V Release 3 documented a few warning messages which
429 did not appear in \fIpcurses\fP.
430 While the program itself was changed little as development
431 continued with System V Release 4,
432 the table of capabilities grew from 180 (\fIpcurses\fP) to 464 (Solaris).
433 .PP
434 In early development of ncurses (1993),
435 Zeyd Ben-Halim used the table from \fImytinfo\fP to
436 extend the \fIpcurses\fP table to 469 capabilities
437 (456 matched SVr4, 8 were only in SVr4, 13 were not in SVr4).
438 Of those 13, 11 were ultimately discarded
439 (perhaps to match the draft of X/Open Curses).
440 The exceptions were
441 \fBmemory_lock_above\fP and
442 \fBmemory_unlock\fP (see \fBuser_caps\fP(5)).
443 .PP
444 Eric Raymond incorporated parts of \fImytinfo\fP into ncurses
445 to implement the termcap-to-terminfo source conversion,
446 and extended that to begin development of
447 the corresponding terminfo-to-termcap source conversion,
448 Thomas Dickey completed that development over the course of several years.
449 .PP
450 In 1999, Thomas Dickey added the \fB\-x\fP option
451 to support user-defined capabilities.
452 .PP
453 In 2010, Roy Marples provided a \fBtic\fP program
454 and terminfo library for NetBSD.
455 That implementation adapts several features from ncurses,
456 including \fB@TIC@\fP's \fB\-x\fP option.
457 .PP
458 The \fB\-c\fP option tells \fB@TIC@\fP to check for problems in the
459 terminfo source file.
460 Continued development provides additional checks:
461 .bP
462 \fIpcurses\fP had 8 warnings
463 .bP
464 ncurses in 1996 had 16 warnings
465 .bP
466 Solaris (SVr4) curses has 28 warnings
467 .bP
468 NetBSD tic in 2019 has 19 warnings.
469 .bP
470 ncurses in 2019 has 96 warnings
471 .PP
472 The checking done in ncurses' \fB@TIC@\fP helps with the conversion to
473 termcap, as well as pointing out errors and inconsistencies.
474 It is also used to ensure consistency with the user-defined capabilities.
475 There are 527 distinct capabilities in ncurses' terminal database;
476 128 of those are user-defined.
477 .SH PORTABILITY
478 .PP
479 X/Open Curses, Issue 7 (2009) provides a brief description of \fBtic\fP.
480 It lists one option: \fB\-c\fP.
481 The omission of \fB\-v\fP is unexpected.
482 The change history states that the description is derived from True64 UNIX.
483 According to its manual pages, that system also supported the \fB\-v\fP option.
484 .PP
485 Shortly after Issue 7 was released, Tru64 was discontinued.
486 As of 2019, the surviving implementations of \fBtic\fP
487 are SVr4 (AIX, HP-UX and Solaris),
488 ncurses
489 and NetBSD curses.
490 The SVr4 \fBtic\fP programs all support the \fB\-v\fP option.
491 The NetBSD \fBtic\fP program follows X/Open's documentation,
492 omitting the \fB\-v\fP option.
493 .PP
494 The X/Open rationale states that some implementations of \fBtic\fP
495 read terminal descriptions from the standard input if the \fIfile\fP
496 parameter is omitted.
497 None of these implementations do that.
498 Further, it comments that some may choose to read from \*(''./terminfo.src\*(''
499 but that is obsolescent behavior from SVr2,
500 and is not (for example) a documented feature of SVr3.
501 .SS COMPATIBILITY
502 There is some evidence that historic \fB@TIC@\fR implementations treated
503 description fields with no whitespace in them as additional aliases or
504 short names.
505 This \fB@TIC@\fR does not do that, but it does warn when
506 description fields may be treated that way and check them for dangerous
507 characters.
508 .SS EXTENSIONS
509 Unlike the SVr4 \fB@TIC@\fR command, this implementation can actually
510 compile termcap sources.
511 In fact, entries in terminfo and termcap syntax can
512 be mixed in a single source file.
513 See \fBterminfo\fR(\*n) for the list of
514 termcap names taken to be equivalent to terminfo names.
515 .PP
516 The SVr4 manual pages are not clear on the resolution rules for \fBuse\fR
517 capabilities.
518 This implementation of \fB@TIC@\fR will find \fBuse\fR targets anywhere
519 in the source file, or anywhere in the file tree rooted at \fBTERMINFO\fR (if
520 \fBTERMINFO\fR is defined),
521 or in the user's \fI$HOME/.terminfo\fR database
522 (if it exists),
523 or (finally) anywhere in the system's file tree of
524 compiled entries.
525 .PP
526 The error messages from this \fB@TIC@\fR have the same format as GNU C
527 error messages, and can be parsed by GNU Emacs's compile facility.
528 .PP
529 Aside from \fB\-c\fP and \fB\-v\fP, options are not portable:
530 .bP
531 Most of @TIC@'s options
532 are not supported by SVr4 \fBtic\fP:
533 .sp
534 .RS
535 \fB\-0\fR
536 \fB\-1\fR
537 \fB\-C\fR
538 \fB\-G\fR
539 \fB\-I\fR
540 \fB\-N\fR
541 \fB\-R\fR
542 \fB\-T\fR
543 \fB\-V\fR
544 \fB\-a\fR
545 \fB\-e\fR
546 \fB\-f\fR
547 \fB\-g\fR
548 \fB\-o\fR
549 \fB\-r\fR
550 \fB\-s\fR
551 \fB\-t\fR
552 \fB\-x\fR
553 .RE
554 .bP
555 The NetBSD \fBtic\fP  supports a few of the ncurses options
556 .sp
557 .RS
558 \fB\-a\fP
559 \fB\-o\fP
560 \fB\-x\fP
561 .RE
562 .IP
563 and adds \fB\-S\fP
564 (a feature which does the same thing
565 as @INFOCMP@'s \fB\-e\fP and \fB\-E\fP options).
566 .PP
567 The SVr4 \fB\-c\fR mode does not report bad \*(``use=\*('' links.
568 .PP
569 System V does not compile entries to or read entries from your
570 \fI$HOME/.terminfo\fR database unless TERMINFO is explicitly set to it.
571 .SH FILES
572 .TP 5
573 \fB\*d/?/*\fR
574 Compiled terminal description database.
575 .SH SEE ALSO
576 \fB@CAPTOINFO@\fR(1M),
577 \fB@INFOCMP@\fR(1M),
578 \fB@INFOTOCAP@\fR(1M),
579 \fB@TOE@\fR(1M),
580 \fBcurses\fR(3X),
581 \fBterm\fR(\*n).
582 \fBterminfo\fR(\*n).
583 \fBuser_caps\fR(\*n).
584 .PP
585 This describes \fBncurses\fR
586 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
587 .SH AUTHOR
588 Eric S. Raymond <esr@snark.thyrsus.com>
589 and
590 .br
591 Thomas E. Dickey <dickey@invisible-island.net>