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