]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/terminfo.tail
3112cb04985fbe9ffb54e9c701c3e63caeac9e49
[ncurses.git] / man / terminfo.tail
1 .\" $Id: terminfo.tail,v 1.93 2019/06/01 22:32:15 tom Exp $
2 .\" Beginning of terminfo.tail file
3 .\" This file is part of ncurses.
4 .\" See "terminfo.head" for copyright.
5 .ps +1
6 .SS User-Defined Capabilities
7 .
8 The preceding section listed the \fIpredefined\fP capabilities.
9 They deal with some special features for terminals no longer
10 (or possibly never) produced.
11 Occasionally there are special features of newer terminals which
12 are awkward or impossible to represent by reusing the predefined
13 capabilities.
14 .PP
15 \fBncurses\fP addresses this limitation by allowing user-defined capabilities.
16 The \fB@TIC@\fP and \fB@INFOCMP@\fP programs provide
17 the \fB\-x\fP option for this purpose.
18 When \fB\-x\fP is set,
19 \fB@TIC@\fP treats unknown capabilities as user-defined.
20 That is, if \fB@TIC@\fP encounters a capability name
21 which it does not recognize,
22 it infers its type (boolean, number or string) from the syntax
23 and makes an extended table entry for that capability.
24 The \fBuse_extended_names\fP(3X) function makes this information
25 conditionally available to applications.
26 The ncurses library provides the data leaving most of the behavior
27 to applications:
28 .bP
29 User-defined capability strings whose name begins
30 with \*(``k\*('' are treated as function keys.
31 .bP
32 The types (boolean, number, string) determined by \fB@TIC@\fP
33 can be inferred by successful calls on \fBtigetflag\fP, etc.
34 .bP
35 If the capability name happens to be two characters,
36 the capability is also available through the termcap interface.
37 .PP
38 While termcap is said to be extensible because it does not use a predefined set
39 of capabilities,
40 in practice it has been limited to the capabilities defined by
41 terminfo implementations.
42 As a rule,
43 user-defined capabilities intended for use by termcap applications should
44 be limited to booleans and numbers to avoid running past the 1023 byte
45 limit assumed by termcap implementations and their applications.
46 In particular, providing extended sets of function keys (past the 60
47 numbered keys and the handful of special named keys) is best done using
48 the longer names available using terminfo.
49 .
50 .SS A Sample Entry
51 .
52 The following entry, describing an ANSI-standard terminal, is representative
53 of what a \fBterminfo\fR entry for a modern terminal typically looks like.
54 .PP
55 .nf
56 .ft CW
57 \s-2ansi|ansi/pc-term compatible with color,
58         am, mc5i, mir, msgr,
59         colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
60         acsc=+\\020\\,\\021-\\030.^Y0\\333`\\004a\\261f\\370g\\361h\\260
61              j\\331k\\277l\\332m\\300n\\305o~p\\304q\\304r\\304s_t\\303
62              u\\264v\\301w\\302x\\263y\\363z\\362{\\343|\\330}\\234~\\376,
63         bel=^G, blink=\\E[5m, bold=\\E[1m, cbt=\\E[Z, clear=\\E[H\\E[J,
64         cr=^M, cub=\\E[%p1%dD, cub1=\\E[D, cud=\\E[%p1%dB, cud1=\\E[B,
65         cuf=\\E[%p1%dC, cuf1=\\E[C, cup=\\E[%i%p1%d;%p2%dH,
66         cuu=\\E[%p1%dA, cuu1=\\E[A, dch=\\E[%p1%dP, dch1=\\E[P,
67         dl=\\E[%p1%dM, dl1=\\E[M, ech=\\E[%p1%dX, ed=\\E[J, el=\\E[K,
68         el1=\\E[1K, home=\\E[H, hpa=\\E[%i%p1%dG, ht=\\E[I, hts=\\EH,
69         ich=\\E[%p1%d@, il=\\E[%p1%dL, il1=\\E[L, ind=^J,
70         indn=\\E[%p1%dS, invis=\\E[8m, kbs=^H, kcbt=\\E[Z, kcub1=\\E[D,
71         kcud1=\\E[B, kcuf1=\\E[C, kcuu1=\\E[A, khome=\\E[H, kich1=\\E[L,
72         mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S, op=\\E[39;49m,
73         rep=%p1%c\\E[%p2%{1}%-%db, rev=\\E[7m, rin=\\E[%p1%dT,
74         rmacs=\\E[10m, rmpch=\\E[10m, rmso=\\E[m, rmul=\\E[m,
75         s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B, s3ds=\\E+B,
76         setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,
77         sgr=\\E[0;10%?%p1%t;7%;
78                    %?%p2%t;4%;
79                    %?%p3%t;7%;
80                    %?%p4%t;5%;
81                    %?%p6%t;1%;
82                    %?%p7%t;8%;
83                    %?%p9%t;11%;m,
84         sgr0=\\E[0;10m, smacs=\\E[11m, smpch=\\E[11m, smso=\\E[7m,
85         smul=\\E[4m, tbc=\\E[3g, u6=\\E[%i%d;%dR, u7=\\E[6n,
86         u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%i%p1%dd,
87 .fi
88 .ft R
89 .PP
90 Entries may continue onto multiple lines by placing white space at
91 the beginning of each line except the first.
92 Comments may be included on lines beginning with \*(``#\*(''.
93 Capabilities in
94 .I terminfo
95 are of three types:
96 .bP
97 Boolean capabilities which indicate that the terminal has
98 some particular feature,
99 .bP
100 numeric capabilities giving the size of the terminal
101 or the size of particular delays, and
102 .bP
103 string
104 capabilities, which give a sequence which can be used to perform particular
105 terminal operations.
106 .PP
107 .SS Types of Capabilities
108 .PP
109 All capabilities have names.
110 For instance, the fact that
111 ANSI-standard terminals have
112 .I "automatic margins"
113 (i.e., an automatic return and line-feed
114 when the end of a line is reached) is indicated by the capability \fBam\fR.
115 Hence the description of ansi includes \fBam\fR.
116 Numeric capabilities are followed by the character \*(``#\*('' and then a positive value.
117 Thus \fBcols\fR, which indicates the number of columns the terminal has,
118 gives the value \*(``80\*('' for ansi.
119 Values for numeric capabilities may be specified in decimal, octal or hexadecimal,
120 using the C programming language conventions (e.g., 255, 0377 and 0xff or 0xFF).
121 .PP
122 Finally, string valued capabilities, such as \fBel\fR (clear to end of line
123 sequence) are given by the two-character code, an \*(``=\*('', and then a string
124 ending at the next following \*(``,\*(''.
125 .PP
126 A number of escape sequences are provided in the string valued capabilities
127 for easy encoding of characters there:
128 .bP
129 Both \fB\eE\fR and \fB\ee\fR
130 map to an \s-1ESCAPE\s0 character,
131 .bP
132 \fB^x\fR maps to a control-x for any appropriate \fIx\fP, and
133 .bP
134 the sequences
135 .RS 6
136 .PP
137 \fB\en\fP, \fB\el\fP, \fB\er\fP, \fB\et\fP, \fB\eb\fP, \fB\ef\fP, and \fB\es\fR
138 .RE
139 .IP
140 produce
141 .RS 6
142 .PP
143 \fInewline\fP, \fIline-feed\fP, \fIreturn\fP, \fItab\fP, \fIbackspace\fP, \fIform-feed\fP, and \fIspace\fP,
144 .RE
145 .IP
146 respectively.
147 .PP
148 X/Open Curses does not say what \*(``appropriate \fIx\fP\*('' might be.
149 In practice, that is a printable ASCII graphic character.
150 The special case \*(``^?\*('' is interpreted as DEL (127).
151 In all other cases, the character value is AND'd with 0x1f,
152 mapping to ASCII control codes in the range 0 through 31.
153 .PP
154 Other escapes include
155 .bP
156 \fB\e^\fR for \fB^\fR,
157 .bP
158 \fB\e\e\fR for \fB\e\fR,
159 .bP
160 \fB\e\fR, for comma,
161 .bP
162 \fB\e:\fR for \fB:\fR,
163 .bP
164 and \fB\e0\fR for null.
165 .IP
166 \fB\e0\fR will produce \e200, which does not terminate a string but behaves
167 as a null character on most terminals, providing CS7 is specified.
168 See \fBstty\fP(1).
169 .IP
170 The reason for this quirk is to maintain binary compatibility of the
171 compiled terminfo files with other implementations,
172 e.g., the SVr4 systems, which document this.
173 Compiled terminfo files use null-terminated strings, with no lengths.
174 Modifying this would require a new binary format, 
175 which would not work with other implementations.
176 .PP
177 Finally, characters may be given as three octal digits after a \fB\e\fR.
178 .PP
179 A delay in milliseconds may appear anywhere in a string capability, enclosed in
180 $<..> brackets, as in \fBel\fP=\eEK$<5>,
181 and padding characters are supplied by \fBtputs\fP(3X)
182 to provide this delay.
183 .bP
184 The delay must be a number with at most one decimal
185 place of precision; it may be followed by suffixes \*(``*\*('' or \*(``/\*('' or both.
186 .bP
187 A \*(``*\*(''
188 indicates that the padding required is proportional to the number of lines
189 affected by the operation, and the amount given is the per-affected-unit
190 padding required.
191 (In the case of insert character, the factor is still the
192 number of \fIlines\fP affected.)
193 .IP
194 Normally, padding is advisory if the device has the \fBxon\fR
195 capability; it is used for cost computation but does not trigger delays.
196 .bP
197 A \*(``/\*(''
198 suffix indicates that the padding is mandatory and forces a delay of the given
199 number of milliseconds even on devices for which \fBxon\fR is present to
200 indicate flow control.
201 .PP
202 Sometimes individual capabilities must be commented out.
203 To do this, put a period before the capability name.
204 For example, see the second
205 .B ind
206 in the example above.
207 .br
208 .ne 5
209 .PP
210 .SS Fetching Compiled Descriptions
211 .PP
212 The \fBncurses\fP library searches for terminal descriptions in several places.
213 It uses only the first description found.
214 The library has a compiled-in list of places to search
215 which can be overridden by environment variables.
216 Before starting to search,
217 \fBncurses\fP eliminates duplicates in its search list.
218 .bP
219 If the environment variable TERMINFO is set, it is interpreted as the pathname
220 of a directory containing the compiled description you are working on.
221 Only that directory is searched.
222 .bP
223 If TERMINFO is not set,
224 \fBncurses\fR will instead look in the directory \fB$HOME/.terminfo\fR
225 for a compiled description.
226 .bP
227 Next, if the environment variable TERMINFO_DIRS is set,
228 \fBncurses\fR will interpret the contents of that variable
229 as a list of colon-separated directories (or database files) to be searched.
230 .IP
231 An empty directory name (i.e., if the variable begins or ends
232 with a colon, or contains adjacent colons)
233 is interpreted as the system location \fI\*d\fR.
234 .bP
235 Finally, \fBncurses\fP searches these compiled-in locations:
236 .RS
237 .bP
238 a list of directories (@TERMINFO_DIRS@), and
239 .bP
240 the system terminfo directory, \fI\*d\fR (the compiled-in default).
241 .RE
242 .SS Preparing Descriptions
243 .PP
244 We now outline how to prepare descriptions of terminals.
245 The most effective way to prepare a terminal description is by imitating
246 the description of a similar terminal in
247 .I terminfo
248 and to build up a description gradually, using partial descriptions
249 with
250 .I vi
251 or some other screen-oriented program to check that they are correct.
252 Be aware that a very unusual terminal may expose deficiencies in
253 the ability of the
254 .I terminfo
255 file to describe it
256 or bugs in the screen-handling code of the test program.
257 .PP
258 To get the padding for insert line right (if the terminal manufacturer
259 did not document it) a severe test is to edit a large file at 9600 baud,
260 delete 16 or so lines from the middle of the screen, then hit the \*(``u\*(''
261 key several times quickly.
262 If the terminal messes up, more padding is usually needed.
263 A similar test can be used for insert character.
264 .PP
265 .SS Basic Capabilities
266 .PP
267 The number of columns on each line for the terminal is given by the
268 \fBcols\fR numeric capability.
269 If the terminal is a \s-1CRT\s0, then the
270 number of lines on the screen is given by the \fBlines\fR capability.
271 If the terminal wraps around to the beginning of the next line when
272 it reaches the right margin, then it should have the \fBam\fR capability.
273 If the terminal can clear its screen, leaving the cursor in the home
274 position, then this is given by the \fBclear\fR string capability.
275 If the terminal overstrikes
276 (rather than clearing a position when a character is struck over)
277 then it should have the \fBos\fR capability.
278 If the terminal is a printing terminal, with no soft copy unit,
279 give it both
280 .B hc
281 and
282 .BR os .
283 .RB ( os
284 applies to storage scope terminals, such as \s-1TEKTRONIX\s+1 4010
285 series, as well as hard copy and APL terminals.)
286 If there is a code to move the cursor to the left edge of the current
287 row, give this as
288 .BR cr .
289 (Normally this will be carriage return, control/M.)
290 If there is a code to produce an audible signal (bell, beep, etc)
291 give this as
292 .BR bel .
293 .PP
294 If there is a code to move the cursor one position to the left
295 (such as backspace) that capability should be given as
296 .BR cub1 .
297 Similarly, codes to move to the right, up, and down should be
298 given as
299 .BR cuf1 ,
300 .BR cuu1 ,
301 and
302 .BR cud1 .
303 These local cursor motions should not alter the text they pass over,
304 for example, you would not normally use \*(``\fBcuf1\fP=\ \*('' because the
305 space would erase the character moved over.
306 .PP
307 A very important point here is that the local cursor motions encoded
308 in
309 .I terminfo
310 are undefined at the left and top edges of a \s-1CRT\s0 terminal.
311 Programs should never attempt to backspace around the left edge,
312 unless
313 .B bw
314 is given,
315 and never attempt to go up locally off the top.
316 In order to scroll text up, a program will go to the bottom left corner
317 of the screen and send the
318 .B ind
319 (index) string.
320 .PP
321 To scroll text down, a program goes to the top left corner
322 of the screen and sends the
323 .B ri
324 (reverse index) string.
325 The strings
326 .B ind
327 and
328 .B ri
329 are undefined when not on their respective corners of the screen.
330 .PP
331 Parameterized versions of the scrolling sequences are
332 .B indn
333 and
334 .B rin
335 which have the same semantics as
336 .B ind
337 and
338 .B ri
339 except that they take one parameter, and scroll that many lines.
340 They are also undefined except at the appropriate edge of the screen.
341 .PP
342 The \fBam\fR capability tells whether the cursor sticks at the right
343 edge of the screen when text is output, but this does not necessarily
344 apply to a
345 .B cuf1
346 from the last column.
347 The only local motion which is defined from the left edge is if
348 .B bw
349 is given, then a
350 .B cub1
351 from the left edge will move to the right edge of the previous row.
352 If
353 .B bw
354 is not given, the effect is undefined.
355 This is useful for drawing a box around the edge of the screen, for example.
356 If the terminal has switch selectable automatic margins,
357 the
358 .I terminfo
359 file usually assumes that this is on; i.e., \fBam\fR.
360 If the terminal has a command which moves to the first column of the next
361 line, that command can be given as
362 .B nel
363 (newline).
364 It does not matter if the command clears the remainder of the current line,
365 so if the terminal has no
366 .B cr
367 and
368 .B lf
369 it may still be possible to craft a working
370 .B nel
371 out of one or both of them.
372 .PP
373 These capabilities suffice to describe hard-copy and \*(``glass-tty\*('' terminals.
374 Thus the model 33 teletype is described as
375 .PP
376 .DT
377 .nf
378 .ft CW
379 .\".in -2
380 \s-133\||\|tty33\||\|tty\||\|model 33 teletype,
381         bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1
382 .\".in +2
383 .ft R
384 .fi
385 .PP
386 while the Lear Siegler \s-1ADM-3\s0 is described as
387 .PP
388 .DT
389 .nf
390 .ft CW
391 .\".in -2
392 \s-1adm3\||\|3\||\|lsi adm3,
393         am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
394         ind=^J, lines#24,\s+1
395 .\".in +2
396 .ft R
397 .fi
398 .PP
399 .SS Parameterized Strings
400 .PP
401 Cursor addressing and other strings requiring parameters
402 in the terminal are described by a
403 parameterized string capability,
404 with \fIprintf\fP-like escapes such as \fI%x\fR in it.
405 For example, to address the cursor, the
406 .B cup
407 capability is given, using two parameters:
408 the row and column to address to.
409 (Rows and columns are numbered from zero and refer to the
410 physical screen visible to the user, not to any unseen memory.)
411 If the terminal has memory relative cursor addressing,
412 that can be indicated by
413 .BR mrcup .
414 .PP
415 The parameter mechanism uses a stack and special \fB%\fP codes
416 to manipulate it.
417 Typically a sequence will push one of the
418 parameters onto the stack and then print it in some format.
419 Print (e.g., "%d") is a special case.
420 Other operations, including "%t" pop their operand from the stack.
421 It is noted that more complex operations are often necessary,
422 e.g., in the \fBsgr\fP string.
423 .PP
424 The \fB%\fR encodings have the following meanings:
425 .PP
426 .TP 5
427 \fB%%\fP
428 outputs \*(``%\*(''
429 .TP
430 \fB%\fP\fI[[\fP:\fI]flags][width[.precision]][\fP\fBdoxXs\fP\fI]\fP
431 as in \fBprintf\fP(3), flags are \fI[\-+#]\fP and \fIspace\fP.
432 Use a \*(``:\*('' to allow the next character to be a \*(``\-\*('' flag,
433 avoiding interpreting \*(``%\-\*('' as an operator.
434 .TP
435 \f(CW%c\fP
436 print \fIpop()\fP like %c in \fBprintf\fP
437 .TP
438 \fB%s\fP
439 print \fIpop()\fP like %s in \fBprintf\fP
440 .TP
441 \fB%p\fP\fI[1\-9]\fP
442 push \fIi\fP'th parameter
443 .TP
444 \fB%P\fP\fI[a\-z]\fP
445 set dynamic variable \fI[a\-z]\fP to \fIpop()\fP
446 .TP
447 \fB%g\fP\fI[a\-z]/\fP
448 get dynamic variable \fI[a\-z]\fP and push it
449 .TP
450 \fB%P\fP\fI[A\-Z]\fP
451 set static variable \fI[a\-z]\fP to \fIpop()\fP
452 .TP
453 \fB%g\fP\fI[A\-Z]\fP
454 get static variable \fI[a\-z]\fP and push it
455 .IP
456 The terms "static" and "dynamic" are misleading.
457 Historically, these are simply two different sets of variables,
458 whose values are not reset between calls to \fBtparm\fP(3X).
459 However, that fact is not documented in other implementations.
460 Relying on it will adversely impact portability to other implementations.
461 .TP
462 \fB%'\fP\fIc\fP\fB'\fP
463 char constant \fIc\fP
464 .TP
465 \fB%{\fP\fInn\fP\fB}\fP
466 integer constant \fInn\fP
467 .TP
468 \fB%l\fP
469 push strlen(pop)
470 .TP
471 \fB%+\fP, \fB%\-\fP, \fB%*\fP, \fB%/\fP, \fB%m\fP
472 arithmetic (%m is \fImod\fP): \fIpush(pop() op pop())\fP
473 .TP
474 \fB%&\fP, \fB%|\fP, \fB%^\fP
475 bit operations (AND, OR and exclusive-OR): \fIpush(pop() op pop())\fP
476 .TP
477 \fB%=\fP, \fB%>\fP, \fB%<\fP
478 logical operations: \fIpush(pop() op pop())\fP
479 .TP
480 \fB%A\fP, \fB%O\fP
481 logical AND and OR operations (for conditionals)
482 .TP
483 \fB%!\fP, \fB%~\fP
484 unary operations (logical and bit complement): \fIpush(op pop())\fP
485 .TP
486 \fB%i\fP
487 add 1 to first two parameters (for ANSI terminals)
488 .TP
489 \fB%?\fP \fIexpr\fP \fB%t\fP \fIthenpart\fP \fB%e\fP \fIelsepart\fP \fB%;\fP
490 This forms an if-then-else.
491 The \fB%e\fP \fIelsepart\fP is optional.
492 Usually the \fB%?\fP \fIexpr\fP part pushes a value onto the stack,
493 and \fB%t\fP pops it from the stack, testing if it is nonzero (true).
494 If it is zero (false), control passes to the \fB%e\fP (else) part.
495 .IP
496 It is possible to form else-if's a la Algol 68:
497 .RS
498 \fB%?\fP c\d1\u \fB%t\fP b\d1\u \fB%e\fP c\d2\u \fB%t\fP b\d2\u \fB%e\fP c\d3\u \fB%t\fP b\d3\u \fB%e\fP c\d4\u \fB%t\fP b\d4\u \fB%e\fP \fB%;\fP
499 .RE
500 .IP
501 where c\di\u are conditions, b\di\u are bodies.
502 .IP
503 Use the \fB\-f\fP option of \fB@TIC@\fP or \fB@INFOCMP@\fP to see
504 the structure of if-then-else's.
505 Some strings, e.g., \fBsgr\fP can be very complicated when written
506 on one line.
507 The \fB\-f\fP option splits the string into lines with the parts indented.
508 .PP
509 Binary operations are in postfix form with the operands in the usual order.
510 That is, to get x\-5 one would use "%gx%{5}%-".
511 \fB%P\fP and \fB%g\fP variables are
512 persistent across escape-string evaluations.
513 .PP
514 Consider the HP2645, which, to get to row 3 and column 12, needs
515 to be sent \eE&a12c03Y padded for 6 milliseconds.
516 Note that the order
517 of the rows and columns is inverted here, and that the row and column
518 are printed as two digits.
519 Thus its \fBcup\fR capability is \*(``cup=6\eE&%p2%2dc%p1%2dY\*(''.
520 .PP
521 The Microterm \s-1ACT-IV\s0 needs the current row and column sent
522 preceded by a \fB^T\fR, with the row and column simply encoded in binary,
523 \*(``cup=^T%p1%c%p2%c\*(''.
524 Terminals which use \*(``%c\*('' need to be able to
525 backspace the cursor (\fBcub1\fR),
526 and to move the cursor up one line on the screen (\fBcuu1\fR).
527 This is necessary because it is not always safe to transmit \fB\en\fR
528 \fB^D\fR and \fB\er\fR, as the system may change or discard them.
529 (The library routines dealing with terminfo set tty modes so that
530 tabs are never expanded, so \et is safe to send.
531 This turns out to be essential for the Ann Arbor 4080.)
532 .PP
533 A final example is the \s-1LSI ADM\s0-3a, which uses row and column
534 offset by a blank character, thus \*(``cup=\eE=%p1%' '%+%c%p2%' '%+%c\*(''.
535 After sending \*(``\eE=\*('', this pushes the first parameter, pushes the
536 ASCII value for a space (32), adds them (pushing the sum on the stack
537 in place of the two previous values) and outputs that value as a character.
538 Then the same is done for the second parameter.
539 More complex arithmetic is possible using the stack.
540 .PP
541 .SS Cursor Motions
542 .PP
543 If the terminal has a fast way to home the cursor
544 (to very upper left corner of screen) then this can be given as
545 \fBhome\fR; similarly a fast way of getting to the lower left-hand corner
546 can be given as \fBll\fR; this may involve going up with \fBcuu1\fR
547 from the home position,
548 but a program should never do this itself (unless \fBll\fR does) because it
549 can make no assumption about the effect of moving up from the home position.
550 Note that the home position is the same as addressing to (0,0):
551 to the top left corner of the screen, not of memory.
552 (Thus, the \eEH sequence on HP terminals cannot be used for
553 .BR home .)
554 .PP
555 If the terminal has row or column absolute cursor addressing,
556 these can be given as single parameter capabilities
557 .B hpa
558 (horizontal position absolute)
559 and
560 .B vpa
561 (vertical position absolute).
562 Sometimes these are shorter than the more general two parameter
563 sequence (as with the hp2645) and can be used in preference to
564 .BR cup .
565 If there are parameterized local motions (e.g., move
566 .I n
567 spaces to the right) these can be given as
568 .BR cud ,
569 .BR cub ,
570 .BR cuf ,
571 and
572 .B cuu
573 with a single parameter indicating how many spaces to move.
574 These are primarily useful if the terminal does not have
575 .BR cup ,
576 such as the \s-1TEKTRONIX\s+1 4025.
577 .PP
578 If the terminal needs to be in a special mode when running
579 a program that uses these capabilities,
580 the codes to enter and exit this mode can be given as \fBsmcup\fR and \fBrmcup\fR.
581 This arises, for example, from terminals like the Concept with more than
582 one page of memory.
583 If the terminal has only memory relative cursor addressing and not screen
584 relative cursor addressing, a one screen-sized window must be fixed into
585 the terminal for cursor addressing to work properly.
586 This is also used for the \s-1TEKTRONIX\s+1 4025,
587 where
588 .B smcup
589 sets the command character to be the one used by terminfo.
590 If the \fBsmcup\fP sequence will not restore the screen after an
591 \fBrmcup\fP sequence is output (to the state prior to outputting
592 \fBrmcup\fP), specify \fBnrrmc\fP.
593 .PP
594 .SS Area Clears
595 .PP
596 If the terminal can clear from the current position to the end of the
597 line, leaving the cursor where it is, this should be given as \fBel\fR.
598 If the terminal can clear from the beginning of the line to the current
599 position inclusive, leaving
600 the cursor where it is, this should be given as \fBel1\fP.
601 If the terminal can clear from the current position to the end of the
602 display, then this should be given as \fBed\fR.
603 \fBEd\fR is only defined from the first column of a line.
604 (Thus, it can be simulated by a request to delete a large number of lines,
605 if a true
606 .B ed
607 is not available.)
608 .PP
609 .SS Insert/delete line and vertical motions
610 .PP
611 If the terminal can open a new blank line before the line where the cursor
612 is, this should be given as \fBil1\fR; this is done only from the first
613 position of a line.
614 The cursor must then appear on the newly blank line.
615 If the terminal can delete the line which the cursor is on, then this
616 should be given as \fBdl1\fR; this is done only from the first position on
617 the line to be deleted.
618 Versions of
619 .B il1
620 and
621 .B dl1
622 which take a single parameter and insert or delete that many lines can
623 be given as
624 .B il
625 and
626 .BR dl .
627 .PP
628 If the terminal has a settable scrolling region (like the vt100)
629 the command to set this can be described with the
630 .B csr
631 capability, which takes two parameters:
632 the top and bottom lines of the scrolling region.
633 The cursor position is, alas, undefined after using this command.
634 .PP
635 It is possible to get the effect of insert or delete line using
636 .B csr
637 on a properly chosen region; the
638 .B sc
639 and
640 .B rc
641 (save and restore cursor) commands may be useful for ensuring that
642 your synthesized insert/delete string does not move the cursor.
643 (Note that the \fBncurses\fR(3X) library does this synthesis
644 automatically, so you need not compose insert/delete strings for
645 an entry with \fBcsr\fR).
646 .PP
647 Yet another way to construct insert and delete might be to use a combination of
648 index with the memory-lock feature found on some terminals (like the HP\-700/90
649 series, which however also has insert/delete).
650 .PP
651 Inserting lines at the top or bottom of the screen can also be
652 done using
653 .B ri
654 or
655 .B ind
656 on many terminals without a true insert/delete line,
657 and is often faster even on terminals with those features.
658 .PP
659 The boolean \fBnon_dest_scroll_region\fR should be set if each scrolling
660 window is effectively a view port on a screen-sized canvas.
661 To test for
662 this capability, create a scrolling region in the middle of the screen,
663 write something to the bottom line, move the cursor to the top of the region,
664 and do \fBri\fR followed by \fBdl1\fR or \fBind\fR.
665 If the data scrolled
666 off the bottom of the region by the \fBri\fR re-appears, then scrolling
667 is non-destructive.
668 System V and XSI Curses expect that \fBind\fR, \fBri\fR,
669 \fBindn\fR, and \fBrin\fR will simulate destructive scrolling; their
670 documentation cautions you not to define \fBcsr\fR unless this is true.
671 This \fBcurses\fR implementation is more liberal and will do explicit erases
672 after scrolling if \fBndsrc\fR is defined.
673 .PP
674 If the terminal has the ability to define a window as part of
675 memory, which all commands affect,
676 it should be given as the parameterized string
677 .BR wind .
678 The four parameters are the starting and ending lines in memory
679 and the starting and ending columns in memory, in that order.
680 .PP
681 If the terminal can retain display memory above, then the
682 \fBda\fR capability should be given; if display memory can be retained
683 below, then \fBdb\fR should be given.
684 These indicate
685 that deleting a line or scrolling may bring non-blank lines up from below
686 or that scrolling back with \fBri\fR may bring down non-blank lines.
687 .PP
688 .SS Insert/Delete Character
689 .PP
690 There are two basic kinds of intelligent terminals with respect to
691 insert/delete character which can be described using
692 .I terminfo.
693 The most common insert/delete character operations affect only the characters
694 on the current line and shift characters off the end of the line rigidly.
695 Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make
696 a distinction between typed and untyped blanks on the screen, shifting
697 upon an insert or delete only to an untyped blank on the screen which is
698 either eliminated, or expanded to two untyped blanks.
699 .PP
700 You can determine the
701 kind of terminal you have by clearing the screen and then typing
702 text separated by cursor motions.
703 Type \*(``abc\ \ \ \ def\*('' using local
704 cursor motions (not spaces) between the \*(``abc\*('' and the \*(``def\*(''.
705 Then position the cursor before the \*(``abc\*('' and put the terminal in insert
706 mode.
707 If typing characters causes the rest of the line to shift
708 rigidly and characters to fall off the end, then your terminal does
709 not distinguish between blanks and untyped positions.
710 If the \*(``abc\*(''
711 shifts over to the \*(``def\*('' which then move together around the end of the
712 current line and onto the next as you insert, you have the second type of
713 terminal, and should give the capability \fBin\fR, which stands for
714 \*(``insert null\*(''.
715 .PP
716 While these are two logically separate attributes (one line versus multi-line
717 insert mode, and special treatment of untyped spaces) we have seen no
718 terminals whose insert mode cannot be described with the single attribute.
719 .PP
720 Terminfo can describe both terminals which have an insert mode, and terminals
721 which send a simple sequence to open a blank position on the current line.
722 Give as \fBsmir\fR the sequence to get into insert mode.
723 Give as \fBrmir\fR the sequence to leave insert mode.
724 Now give as \fBich1\fR any sequence needed to be sent just before sending
725 the character to be inserted.
726 Most terminals with a true insert mode
727 will not give \fBich1\fR; terminals which send a sequence to open a screen
728 position should give it here.
729 .PP
730 If your terminal has both, insert mode is usually preferable to \fBich1\fR.
731 Technically, you should not give both unless the terminal actually requires
732 both to be used in combination.
733 Accordingly, some non-curses applications get
734 confused if both are present; the symptom is doubled characters in an update
735 using insert.
736 This requirement is now rare; most \fBich\fR sequences do not
737 require previous smir, and most smir insert modes do not require \fBich1\fR
738 before each character.
739 Therefore, the new \fBcurses\fR actually assumes this
740 is the case and uses either \fBrmir\fR/\fBsmir\fR or \fBich\fR/\fBich1\fR as
741 appropriate (but not both).
742 If you have to write an entry to be used under
743 new curses for a terminal old enough to need both, include the
744 \fBrmir\fR/\fBsmir\fR sequences in \fBich1\fR.
745 .PP
746 If post insert padding is needed, give this as a number of milliseconds
747 in \fBip\fR (a string option).
748 Any other sequence which may need to be
749 sent after an insert of a single character may also be given in \fBip\fR.
750 If your terminal needs both to be placed into an \*(``insert mode\*('' and
751 a special code to precede each inserted character, then both
752 .BR smir / rmir
753 and
754 .B ich1
755 can be given, and both will be used.
756 The
757 .B ich
758 capability, with one parameter,
759 .IR n ,
760 will repeat the effects of
761 .B ich1
762 .I n
763 times.
764 .PP
765 If padding is necessary between characters typed while not
766 in insert mode, give this as a number of milliseconds padding in \fBrmp\fP.
767 .PP
768 It is occasionally necessary to move around while in insert mode
769 to delete characters on the same line (e.g., if there is a tab after
770 the insertion position).
771 If your terminal allows motion while in
772 insert mode you can give the capability \fBmir\fR to speed up inserting
773 in this case.
774 Omitting \fBmir\fR will affect only speed.
775 Some terminals
776 (notably Datamedia's) must not have \fBmir\fR because of the way their
777 insert mode works.
778 .PP
779 Finally, you can specify
780 .B dch1
781 to delete a single character,
782 .B dch
783 with one parameter,
784 .IR n ,
785 to delete
786 .I n characters,
787 and delete mode by giving \fBsmdc\fR and \fBrmdc\fR
788 to enter and exit delete mode (any mode the terminal needs to be placed
789 in for
790 .B dch1
791 to work).
792 .PP
793 A command to erase
794 .I n
795 characters (equivalent to outputting
796 .I n
797 blanks without moving the cursor)
798 can be given as
799 .B ech
800 with one parameter.
801 .PP
802 .SS "Highlighting, Underlining, and Visible Bells"
803 .PP
804 If your terminal has one or more kinds of display attributes,
805 these can be represented in a number of different ways.
806 You should choose one display form as
807 \f2standout mode\fR,
808 representing a good, high contrast, easy-on-the-eyes,
809 format for highlighting error messages and other attention getters.
810 (If you have a choice, reverse video plus half-bright is good,
811 or reverse video alone.)
812 The sequences to enter and exit standout mode
813 are given as \fBsmso\fR and \fBrmso\fR, respectively.
814 If the code to change into or out of standout
815 mode leaves one or even two blank spaces on the screen,
816 as the TVI 912 and Teleray 1061 do,
817 then \fBxmc\fR should be given to tell how many spaces are left.
818 .PP
819 Codes to begin underlining and end underlining can be given as \fBsmul\fR
820 and \fBrmul\fR respectively.
821 If the terminal has a code to underline the current character and move
822 the cursor one space to the right,
823 such as the Microterm Mime,
824 this can be given as \fBuc\fR.
825 .PP
826 Other capabilities to enter various highlighting modes include
827 .B blink
828 (blinking)
829 .B bold
830 (bold or extra bright)
831 .B dim
832 (dim or half-bright)
833 .B invis
834 (blanking or invisible text)
835 .B prot
836 (protected)
837 .B rev
838 (reverse video)
839 .B sgr0
840 (turn off
841 .I all
842 attribute modes)
843 .B smacs
844 (enter alternate character set mode)
845 and
846 .B rmacs
847 (exit alternate character set mode).
848 Turning on any of these modes singly may or may not turn off other modes.
849 .PP
850 If there is a sequence to set arbitrary combinations of modes,
851 this should be given as
852 .B sgr
853 (set attributes),
854 taking 9 parameters.
855 Each parameter is either 0 or nonzero, as the corresponding attribute is on or off.
856 The 9 parameters are, in order:
857 standout, underline, reverse, blink, dim, bold, blank, protect, alternate
858 character set.
859 Not all modes need be supported by
860 .BR sgr ,
861 only those for which corresponding separate attribute commands exist.
862 .PP
863 For example, the DEC vt220 supports most of the modes:
864 .PP
865 .TS
866 center;
867 l l l
868 l l l
869 lw18 lw14 lw18.
870 \fBtparm parameter      attribute       escape sequence\fP
871
872 none    none    \\E[0m
873 p1      standout        \\E[0;1;7m
874 p2      underline       \\E[0;4m
875 p3      reverse \\E[0;7m
876 p4      blink   \\E[0;5m
877 p5      dim     not available
878 p6      bold    \\E[0;1m
879 p7      invis   \\E[0;8m
880 p8      protect not used
881 p9      altcharset      ^O (off) ^N (on)
882 .TE
883 .PP
884 We begin each escape sequence by turning off any existing modes, since
885 there is no quick way to determine whether they are active.
886 Standout is set up to be the combination of reverse and bold.
887 The vt220 terminal has a protect mode,
888 though it is not commonly used in sgr
889 because it protects characters on the screen from the host's erasures.
890 The altcharset mode also is different in that it is either ^O or ^N,
891 depending on whether it is off or on.
892 If all modes are turned on, the resulting sequence is \\E[0;1;4;5;7;8m^N.
893 .PP
894 Some sequences are common to different modes.
895 For example, ;7 is output when either p1 or p3 is true, that is, if
896 either standout or reverse modes are turned on.
897 .PP
898 Writing out the above sequences, along with their dependencies yields
899 .PP
900 .ne 11
901 .TS
902 center;
903 l l l
904 l l l
905 lw18 lw14 lw18.
906 \fBsequence     when to output  terminfo translation\fP
907
908 .ft CW
909 \\E[0   always  \\E[0
910 ;1      if p1 or p6     %?%p1%p6%|%t;1%;
911 ;4      if p2   %?%p2%|%t;4%;
912 ;5      if p4   %?%p4%|%t;5%;
913 ;7      if p1 or p3     %?%p1%p3%|%t;7%;
914 ;8      if p7   %?%p7%|%t;8%;
915 m       always  m
916 ^N or ^O        if p9 ^N, else ^O       %?%p9%t^N%e^O%;
917 .ft R
918 .TE
919 .PP
920 Putting this all together into the sgr sequence gives:
921 .PP
922 .ft CW
923 .nf
924     sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%;
925         %?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;,
926 .fi
927 .ft R
928 .PP
929 Remember that if you specify sgr, you must also specify sgr0.
930 Also, some implementations rely on sgr being given if sgr0 is,
931 Not all terminfo entries necessarily have an sgr string, however.
932 Many terminfo entries are derived from termcap entries
933 which have no sgr string.
934 The only drawback to adding an sgr string is that termcap also
935 assumes that sgr0 does not exit alternate character set mode.
936 .PP
937 Terminals with the \*(``magic cookie\*('' glitch
938 .RB ( xmc )
939 deposit special \*(``cookies\*('' when they receive mode-setting sequences,
940 which affect the display algorithm rather than having extra bits for
941 each character.
942 Some terminals, such as the HP 2621, automatically leave standout
943 mode when they move to a new line or the cursor is addressed.
944 Programs using standout mode should exit standout mode before
945 moving the cursor or sending a newline,
946 unless the
947 .B msgr
948 capability, asserting that it is safe to move in standout mode, is present.
949 .PP
950 If the terminal has
951 a way of flashing the screen to indicate an error quietly (a bell replacement)
952 then this can be given as \fBflash\fR; it must not move the cursor.
953 .PP
954 If the cursor needs to be made more visible than normal when it is
955 not on the bottom line (to make, for example, a non-blinking underline into an
956 easier to find block or blinking underline)
957 give this sequence as
958 .BR cvvis .
959 If there is a way to make the cursor completely invisible, give that as
960 .BR civis .
961 The capability
962 .B cnorm
963 should be given which undoes the effects of both of these modes.
964 .PP
965 If your terminal correctly generates underlined characters
966 (with no special codes needed)
967 even though it does not overstrike,
968 then you should give the capability \fBul\fR.
969 If a character overstriking another leaves both characters on the screen,
970 specify the capability \fBos\fP.
971 If overstrikes are erasable with a blank,
972 then this should be indicated by giving \fBeo\fR.
973 .PP
974 .SS Keypad and Function Keys
975 .PP
976 If the terminal has a keypad that transmits codes when the keys are pressed,
977 this information can be given.
978 Note that it is not possible to handle
979 terminals where the keypad only works in local (this applies, for example,
980 to the unshifted HP 2621 keys).
981 If the keypad can be set to transmit or not transmit,
982 give these codes as \fBsmkx\fR and \fBrmkx\fR.
983 Otherwise the keypad is assumed to always transmit.
984 .PP
985 The codes sent by the left arrow, right arrow, up arrow, down arrow,
986 and home keys can be given as
987 \fBkcub1, kcuf1, kcuu1, kcud1, \fRand\fB khome\fR respectively.
988 If there are function keys such as f0, f1, ..., f10, the codes they send
989 can be given as \fBkf0, kf1, ..., kf10\fR.
990 If these keys have labels other than the default f0 through f10, the labels
991 can be given as \fBlf0, lf1, ..., lf10\fR.
992 .PP
993 The codes transmitted by certain other special keys can be given:
994 .bP
995 .B kll
996 (home down),
997 .bP
998 .B kbs
999 (backspace),
1000 .bP
1001 .B ktbc
1002 (clear all tabs),
1003 .bP
1004 .B kctab
1005 (clear the tab stop in this column),
1006 .bP
1007 .B kclr
1008 (clear screen or erase key),
1009 .bP
1010 .B kdch1
1011 (delete character),
1012 .bP
1013 .B kdl1
1014 (delete line),
1015 .bP
1016 .B krmir
1017 (exit insert mode),
1018 .bP
1019 .B kel
1020 (clear to end of line),
1021 .bP
1022 .B ked
1023 (clear to end of screen),
1024 .bP
1025 .B kich1
1026 (insert character or enter insert mode),
1027 .bP
1028 .B kil1
1029 (insert line),
1030 .bP
1031 .B knp
1032 (next page),
1033 .bP
1034 .B kpp
1035 (previous page),
1036 .bP
1037 .B kind
1038 (scroll forward/down),
1039 .bP
1040 .B kri
1041 (scroll backward/up),
1042 .bP
1043 .B khts
1044 (set a tab stop in this column).
1045 .PP
1046 In addition, if the keypad has a 3 by 3 array of keys including the four
1047 arrow keys, the other five keys can be given as
1048 .BR ka1 ,
1049 .BR ka3 ,
1050 .BR kb2 ,
1051 .BR kc1 ,
1052 and
1053 .BR kc3 .
1054 These keys are useful when the effects of a 3 by 3 directional pad are needed.
1055 .PP
1056 Strings to program function keys can be given as
1057 .BR pfkey ,
1058 .BR pfloc ,
1059 and
1060 .BR pfx .
1061 A string to program screen labels should be specified as \fBpln\fP.
1062 Each of these strings takes two parameters: the function key number to
1063 program (from 0 to 10) and the string to program it with.
1064 Function key numbers out of this range may program undefined keys in
1065 a terminal dependent manner.
1066 The difference between the capabilities is that
1067 .B pfkey
1068 causes pressing the given key to be the same as the user typing the
1069 given string;
1070 .B pfloc
1071 causes the string to be executed by the terminal in local; and
1072 .B pfx
1073 causes the string to be transmitted to the computer.
1074 .PP
1075 The capabilities \fBnlab\fP, \fBlw\fP and \fBlh\fP
1076 define the number of programmable
1077 screen labels and their width and height.
1078 If there are commands to turn the labels on and off,
1079 give them in \fBsmln\fP and \fBrmln\fP.
1080 \fBsmln\fP is normally output after one or more pln
1081 sequences to make sure that the change becomes visible.
1082 .PP
1083 .SS Tabs and Initialization
1084 .PP
1085 A few capabilities are used only for tabs:
1086 .bP
1087 If the terminal has hardware tabs, the command to advance to the next
1088 tab stop can be given as
1089 .B ht
1090 (usually control/I).
1091 .bP
1092 A \*(``back-tab\*('' command which moves leftward to the preceding tab stop can
1093 be given as
1094 .BR cbt .
1095 .IP
1096 By convention, if the teletype modes indicate that tabs are being
1097 expanded by the computer rather than being sent to the terminal,
1098 programs should not use
1099 .B ht
1100 or
1101 .B cbt
1102 even if they are present, since the user may not have the tab stops
1103 properly set.
1104 .bP
1105 If the terminal has hardware tabs which are initially set every
1106 .I n
1107 spaces when the terminal is powered up,
1108 the numeric parameter
1109 .B it
1110 is given, showing the number of spaces the tabs are set to.
1111 .IP
1112 The \fBit\fP capability is normally used by the \fB@TSET@\fP
1113 command to determine whether to set the mode for hardware tab expansion,
1114 and whether to set the tab stops.
1115 If the terminal has tab stops that can be saved in non-volatile memory,
1116 the terminfo description can assume that they are properly set.
1117 .PP
1118 Other capabilities
1119 include
1120 .bP
1121 .BR is1 ,
1122 .BR is2 ,
1123 and
1124 .BR is3 ,
1125 initialization strings for the terminal,
1126 .bP
1127 .BR iprog ,
1128 the path name of a program to be run to initialize the terminal,
1129 .bP
1130 and \fBif\fR, the name of a file containing long initialization strings.
1131 .PP
1132 These strings are expected to set the terminal into modes consistent
1133 with the rest of the terminfo description.
1134 They are normally sent to the terminal, by the
1135 .I init
1136 option of the \fB@TPUT@\fP program, each time the user logs in.
1137 They will be printed in the following order:
1138 .RS
1139 .TP
1140 run the program
1141 .B iprog
1142 .TP
1143 output
1144 .B is1
1145 .B is2
1146 .TP
1147 set the margins using
1148 .BR mgc ,
1149 .B smgl
1150 and
1151 .B smgr
1152 .TP
1153 set tabs using
1154 .B tbc
1155 and
1156 .B hts
1157 .TP
1158 print the file
1159 .B if
1160 .TP
1161 and finally
1162 output
1163 .BR is3 .
1164 .RE
1165 .PP
1166 Most initialization is done with
1167 .BR is2 .
1168 Special terminal modes can be set up without duplicating strings
1169 by putting the common sequences in
1170 .B is2
1171 and special cases in
1172 .B is1
1173 and
1174 .BR is3 .
1175 .PP
1176 A set of sequences that does a harder reset from a totally unknown state
1177 can be given as
1178 .BR rs1 ,
1179 .BR rs2 ,
1180 .B rf
1181 and
1182 .BR rs3 ,
1183 analogous to
1184 .B is1 ,
1185 .B is2 ,
1186 .B if
1187 and
1188 .B is3
1189 respectively.
1190 These strings are output by the \fB@RESET@\fP program
1191 (an alias of \fB@TSET@\fP),
1192 which is used when the terminal gets into a wedged state.
1193 Commands are normally placed in
1194 .BR rs1 ,
1195 .B rs2
1196 .B rs3
1197 and
1198 .B rf
1199 only if they produce annoying effects on the screen and are not
1200 necessary when logging in.
1201 For example, the command to set the vt100 into 80-column mode would
1202 normally be part of
1203 .BR is2 ,
1204 but it causes an annoying glitch of the screen and is not normally
1205 needed since the terminal is usually already in 80 column mode.
1206 .PP
1207 The \fB@RESET@\fP program writes strings including
1208 .BR iprog ,
1209 etc., in the same order as the
1210 .I init
1211 program, using 
1212 .BR rs1 ,
1213 etc., instead of
1214 .BR is1 ,
1215 etc.
1216 If any of
1217 .BR rs1 ,
1218 .BR rs2 ,
1219 .BR rs3 ,
1220 or
1221 .B rf
1222 reset capability strings are missing,
1223 the \fB@RESET@\fP program
1224 falls back upon the corresponding initialization capability string.
1225 .PP
1226 If there are commands to set and clear tab stops, they can be given as
1227 .B tbc
1228 (clear all tab stops)
1229 and
1230 .B hts
1231 (set a tab stop in the current column of every row).
1232 If a more complex sequence is needed to set the tabs than can be
1233 described by this, the sequence can be placed in
1234 .B is2
1235 or
1236 .BR if .
1237 .PP
1238 The \fB@TPUT@ reset\fP command uses the same capability strings
1239 as the \fB@RESET@\fP command,
1240 although the two programs (\fB@TPUT@\fP and \fB@RESET@\fP)
1241 provide different command-line options.
1242 .PP
1243 In practice, these terminfo capabilities are not often used in
1244 initialization of tabs
1245 (though they are required for the \fB@TABS@\fP program):
1246 .bP
1247 Almost all hardware terminals (at least those which supported tabs)
1248 initialized those to every \fIeight\fP columns:
1249 .IP
1250 The only exception was the AT&T 2300 series,
1251 which set tabs to every \fIfive\fP columns.
1252 .bP
1253 In particular, developers of the hardware terminals which are commonly used
1254 as models for modern terminal emulators provided documentation demonstrating
1255 that \fIeight\fP columns were the standard.
1256 .bP
1257 Because of this, the terminal initialization programs
1258 \fB@TPUT@\fP and \fB@TSET@\fP
1259 use the
1260 \fBtbc\fP (\fBclear_all_tabs\fP) and
1261 \fBhts\fP (\fBset_tab\fP) capabilities directly
1262 only when the \fBit\fP (\fBinit_tabs\fP) capability
1263 is set to a value other than \fIeight\fP.
1264 .SS Delays and Padding
1265 .PP
1266 Many older and slower terminals do not support either XON/XOFF or DTR
1267 handshaking, including hard copy terminals and some very archaic CRTs
1268 (including, for example, DEC VT100s).
1269 These may require padding characters
1270 after certain cursor motions and screen changes.
1271 .PP
1272 If the terminal uses xon/xoff handshaking for flow control (that is,
1273 it automatically emits ^S back to the host when its input buffers are
1274 close to full), set
1275 .BR xon .
1276 This capability suppresses the emission of padding.
1277 You can also set it
1278 for memory-mapped console devices effectively that do not have a speed limit.
1279 Padding information should still be included so that routines can
1280 make better decisions about relative costs, but actual pad characters will
1281 not be transmitted.
1282 .PP
1283 If \fBpb\fR (padding baud rate) is given, padding is suppressed at baud rates
1284 below the value of \fBpb\fR.
1285 If the entry has no padding baud rate, then
1286 whether padding is emitted or not is completely controlled by \fBxon\fR.
1287 .PP
1288 If the terminal requires other than a null (zero) character as a pad,
1289 then this can be given as \fBpad\fR.
1290 Only the first character of the
1291 .B pad
1292 string is used.
1293 .PP
1294 .SS Status Lines
1295 Some terminals have an extra \*(``status line\*('' which is not normally used by
1296 software (and thus not counted in the terminal's \fBlines\fR capability).
1297 .PP
1298 The simplest case is a status line which is cursor-addressable but not
1299 part of the main scrolling region on the screen; the Heathkit H19 has
1300 a status line of this kind, as would a 24-line VT100 with a 23-line
1301 scrolling region set up on initialization.
1302 This situation is indicated
1303 by the \fBhs\fR capability.
1304 .PP
1305 Some terminals with status lines need special sequences to access the
1306 status line.
1307 These may be expressed as a string with single parameter
1308 \fBtsl\fR which takes the cursor to a given zero-origin column on the
1309 status line.
1310 The capability \fBfsl\fR must return to the main-screen
1311 cursor positions before the last \fBtsl\fR.
1312 You may need to embed the
1313 string values of \fBsc\fR (save cursor) and \fBrc\fR (restore cursor)
1314 in \fBtsl\fR and \fBfsl\fR to accomplish this.
1315 .PP
1316 The status line is normally assumed to be the same width as the width
1317 of the terminal.
1318 If this is untrue, you can specify it with the numeric
1319 capability \fBwsl\fR.
1320 .PP
1321 A command to erase or blank the status line may be specified as \fBdsl\fR.
1322 .PP
1323 The boolean capability \fBeslok\fR specifies that escape sequences, tabs,
1324 etc., work ordinarily in the status line.
1325 .PP
1326 The \fBncurses\fR implementation does not yet use any of these capabilities.
1327 They are documented here in case they ever become important.
1328 .PP
1329 .SS Line Graphics
1330 .PP
1331 Many terminals have alternate character sets useful for forms-drawing.
1332 Terminfo and \fBcurses\fR have built-in support
1333 for most of the drawing characters
1334 supported by the VT100, with some characters from the AT&T 4410v1 added.
1335 This alternate character set may be specified by the \fBacsc\fR capability.
1336 .PP
1337 .TS H
1338 center expand;
1339 l l l l l
1340 l l l l l
1341 _ _ _ _ _
1342 lw25 lw10 lw6 lw6 lw6.
1343 .\".TH
1344 \fBGlyph        ACS     Ascii   acsc    acsc\fR
1345 \fBName Name    Default Char    Value\fR
1346 arrow pointing right    ACS_RARROW      >       +       0x2b
1347 arrow pointing left     ACS_LARROW      <       ,       0x2c
1348 arrow pointing up       ACS_UARROW      ^       \-      0x2d
1349 arrow pointing down     ACS_DARROW      v       .       0x2e
1350 solid square block      ACS_BLOCK       #       0       0x30
1351 diamond                 ACS_DIAMOND     +       `       0x60
1352 checker board (stipple) ACS_CKBOARD     :       a       0x61
1353 degree symbol           ACS_DEGREE      \e      f       0x66
1354 plus/minus              ACS_PLMINUS     #       g       0x67
1355 board of squares        ACS_BOARD       #       h       0x68
1356 lantern symbol          ACS_LANTERN     #       i       0x69
1357 lower right corner      ACS_LRCORNER    +       j       0x6a
1358 upper right corner      ACS_URCORNER    +       k       0x6b
1359 upper left corner       ACS_ULCORNER    +       l       0x6c
1360 lower left corner       ACS_LLCORNER    +       m       0x6d
1361 large plus or crossover ACS_PLUS        +       n       0x6e
1362 scan line 1             ACS_S1          ~       o       0x6f
1363 scan line 3             ACS_S3          \-      p       0x70
1364 horizontal line         ACS_HLINE       \-      q       0x71
1365 scan line 7             ACS_S7          \-      r       0x72
1366 scan line 9             ACS_S9          \&_     s       0x73
1367 tee pointing right      ACS_LTEE        +       t       0x74
1368 tee pointing left       ACS_RTEE        +       u       0x75
1369 tee pointing up         ACS_BTEE        +       v       0x76
1370 tee pointing down       ACS_TTEE        +       w       0x77
1371 vertical line           ACS_VLINE       |       x       0x78
1372 less-than-or-equal-to   ACS_LEQUAL      <       y       0x79
1373 greater-than-or-equal-to        ACS_GEQUAL      >       z       0x7a
1374 greek pi                ACS_PI  *       {       0x7b
1375 not-equal               ACS_NEQUAL      !       |       0x7c
1376 UK pound sign           ACS_STERLING    f       }       0x7d
1377 bullet                  ACS_BULLET      o       ~       0x7e
1378 .TE
1379 .PP
1380 A few notes apply to the table itself:
1381 .bP
1382 X/Open Curses incorrectly states that the mapping for \fIlantern\fP is
1383 uppercase \*(``I\*('' although Unix implementations use the
1384 lowercase \*(``i\*('' mapping.
1385 .bP
1386 The DEC VT100 implemented graphics using the alternate character set
1387 feature, temporarily switching \fImodes\fP and sending characters
1388 in the range 0x60 (96) to 0x7e (126)
1389 (the \fBacsc Value\fP column in the table).
1390 .bP
1391 The AT&T terminal added graphics characters outside that range.
1392 .IP
1393 Some of the characters within the range do not match the VT100;
1394 presumably they were used in the AT&T terminal:
1395 \fIboard of squares\fP replaces the VT100 \fInewline\fP symbol, while
1396 \fIlantern symbol\fP replaces the VT100 \fIvertical tab\fP symbol.
1397 The other VT100 symbols for control characters (\fIhorizontal tab\fP,
1398 \fIcarriage return\fP and \fIline-feed\fP) are not (re)used in curses.
1399 .PP
1400 The best way to define a new device's graphics set is to add a column
1401 to a copy of this table for your terminal, giving the character which
1402 (when emitted between \fBsmacs\fR/\fBrmacs\fR switches) will be rendered
1403 as the corresponding graphic.
1404 Then read off the VT100/your terminal
1405 character pairs right to left in sequence; these become the ACSC string.
1406 .PP
1407 .SS Color Handling
1408 .PP
1409 The curses library functions \fBinit_pair\fP and \fBinit_color\fP
1410 manipulate the \fIcolor pairs\fP and \fIcolor values\fP discussed in this
1411 section
1412 (see \fBcurs_color\fP(3X) for details on these and related functions).
1413 .PP
1414 Most color terminals are either \*(``Tektronix-like\*('' or \*(``HP-like\*('':
1415 .bP
1416 Tektronix-like
1417 terminals have a predefined set of \fIN\fP colors
1418 (where \fIN\fP is usually 8),
1419 and can set
1420 character-cell foreground and background characters independently, mixing them
1421 into \fIN\fP\ *\ \fIN\fP color-pairs.
1422 .bP
1423 On HP-like terminals, the user must set each color
1424 pair up separately (foreground and background are not independently settable).
1425 Up to \fIM\fP color-pairs may be set up from 2*\fIM\fP different colors.
1426 ANSI-compatible terminals are Tektronix-like.
1427 .PP
1428 Some basic color capabilities are independent of the color method.
1429 The numeric
1430 capabilities \fBcolors\fR and \fBpairs\fR specify the maximum numbers of colors
1431 and color-pairs that can be displayed simultaneously.
1432 The \fBop\fR (original
1433 pair) string resets foreground and background colors to their default values
1434 for the terminal.
1435 The \fBoc\fR string resets all colors or color-pairs to
1436 their default values for the terminal.
1437 Some terminals (including many PC
1438 terminal emulators) erase screen areas with the current background color rather
1439 than the power-up default background; these should have the boolean capability
1440 \fBbce\fR.
1441 .PP
1442 While the curses library works with \fIcolor pairs\fP
1443 (reflecting the inability of some devices to set foreground
1444 and background colors independently),
1445 there are separate capabilities for setting these features:
1446 .bP
1447 To change the current foreground or background color on a Tektronix-type
1448 terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI
1449 background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background).
1450 These take one parameter, the color number.
1451 The SVr4 documentation describes
1452 only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal
1453 supports ANSI escape sequences to set background and foreground, they should
1454 be coded as \fBsetaf\fR and \fBsetab\fR, respectively.
1455 .bP
1456 If the terminal
1457 supports other escape sequences to set background and foreground, they should
1458 be coded as \fBsetf\fR and \fBsetb\fR, respectively.
1459 The \fBvidputs\fR and the \fBrefresh\fP(3X) functions
1460 use the \fBsetaf\fR and \fBsetab\fR capabilities if they are defined.
1461 .PP
1462 The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a
1463 single numeric argument each.
1464 Argument values 0-7 of \fBsetaf\fR/\fBsetab\fR are portably defined as
1465 follows (the middle column is the symbolic #define available in the header for
1466 the \fBcurses\fR or \fBncurses\fR libraries).
1467 The terminal hardware is free to
1468 map these as it likes, but the RGB values indicate normal locations in color
1469 space.
1470 .PP
1471 .TS H
1472 center;
1473 l c c c
1474 l l n l.
1475 \fBColor        #define         Value   RGB\fR
1476 black   \fBCOLOR_BLACK\fR       0       0, 0, 0
1477 red     \fBCOLOR_RED\ \fR       1       max,0,0
1478 green   \fBCOLOR_GREEN\fR       2       0,max,0
1479 yellow  \fBCOLOR_YELLOW\fR      3       max,max,0
1480 blue    \fBCOLOR_BLUE\fR        4       0,0,max
1481 magenta \fBCOLOR_MAGENTA\fR     5       max,0,max
1482 cyan    \fBCOLOR_CYAN\fR        6       0,max,max
1483 white   \fBCOLOR_WHITE\fR       7       max,max,max
1484 .TE
1485 .PP
1486 The argument values of \fBsetf\fR/\fBsetb\fR historically correspond to
1487 a different mapping, i.e.,
1488 .TS H
1489 center;
1490 l c c c
1491 l l n l.
1492 \fBColor        #define         Value   RGB\fR
1493 black   \fBCOLOR_BLACK\fR       0       0, 0, 0
1494 blue    \fBCOLOR_BLUE\fR        1       0,0,max
1495 green   \fBCOLOR_GREEN\fR       2       0,max,0
1496 cyan    \fBCOLOR_CYAN\fR        3       0,max,max
1497 red     \fBCOLOR_RED\ \fR       4       max,0,0
1498 magenta \fBCOLOR_MAGENTA\fR     5       max,0,max
1499 yellow  \fBCOLOR_YELLOW\fR      6       max,max,0
1500 white   \fBCOLOR_WHITE\fR       7       max,max,max
1501 .TE
1502 .PP
1503 It is important to not confuse the two sets of color capabilities;
1504 otherwise red/blue will be interchanged on the display.
1505 .PP
1506 On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set
1507 which color pair is current.
1508 .PP
1509 Some terminals allow the \fIcolor values\fP to be modified:
1510 .bP
1511 On a Tektronix-like terminal, the capability \fBccc\fR may be present to
1512 indicate that colors can be modified.
1513 If so, the \fBinitc\fR capability will
1514 take a color number (0 to \fBcolors\fR \- 1)and three more parameters which
1515 describe the color.
1516 These three parameters default to being interpreted as RGB
1517 (Red, Green, Blue) values.
1518 If the boolean capability \fBhls\fR is present,
1519 they are instead as HLS (Hue, Lightness, Saturation) indices.
1520 The ranges are
1521 terminal-dependent.
1522 .bP
1523 On an HP-like terminal, \fBinitp\fR may give a capability for changing a
1524 color-pair value.
1525 It will take seven parameters; a color-pair number (0 to
1526 \fBmax_pairs\fR \- 1), and two triples describing first background and then
1527 foreground colors.
1528 These parameters must be (Red, Green, Blue) or
1529 (Hue, Lightness, Saturation) depending on \fBhls\fR.
1530 .PP
1531 On some color terminals, colors collide with highlights.
1532 You can register
1533 these collisions with the \fBncv\fR capability.
1534 This is a bit-mask of
1535 attributes not to be used when colors are enabled.
1536 The correspondence with the
1537 attributes understood by \fBcurses\fR is as follows:
1538 .PP
1539 .TS
1540 center;
1541 l l l l
1542 lw20 lw2 lw10 lw10.
1543 \fBAttribute    Bit     Decimal Set by\fR
1544 A_STANDOUT      0       1       sgr
1545 A_UNDERLINE     1       2       sgr
1546 A_REVERSE       2       4       sgr
1547 A_BLINK         3       8       sgr
1548 A_DIM           4       16      sgr
1549 A_BOLD          5       32      sgr
1550 A_INVIS         6       64      sgr
1551 A_PROTECT       7       128     sgr
1552 A_ALTCHARSET    8       256     sgr
1553 A_HORIZONTAL    9       512     sgr1
1554 A_LEFT  10      1024    sgr1
1555 A_LOW   11      2048    sgr1
1556 A_RIGHT 12      4096    sgr1
1557 A_TOP   13      8192    sgr1
1558 A_VERTICAL      14      16384   sgr1
1559 A_ITALIC        15      32768   sitm
1560 .TE
1561 .PP
1562 For example, on many IBM PC consoles, the underline attribute collides with the
1563 foreground color blue and is not available in color mode.
1564 These should have
1565 an \fBncv\fR capability of 2.
1566 .PP
1567 SVr4 curses does nothing with \fBncv\fR, ncurses recognizes it and optimizes
1568 the output in favor of colors.
1569 .PP
1570 .SS Miscellaneous
1571 If the terminal requires other than a null (zero) character as a pad, then this
1572 can be given as pad.
1573 Only the first character of the pad string is used.
1574 If the terminal does not have a pad character, specify npc.
1575 Note that ncurses implements the termcap-compatible \fBPC\fR variable;
1576 though the application may set this value to something other than
1577 a null, ncurses will test \fBnpc\fR first and use napms if the terminal
1578 has no pad character.
1579 .PP
1580 If the terminal can move up or down half a line,
1581 this can be indicated with
1582 .B hu
1583 (half-line up)
1584 and
1585 .B hd
1586 (half-line down).
1587 This is primarily useful for superscripts and subscripts on hard-copy terminals.
1588 If a hard-copy terminal can eject to the next page (form feed), give this as
1589 .B ff
1590 (usually control/L).
1591 .PP
1592 If there is a command to repeat a given character a given number of
1593 times (to save time transmitting a large number of identical characters)
1594 this can be indicated with the parameterized string
1595 .BR rep .
1596 The first parameter is the character to be repeated and the second
1597 is the number of times to repeat it.
1598 Thus, tparm(repeat_char, 'x', 10) is the same as \*(``xxxxxxxxxx\*(''.
1599 .PP
1600 If the terminal has a settable command character, such as the \s-1TEKTRONIX\s+1 4025,
1601 this can be indicated with
1602 .BR cmdch .
1603 A prototype command character is chosen which is used in all capabilities.
1604 This character is given in the
1605 .B cmdch
1606 capability to identify it.
1607 The following convention is supported on some UNIX systems:
1608 The environment is to be searched for a
1609 .B CC
1610 variable, and if found, all
1611 occurrences of the prototype character are replaced with the character
1612 in the environment variable.
1613 .PP
1614 Terminal descriptions that do not represent a specific kind of known
1615 terminal, such as
1616 .IR switch ,
1617 .IR dialup ,
1618 .IR patch ,
1619 and
1620 .IR network ,
1621 should include the
1622 .B gn
1623 (generic) capability so that programs can complain that they do not know
1624 how to talk to the terminal.
1625 (This capability does not apply to
1626 .I virtual
1627 terminal descriptions for which the escape sequences are known.)
1628 .PP
1629 If the terminal has a \*(``meta key\*('' which acts as a shift key,
1630 setting the 8th bit of any character transmitted, this fact can
1631 be indicated with
1632 .BR km .
1633 Otherwise, software will assume that the 8th bit is parity and it
1634 will usually be cleared.
1635 If strings exist to turn this \*(``meta mode\*('' on and off, they
1636 can be given as
1637 .B smm
1638 and
1639 .BR rmm .
1640 .PP
1641 If the terminal has more lines of memory than will fit on the screen
1642 at once, the number of lines of memory can be indicated with
1643 .BR lm .
1644 A value of
1645 .BR lm #0
1646 indicates that the number of lines is not fixed,
1647 but that there is still more memory than fits on the screen.
1648 .PP
1649 If the terminal is one of those supported by the \s-1UNIX\s+1 virtual
1650 terminal protocol, the terminal number can be given as
1651 .BR vt .
1652 .PP
1653 Media copy
1654 strings which control an auxiliary printer connected to the terminal
1655 can be given as
1656 .BR mc0 :
1657 print the contents of the screen,
1658 .BR mc4 :
1659 turn off the printer, and
1660 .BR mc5 :
1661 turn on the printer.
1662 When the printer is on, all text sent to the terminal will be sent
1663 to the printer.
1664 It is undefined whether the text is also displayed on the terminal screen
1665 when the printer is on.
1666 A variation
1667 .B mc5p
1668 takes one parameter, and leaves the printer on for as many characters
1669 as the value of the parameter, then turns the printer off.
1670 The parameter should not exceed 255.
1671 All text, including
1672 .BR mc4 ,
1673 is transparently passed to the printer while an
1674 .B mc5p
1675 is in effect.
1676 .PP
1677 .SS Glitches and Braindamage
1678 .PP
1679 Hazeltine terminals, which do not allow \*(``~\*('' characters to be displayed should
1680 indicate \fBhz\fR.
1681 .PP
1682 Terminals which ignore a line-feed immediately after an \fBam\fR wrap,
1683 such as the Concept and vt100,
1684 should indicate \fBxenl\fR.
1685 .PP
1686 If
1687 .B el
1688 is required to get rid of standout
1689 (instead of merely writing normal text on top of it),
1690 \fBxhp\fP should be given.
1691 .PP
1692 Teleray terminals, where tabs turn all characters moved over to blanks,
1693 should indicate \fBxt\fR (destructive tabs).
1694 Note: the variable indicating this is now \*(``dest_tabs_magic_smso\*(''; in
1695 older versions, it was teleray_glitch.
1696 This glitch is also taken to mean that it is not possible to position
1697 the cursor on top of a \*(``magic cookie\*('',
1698 that to erase standout mode it is instead necessary to use
1699 delete and insert line.
1700 The ncurses implementation ignores this glitch.
1701 .PP
1702 The Beehive Superbee, which is unable to correctly transmit the escape
1703 or control/C characters, has
1704 .BR xsb ,
1705 indicating that the f1 key is used for escape and f2 for control/C.
1706 (Only certain Superbees have this problem, depending on the ROM.)
1707 Note that in older terminfo versions, this capability was called
1708 \*(``beehive_glitch\*(''; it is now \*(``no_esc_ctl_c\*(''.
1709 .PP
1710 Other specific terminal problems may be corrected by adding more
1711 capabilities of the form \fBx\fR\fIx\fR.
1712 .PP
1713 .SS Pitfalls of Long Entries
1714 .PP
1715 Long terminfo entries are unlikely to be a problem; to date, no entry has even
1716 approached terminfo's 4096-byte string-table maximum.
1717 Unfortunately, the termcap
1718 translations are much more strictly limited (to 1023 bytes), thus termcap translations
1719 of long terminfo entries can cause problems.
1720 .PP
1721 The man pages for 4.3BSD and older versions of \fBtgetent\fP instruct the user to
1722 allocate a 1024-byte buffer for the termcap entry.
1723 The entry gets null-terminated by
1724 the termcap library, so that makes the maximum safe length for a termcap entry
1725 1k\-1 (1023) bytes.
1726 Depending on what the application and the termcap library
1727 being used does, and where in the termcap file the terminal type that \fBtgetent\fP
1728 is searching for is, several bad things can happen.
1729 .PP
1730 Some termcap libraries print a warning message or exit if they find an
1731 entry that's longer than 1023 bytes; others do not; others truncate the
1732 entries to 1023 bytes.
1733 Some application programs allocate more than
1734 the recommended 1K for the termcap entry; others do not.
1735 .PP
1736 Each termcap entry has two important sizes associated with it: before
1737 "tc" expansion, and after "tc" expansion.
1738 "tc" is the capability that
1739 tacks on another termcap entry to the end of the current one, to add
1740 on its capabilities.
1741 If a termcap entry does not use the "tc"
1742 capability, then of course the two lengths are the same.
1743 .PP
1744 The "before tc expansion" length is the most important one, because it
1745 affects more than just users of that particular terminal.
1746 This is the
1747 length of the entry as it exists in /etc/termcap, minus the
1748 backslash-newline pairs, which \fBtgetent\fP strips out while reading it.
1749 Some termcap libraries strip off the final newline, too (GNU termcap does not).
1750 Now suppose:
1751 .bP
1752 a termcap entry before expansion is more than 1023 bytes long,
1753 .bP
1754 and the application has only allocated a 1k buffer,
1755 .bP
1756 and the termcap library (like the one in BSD/OS 1.1 and GNU) reads
1757 the whole entry into the buffer, no matter what its length, to see
1758 if it is the entry it wants,
1759 .bP
1760 and \fBtgetent\fP is searching for a terminal type that either is the
1761 long entry, appears in the termcap file after the long entry, or
1762 does not appear in the file at all (so that \fBtgetent\fP has to search
1763 the whole termcap file).
1764 .PP
1765 Then \fBtgetent\fP will overwrite memory, perhaps its stack, and probably core dump
1766 the program.
1767 Programs like telnet are particularly vulnerable; modern telnets
1768 pass along values like the terminal type automatically.
1769 The results are almost
1770 as undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, that
1771 prints warning messages when it reads an overly long termcap entry.
1772 If a
1773 termcap library truncates long entries, like OSF/1 3.0, it is immune to dying
1774 here but will return incorrect data for the terminal.
1775 .PP
1776 The "after tc expansion" length will have a similar effect to the
1777 above, but only for people who actually set TERM to that terminal
1778 type, since \fBtgetent\fP only does "tc" expansion once it is found the
1779 terminal type it was looking for, not while searching.
1780 .PP
1781 In summary, a termcap entry that is longer than 1023 bytes can cause,
1782 on various combinations of termcap libraries and applications, a core
1783 dump, warnings, or incorrect operation.
1784 If it is too long even before
1785 "tc" expansion, it will have this effect even for users of some other
1786 terminal types and users whose TERM variable does not have a termcap
1787 entry.
1788 .PP
1789 When in \-C (translate to termcap) mode, the \fBncurses\fR implementation of
1790 \fB@TIC@\fR(1M) issues warning messages when the pre-tc length of a termcap
1791 translation is too long.
1792 The \-c (check) option also checks resolved (after tc
1793 expansion) lengths.
1794 .SS Binary Compatibility
1795 It is not wise to count on portability of binary terminfo entries between
1796 commercial UNIX versions.
1797 The problem is that there are at least two versions
1798 of terminfo (under HP\-UX and AIX) which diverged from System V terminfo after
1799 SVr1, and have added extension capabilities to the string table that (in the
1800 binary format) collide with System V and XSI Curses extensions.
1801 .SH EXTENSIONS
1802 .PP
1803 Searching for terminal descriptions in
1804 \fB$HOME/.terminfo\fR and TERMINFO_DIRS 
1805 is not supported by older implementations.
1806 .PP
1807 Some SVr4 \fBcurses\fR implementations, and all previous to SVr4, do not
1808 interpret the %A and %O operators in parameter strings.
1809 .PP
1810 SVr4/XPG4 do not specify whether \fBmsgr\fR licenses movement while in
1811 an alternate-character-set mode (such modes may, among other things, map
1812 CR and NL to characters that do not trigger local motions).
1813 The \fBncurses\fR implementation ignores \fBmsgr\fR in \fBALTCHARSET\fR
1814 mode.
1815 This raises the possibility that an XPG4
1816 implementation making the opposite interpretation may need terminfo
1817 entries made for \fBncurses\fR to have \fBmsgr\fR turned off.
1818 .PP
1819 The \fBncurses\fR library handles insert-character and insert-character modes
1820 in a slightly non-standard way to get better update efficiency.
1821 See
1822 the \fBInsert/Delete Character\fR subsection above.
1823 .PP
1824 The parameter substitutions for \fBset_clock\fR and \fBdisplay_clock\fR are
1825 not documented in SVr4 or the XSI Curses standard.
1826 They are deduced from the
1827 documentation for the AT&T 505 terminal.
1828 .PP
1829 Be careful assigning the \fBkmous\fR capability.
1830 The \fBncurses\fR library wants to interpret it as \fBKEY_MOUSE\fR,
1831 for use by terminals and emulators like xterm
1832 that can return mouse-tracking information in the keyboard-input stream.
1833 .PP
1834 X/Open Curses does not mention italics.
1835 Portable applications must assume that numeric capabilities are
1836 signed 16-bit values.
1837 This includes the \fIno_color_video\fP (ncv) capability.
1838 The 32768 mask value used for italics with ncv can be confused with
1839 an absent or cancelled ncv.
1840 If italics should work with colors,
1841 then the ncv value must be specified, even if it is zero.
1842 .PP
1843 Different commercial ports of terminfo and curses support different subsets of
1844 the XSI Curses standard and (in some cases) different extension sets.
1845 Here
1846 is a summary, accurate as of October 1995:
1847 .bP
1848 \fBSVR4, Solaris, ncurses\fR \-\-
1849 These support all SVr4 capabilities.
1850 .bP
1851 \fBSGI\fR \-\-
1852 Supports the SVr4 set, adds one undocumented extended string
1853 capability (\fBset_pglen\fR).
1854 .bP
1855 \fBSVr1, Ultrix\fR \-\-
1856 These support a restricted subset of terminfo capabilities.
1857 The booleans end with \fBxon_xoff\fR;
1858 the numerics with \fBwidth_status_line\fR;
1859 and the strings with \fBprtr_non\fR.
1860 .bP
1861 \fBHP/UX\fR \-\-
1862 Supports the SVr1 subset, plus the SVr[234] numerics \fBnum_labels\fR,
1863 \fBlabel_height\fR, \fBlabel_width\fR, plus function keys 11 through 63, plus
1864 \fBplab_norm\fR, \fBlabel_on\fR, and \fBlabel_off\fR, plus some incompatible
1865 extensions in the string table.
1866 .bP
1867 \fBAIX\fR \-\-
1868 Supports the SVr1 subset, plus function keys 11 through 63, plus a number
1869 of incompatible string table extensions.
1870 .bP
1871 \fBOSF\fR \-\-
1872 Supports both the SVr4 set and the AIX extensions.
1873 .SH FILES
1874 .TP 25
1875 \*d/?/*
1876 files containing terminal descriptions
1877 .SH SEE ALSO
1878 \fB@TABS@\fR(1M),
1879 \fB@TIC@\fR(1M),
1880 \fB@INFOCMP@\fR(1M),
1881 \fBcurses\fR(3X),
1882 \fBcurs_color\fR(3X),
1883 \fBcurs_variables\fR(3X),
1884 \fBprintf\fR(3),
1885 \fBterm\fR(\*n).
1886 \fBterm_variables\fR(3X).
1887 \fBuser_caps\fR(5).
1888 .SH AUTHORS
1889 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
1890 Based on pcurses by Pavel Curtis.