]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/terminfo.tail
ncurses 6.1 - patch 20190713
[ncurses.git] / man / terminfo.tail
1 .\" $Id: terminfo.tail,v 1.95 2019/07/13 23:29:04 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 .br
1145 \fBis1\fP and
1146 .br
1147 \fBis2\fP
1148 .TP
1149 set the margins using
1150 \fBmgc\fP or
1151 .br
1152 \fBsmglp\fP and \fBsmgrp\fP or
1153 .br
1154 \fBsmgl\fP and \fBsmgr\fP
1155 .TP
1156 set tabs using
1157 .B tbc
1158 and
1159 .B hts
1160 .TP
1161 print the file
1162 \fBif\fP
1163 .TP
1164 and finally output
1165 \fBis3\fP.
1166 .RE
1167 .PP
1168 Most initialization is done with
1169 .BR is2 .
1170 Special terminal modes can be set up without duplicating strings
1171 by putting the common sequences in
1172 .B is2
1173 and special cases in
1174 .B is1
1175 and
1176 .BR is3 .
1177 .PP
1178 A set of sequences that does a harder reset from a totally unknown state
1179 can be given as
1180 .BR rs1 ,
1181 .BR rs2 ,
1182 .B rf
1183 and
1184 .BR rs3 ,
1185 analogous to
1186 .B is1 ,
1187 .B is2 ,
1188 .B if
1189 and
1190 .B is3
1191 respectively.
1192 These strings are output
1193 by \fIreset\fP option of \fB@TPUT@\fP,
1194 or by the \fB@RESET@\fP program
1195 (an alias of \fB@TSET@\fP),
1196 which is used when the terminal gets into a wedged state.
1197 Commands are normally placed in
1198 .BR rs1 ,
1199 .B rs2
1200 .B rs3
1201 and
1202 .B rf
1203 only if they produce annoying effects on the screen and are not
1204 necessary when logging in.
1205 For example, the command to set the vt100 into 80-column mode would
1206 normally be part of
1207 .BR is2 ,
1208 but it causes an annoying glitch of the screen and is not normally
1209 needed since the terminal is usually already in 80-column mode.
1210 .PP
1211 The \fB@RESET@\fP program writes strings including
1212 .BR iprog ,
1213 etc., in the same order as the
1214 .I init
1215 program, using 
1216 .BR rs1 ,
1217 etc., instead of
1218 .BR is1 ,
1219 etc.
1220 If any of
1221 .BR rs1 ,
1222 .BR rs2 ,
1223 .BR rs3 ,
1224 or
1225 .B rf
1226 reset capability strings are missing,
1227 the \fB@RESET@\fP program
1228 falls back upon the corresponding initialization capability string.
1229 .PP
1230 If there are commands to set and clear tab stops, they can be given as
1231 .B tbc
1232 (clear all tab stops)
1233 and
1234 .B hts
1235 (set a tab stop in the current column of every row).
1236 If a more complex sequence is needed to set the tabs than can be
1237 described by this, the sequence can be placed in
1238 .B is2
1239 or
1240 .BR if .
1241 .PP
1242 The \fB@TPUT@ reset\fP command uses the same capability strings
1243 as the \fB@RESET@\fP command,
1244 although the two programs (\fB@TPUT@\fP and \fB@RESET@\fP)
1245 provide different command-line options.
1246 .PP
1247 In practice, these terminfo capabilities are not often used in
1248 initialization of tabs
1249 (though they are required for the \fB@TABS@\fP program):
1250 .bP
1251 Almost all hardware terminals (at least those which supported tabs)
1252 initialized those to every \fIeight\fP columns:
1253 .IP
1254 The only exception was the AT&T 2300 series,
1255 which set tabs to every \fIfive\fP columns.
1256 .bP
1257 In particular, developers of the hardware terminals which are commonly used
1258 as models for modern terminal emulators provided documentation demonstrating
1259 that \fIeight\fP columns were the standard.
1260 .bP
1261 Because of this, the terminal initialization programs
1262 \fB@TPUT@\fP and \fB@TSET@\fP
1263 use the
1264 \fBtbc\fP (\fBclear_all_tabs\fP) and
1265 \fBhts\fP (\fBset_tab\fP) capabilities directly
1266 only when the \fBit\fP (\fBinit_tabs\fP) capability
1267 is set to a value other than \fIeight\fP.
1268 .SS Delays and Padding
1269 .PP
1270 Many older and slower terminals do not support either XON/XOFF or DTR
1271 handshaking, including hard copy terminals and some very archaic CRTs
1272 (including, for example, DEC VT100s).
1273 These may require padding characters
1274 after certain cursor motions and screen changes.
1275 .PP
1276 If the terminal uses xon/xoff handshaking for flow control (that is,
1277 it automatically emits ^S back to the host when its input buffers are
1278 close to full), set
1279 .BR xon .
1280 This capability suppresses the emission of padding.
1281 You can also set it
1282 for memory-mapped console devices effectively that do not have a speed limit.
1283 Padding information should still be included so that routines can
1284 make better decisions about relative costs, but actual pad characters will
1285 not be transmitted.
1286 .PP
1287 If \fBpb\fR (padding baud rate) is given, padding is suppressed at baud rates
1288 below the value of \fBpb\fR.
1289 If the entry has no padding baud rate, then
1290 whether padding is emitted or not is completely controlled by \fBxon\fR.
1291 .PP
1292 If the terminal requires other than a null (zero) character as a pad,
1293 then this can be given as \fBpad\fR.
1294 Only the first character of the
1295 .B pad
1296 string is used.
1297 .PP
1298 .SS Status Lines
1299 Some terminals have an extra \*(``status line\*('' which is not normally used by
1300 software (and thus not counted in the terminal's \fBlines\fR capability).
1301 .PP
1302 The simplest case is a status line which is cursor-addressable but not
1303 part of the main scrolling region on the screen; the Heathkit H19 has
1304 a status line of this kind, as would a 24-line VT100 with a 23-line
1305 scrolling region set up on initialization.
1306 This situation is indicated
1307 by the \fBhs\fR capability.
1308 .PP
1309 Some terminals with status lines need special sequences to access the
1310 status line.
1311 These may be expressed as a string with single parameter
1312 \fBtsl\fR which takes the cursor to a given zero-origin column on the
1313 status line.
1314 The capability \fBfsl\fR must return to the main-screen
1315 cursor positions before the last \fBtsl\fR.
1316 You may need to embed the
1317 string values of \fBsc\fR (save cursor) and \fBrc\fR (restore cursor)
1318 in \fBtsl\fR and \fBfsl\fR to accomplish this.
1319 .PP
1320 The status line is normally assumed to be the same width as the width
1321 of the terminal.
1322 If this is untrue, you can specify it with the numeric
1323 capability \fBwsl\fR.
1324 .PP
1325 A command to erase or blank the status line may be specified as \fBdsl\fR.
1326 .PP
1327 The boolean capability \fBeslok\fR specifies that escape sequences, tabs,
1328 etc., work ordinarily in the status line.
1329 .PP
1330 The \fBncurses\fR implementation does not yet use any of these capabilities.
1331 They are documented here in case they ever become important.
1332 .PP
1333 .SS Line Graphics
1334 .PP
1335 Many terminals have alternate character sets useful for forms-drawing.
1336 Terminfo and \fBcurses\fR have built-in support
1337 for most of the drawing characters
1338 supported by the VT100, with some characters from the AT&T 4410v1 added.
1339 This alternate character set may be specified by the \fBacsc\fR capability.
1340 .PP
1341 .TS H
1342 center expand;
1343 l l l l l
1344 l l l l l
1345 _ _ _ _ _
1346 lw25 lw10 lw6 lw6 lw6.
1347 .\".TH
1348 \fBGlyph        ACS     Ascii   acsc    acsc\fR
1349 \fBName Name    Default Char    Value\fR
1350 arrow pointing right    ACS_RARROW      >       +       0x2b
1351 arrow pointing left     ACS_LARROW      <       ,       0x2c
1352 arrow pointing up       ACS_UARROW      ^       \-      0x2d
1353 arrow pointing down     ACS_DARROW      v       .       0x2e
1354 solid square block      ACS_BLOCK       #       0       0x30
1355 diamond                 ACS_DIAMOND     +       `       0x60
1356 checker board (stipple) ACS_CKBOARD     :       a       0x61
1357 degree symbol           ACS_DEGREE      \e      f       0x66
1358 plus/minus              ACS_PLMINUS     #       g       0x67
1359 board of squares        ACS_BOARD       #       h       0x68
1360 lantern symbol          ACS_LANTERN     #       i       0x69
1361 lower right corner      ACS_LRCORNER    +       j       0x6a
1362 upper right corner      ACS_URCORNER    +       k       0x6b
1363 upper left corner       ACS_ULCORNER    +       l       0x6c
1364 lower left corner       ACS_LLCORNER    +       m       0x6d
1365 large plus or crossover ACS_PLUS        +       n       0x6e
1366 scan line 1             ACS_S1          ~       o       0x6f
1367 scan line 3             ACS_S3          \-      p       0x70
1368 horizontal line         ACS_HLINE       \-      q       0x71
1369 scan line 7             ACS_S7          \-      r       0x72
1370 scan line 9             ACS_S9          \&_     s       0x73
1371 tee pointing right      ACS_LTEE        +       t       0x74
1372 tee pointing left       ACS_RTEE        +       u       0x75
1373 tee pointing up         ACS_BTEE        +       v       0x76
1374 tee pointing down       ACS_TTEE        +       w       0x77
1375 vertical line           ACS_VLINE       |       x       0x78
1376 less-than-or-equal-to   ACS_LEQUAL      <       y       0x79
1377 greater-than-or-equal-to        ACS_GEQUAL      >       z       0x7a
1378 greek pi                ACS_PI  *       {       0x7b
1379 not-equal               ACS_NEQUAL      !       |       0x7c
1380 UK pound sign           ACS_STERLING    f       }       0x7d
1381 bullet                  ACS_BULLET      o       ~       0x7e
1382 .TE
1383 .PP
1384 A few notes apply to the table itself:
1385 .bP
1386 X/Open Curses incorrectly states that the mapping for \fIlantern\fP is
1387 uppercase \*(``I\*('' although Unix implementations use the
1388 lowercase \*(``i\*('' mapping.
1389 .bP
1390 The DEC VT100 implemented graphics using the alternate character set
1391 feature, temporarily switching \fImodes\fP and sending characters
1392 in the range 0x60 (96) to 0x7e (126)
1393 (the \fBacsc Value\fP column in the table).
1394 .bP
1395 The AT&T terminal added graphics characters outside that range.
1396 .IP
1397 Some of the characters within the range do not match the VT100;
1398 presumably they were used in the AT&T terminal:
1399 \fIboard of squares\fP replaces the VT100 \fInewline\fP symbol, while
1400 \fIlantern symbol\fP replaces the VT100 \fIvertical tab\fP symbol.
1401 The other VT100 symbols for control characters (\fIhorizontal tab\fP,
1402 \fIcarriage return\fP and \fIline-feed\fP) are not (re)used in curses.
1403 .PP
1404 The best way to define a new device's graphics set is to add a column
1405 to a copy of this table for your terminal, giving the character which
1406 (when emitted between \fBsmacs\fR/\fBrmacs\fR switches) will be rendered
1407 as the corresponding graphic.
1408 Then read off the VT100/your terminal
1409 character pairs right to left in sequence; these become the ACSC string.
1410 .PP
1411 .SS Color Handling
1412 .PP
1413 The curses library functions \fBinit_pair\fP and \fBinit_color\fP
1414 manipulate the \fIcolor pairs\fP and \fIcolor values\fP discussed in this
1415 section
1416 (see \fBcurs_color\fP(3X) for details on these and related functions).
1417 .PP
1418 Most color terminals are either \*(``Tektronix-like\*('' or \*(``HP-like\*('':
1419 .bP
1420 Tektronix-like
1421 terminals have a predefined set of \fIN\fP colors
1422 (where \fIN\fP is usually 8),
1423 and can set
1424 character-cell foreground and background characters independently, mixing them
1425 into \fIN\fP\ *\ \fIN\fP color-pairs.
1426 .bP
1427 On HP-like terminals, the user must set each color
1428 pair up separately (foreground and background are not independently settable).
1429 Up to \fIM\fP color-pairs may be set up from 2*\fIM\fP different colors.
1430 ANSI-compatible terminals are Tektronix-like.
1431 .PP
1432 Some basic color capabilities are independent of the color method.
1433 The numeric
1434 capabilities \fBcolors\fR and \fBpairs\fR specify the maximum numbers of colors
1435 and color-pairs that can be displayed simultaneously.
1436 The \fBop\fR (original
1437 pair) string resets foreground and background colors to their default values
1438 for the terminal.
1439 The \fBoc\fR string resets all colors or color-pairs to
1440 their default values for the terminal.
1441 Some terminals (including many PC
1442 terminal emulators) erase screen areas with the current background color rather
1443 than the power-up default background; these should have the boolean capability
1444 \fBbce\fR.
1445 .PP
1446 While the curses library works with \fIcolor pairs\fP
1447 (reflecting the inability of some devices to set foreground
1448 and background colors independently),
1449 there are separate capabilities for setting these features:
1450 .bP
1451 To change the current foreground or background color on a Tektronix-type
1452 terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI
1453 background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background).
1454 These take one parameter, the color number.
1455 The SVr4 documentation describes
1456 only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal
1457 supports ANSI escape sequences to set background and foreground, they should
1458 be coded as \fBsetaf\fR and \fBsetab\fR, respectively.
1459 .bP
1460 If the terminal
1461 supports other escape sequences to set background and foreground, they should
1462 be coded as \fBsetf\fR and \fBsetb\fR, respectively.
1463 The \fBvidputs\fR and the \fBrefresh\fP(3X) functions
1464 use the \fBsetaf\fR and \fBsetab\fR capabilities if they are defined.
1465 .PP
1466 The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a
1467 single numeric argument each.
1468 Argument values 0-7 of \fBsetaf\fR/\fBsetab\fR are portably defined as
1469 follows (the middle column is the symbolic #define available in the header for
1470 the \fBcurses\fR or \fBncurses\fR libraries).
1471 The terminal hardware is free to
1472 map these as it likes, but the RGB values indicate normal locations in color
1473 space.
1474 .PP
1475 .TS H
1476 center;
1477 l c c c
1478 l l n l.
1479 \fBColor        #define         Value   RGB\fR
1480 black   \fBCOLOR_BLACK\fR       0       0, 0, 0
1481 red     \fBCOLOR_RED\ \fR       1       max,0,0
1482 green   \fBCOLOR_GREEN\fR       2       0,max,0
1483 yellow  \fBCOLOR_YELLOW\fR      3       max,max,0
1484 blue    \fBCOLOR_BLUE\fR        4       0,0,max
1485 magenta \fBCOLOR_MAGENTA\fR     5       max,0,max
1486 cyan    \fBCOLOR_CYAN\fR        6       0,max,max
1487 white   \fBCOLOR_WHITE\fR       7       max,max,max
1488 .TE
1489 .PP
1490 The argument values of \fBsetf\fR/\fBsetb\fR historically correspond to
1491 a different mapping, i.e.,
1492 .TS H
1493 center;
1494 l c c c
1495 l l n l.
1496 \fBColor        #define         Value   RGB\fR
1497 black   \fBCOLOR_BLACK\fR       0       0, 0, 0
1498 blue    \fBCOLOR_BLUE\fR        1       0,0,max
1499 green   \fBCOLOR_GREEN\fR       2       0,max,0
1500 cyan    \fBCOLOR_CYAN\fR        3       0,max,max
1501 red     \fBCOLOR_RED\ \fR       4       max,0,0
1502 magenta \fBCOLOR_MAGENTA\fR     5       max,0,max
1503 yellow  \fBCOLOR_YELLOW\fR      6       max,max,0
1504 white   \fBCOLOR_WHITE\fR       7       max,max,max
1505 .TE
1506 .PP
1507 It is important to not confuse the two sets of color capabilities;
1508 otherwise red/blue will be interchanged on the display.
1509 .PP
1510 On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set
1511 which color pair is current.
1512 .PP
1513 Some terminals allow the \fIcolor values\fP to be modified:
1514 .bP
1515 On a Tektronix-like terminal, the capability \fBccc\fR may be present to
1516 indicate that colors can be modified.
1517 If so, the \fBinitc\fR capability will
1518 take a color number (0 to \fBcolors\fR \- 1)and three more parameters which
1519 describe the color.
1520 These three parameters default to being interpreted as RGB
1521 (Red, Green, Blue) values.
1522 If the boolean capability \fBhls\fR is present,
1523 they are instead as HLS (Hue, Lightness, Saturation) indices.
1524 The ranges are
1525 terminal-dependent.
1526 .bP
1527 On an HP-like terminal, \fBinitp\fR may give a capability for changing a
1528 color-pair value.
1529 It will take seven parameters; a color-pair number (0 to
1530 \fBmax_pairs\fR \- 1), and two triples describing first background and then
1531 foreground colors.
1532 These parameters must be (Red, Green, Blue) or
1533 (Hue, Lightness, Saturation) depending on \fBhls\fR.
1534 .PP
1535 On some color terminals, colors collide with highlights.
1536 You can register
1537 these collisions with the \fBncv\fR capability.
1538 This is a bit-mask of
1539 attributes not to be used when colors are enabled.
1540 The correspondence with the
1541 attributes understood by \fBcurses\fR is as follows:
1542 .PP
1543 .TS
1544 center;
1545 l l l l
1546 lw20 lw2 lw10 lw10.
1547 \fBAttribute    Bit     Decimal Set by\fR
1548 A_STANDOUT      0       1       sgr
1549 A_UNDERLINE     1       2       sgr
1550 A_REVERSE       2       4       sgr
1551 A_BLINK         3       8       sgr
1552 A_DIM           4       16      sgr
1553 A_BOLD          5       32      sgr
1554 A_INVIS         6       64      sgr
1555 A_PROTECT       7       128     sgr
1556 A_ALTCHARSET    8       256     sgr
1557 A_HORIZONTAL    9       512     sgr1
1558 A_LEFT  10      1024    sgr1
1559 A_LOW   11      2048    sgr1
1560 A_RIGHT 12      4096    sgr1
1561 A_TOP   13      8192    sgr1
1562 A_VERTICAL      14      16384   sgr1
1563 A_ITALIC        15      32768   sitm
1564 .TE
1565 .PP
1566 For example, on many IBM PC consoles, the underline attribute collides with the
1567 foreground color blue and is not available in color mode.
1568 These should have
1569 an \fBncv\fR capability of 2.
1570 .PP
1571 SVr4 curses does nothing with \fBncv\fR, ncurses recognizes it and optimizes
1572 the output in favor of colors.
1573 .PP
1574 .SS Miscellaneous
1575 If the terminal requires other than a null (zero) character as a pad, then this
1576 can be given as pad.
1577 Only the first character of the pad string is used.
1578 If the terminal does not have a pad character, specify npc.
1579 Note that ncurses implements the termcap-compatible \fBPC\fR variable;
1580 though the application may set this value to something other than
1581 a null, ncurses will test \fBnpc\fR first and use napms if the terminal
1582 has no pad character.
1583 .PP
1584 If the terminal can move up or down half a line,
1585 this can be indicated with
1586 .B hu
1587 (half-line up)
1588 and
1589 .B hd
1590 (half-line down).
1591 This is primarily useful for superscripts and subscripts on hard-copy terminals.
1592 If a hard-copy terminal can eject to the next page (form feed), give this as
1593 .B ff
1594 (usually control/L).
1595 .PP
1596 If there is a command to repeat a given character a given number of
1597 times (to save time transmitting a large number of identical characters)
1598 this can be indicated with the parameterized string
1599 .BR rep .
1600 The first parameter is the character to be repeated and the second
1601 is the number of times to repeat it.
1602 Thus, tparm(repeat_char, 'x', 10) is the same as \*(``xxxxxxxxxx\*(''.
1603 .PP
1604 If the terminal has a settable command character, such as the \s-1TEKTRONIX\s+1 4025,
1605 this can be indicated with
1606 .BR cmdch .
1607 A prototype command character is chosen which is used in all capabilities.
1608 This character is given in the
1609 .B cmdch
1610 capability to identify it.
1611 The following convention is supported on some UNIX systems:
1612 The environment is to be searched for a
1613 .B CC
1614 variable, and if found, all
1615 occurrences of the prototype character are replaced with the character
1616 in the environment variable.
1617 .PP
1618 Terminal descriptions that do not represent a specific kind of known
1619 terminal, such as
1620 .IR switch ,
1621 .IR dialup ,
1622 .IR patch ,
1623 and
1624 .IR network ,
1625 should include the
1626 .B gn
1627 (generic) capability so that programs can complain that they do not know
1628 how to talk to the terminal.
1629 (This capability does not apply to
1630 .I virtual
1631 terminal descriptions for which the escape sequences are known.)
1632 .PP
1633 If the terminal has a \*(``meta key\*('' which acts as a shift key,
1634 setting the 8th bit of any character transmitted, this fact can
1635 be indicated with
1636 .BR km .
1637 Otherwise, software will assume that the 8th bit is parity and it
1638 will usually be cleared.
1639 If strings exist to turn this \*(``meta mode\*('' on and off, they
1640 can be given as
1641 .B smm
1642 and
1643 .BR rmm .
1644 .PP
1645 If the terminal has more lines of memory than will fit on the screen
1646 at once, the number of lines of memory can be indicated with
1647 .BR lm .
1648 A value of
1649 .BR lm #0
1650 indicates that the number of lines is not fixed,
1651 but that there is still more memory than fits on the screen.
1652 .PP
1653 If the terminal is one of those supported by the \s-1UNIX\s+1 virtual
1654 terminal protocol, the terminal number can be given as
1655 .BR vt .
1656 .PP
1657 Media copy
1658 strings which control an auxiliary printer connected to the terminal
1659 can be given as
1660 .BR mc0 :
1661 print the contents of the screen,
1662 .BR mc4 :
1663 turn off the printer, and
1664 .BR mc5 :
1665 turn on the printer.
1666 When the printer is on, all text sent to the terminal will be sent
1667 to the printer.
1668 It is undefined whether the text is also displayed on the terminal screen
1669 when the printer is on.
1670 A variation
1671 .B mc5p
1672 takes one parameter, and leaves the printer on for as many characters
1673 as the value of the parameter, then turns the printer off.
1674 The parameter should not exceed 255.
1675 All text, including
1676 .BR mc4 ,
1677 is transparently passed to the printer while an
1678 .B mc5p
1679 is in effect.
1680 .PP
1681 .SS Glitches and Braindamage
1682 .PP
1683 Hazeltine terminals, which do not allow \*(``~\*('' characters to be displayed should
1684 indicate \fBhz\fR.
1685 .PP
1686 Terminals which ignore a line-feed immediately after an \fBam\fR wrap,
1687 such as the Concept and vt100,
1688 should indicate \fBxenl\fR.
1689 .PP
1690 If
1691 .B el
1692 is required to get rid of standout
1693 (instead of merely writing normal text on top of it),
1694 \fBxhp\fP should be given.
1695 .PP
1696 Teleray terminals, where tabs turn all characters moved over to blanks,
1697 should indicate \fBxt\fR (destructive tabs).
1698 Note: the variable indicating this is now \*(``dest_tabs_magic_smso\*(''; in
1699 older versions, it was teleray_glitch.
1700 This glitch is also taken to mean that it is not possible to position
1701 the cursor on top of a \*(``magic cookie\*('',
1702 that to erase standout mode it is instead necessary to use
1703 delete and insert line.
1704 The ncurses implementation ignores this glitch.
1705 .PP
1706 The Beehive Superbee, which is unable to correctly transmit the escape
1707 or control/C characters, has
1708 .BR xsb ,
1709 indicating that the f1 key is used for escape and f2 for control/C.
1710 (Only certain Superbees have this problem, depending on the ROM.)
1711 Note that in older terminfo versions, this capability was called
1712 \*(``beehive_glitch\*(''; it is now \*(``no_esc_ctl_c\*(''.
1713 .PP
1714 Other specific terminal problems may be corrected by adding more
1715 capabilities of the form \fBx\fR\fIx\fR.
1716 .PP
1717 .SS Pitfalls of Long Entries
1718 .PP
1719 Long terminfo entries are unlikely to be a problem; to date, no entry has even
1720 approached terminfo's 4096-byte string-table maximum.
1721 Unfortunately, the termcap
1722 translations are much more strictly limited (to 1023 bytes), thus termcap translations
1723 of long terminfo entries can cause problems.
1724 .PP
1725 The man pages for 4.3BSD and older versions of \fBtgetent\fP instruct the user to
1726 allocate a 1024-byte buffer for the termcap entry.
1727 The entry gets null-terminated by
1728 the termcap library, so that makes the maximum safe length for a termcap entry
1729 1k\-1 (1023) bytes.
1730 Depending on what the application and the termcap library
1731 being used does, and where in the termcap file the terminal type that \fBtgetent\fP
1732 is searching for is, several bad things can happen.
1733 .PP
1734 Some termcap libraries print a warning message or exit if they find an
1735 entry that's longer than 1023 bytes; others do not; others truncate the
1736 entries to 1023 bytes.
1737 Some application programs allocate more than
1738 the recommended 1K for the termcap entry; others do not.
1739 .PP
1740 Each termcap entry has two important sizes associated with it: before
1741 "tc" expansion, and after "tc" expansion.
1742 "tc" is the capability that
1743 tacks on another termcap entry to the end of the current one, to add
1744 on its capabilities.
1745 If a termcap entry does not use the "tc"
1746 capability, then of course the two lengths are the same.
1747 .PP
1748 The "before tc expansion" length is the most important one, because it
1749 affects more than just users of that particular terminal.
1750 This is the
1751 length of the entry as it exists in /etc/termcap, minus the
1752 backslash-newline pairs, which \fBtgetent\fP strips out while reading it.
1753 Some termcap libraries strip off the final newline, too (GNU termcap does not).
1754 Now suppose:
1755 .bP
1756 a termcap entry before expansion is more than 1023 bytes long,
1757 .bP
1758 and the application has only allocated a 1k buffer,
1759 .bP
1760 and the termcap library (like the one in BSD/OS 1.1 and GNU) reads
1761 the whole entry into the buffer, no matter what its length, to see
1762 if it is the entry it wants,
1763 .bP
1764 and \fBtgetent\fP is searching for a terminal type that either is the
1765 long entry, appears in the termcap file after the long entry, or
1766 does not appear in the file at all (so that \fBtgetent\fP has to search
1767 the whole termcap file).
1768 .PP
1769 Then \fBtgetent\fP will overwrite memory, perhaps its stack, and probably core dump
1770 the program.
1771 Programs like telnet are particularly vulnerable; modern telnets
1772 pass along values like the terminal type automatically.
1773 The results are almost
1774 as undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, that
1775 prints warning messages when it reads an overly long termcap entry.
1776 If a
1777 termcap library truncates long entries, like OSF/1 3.0, it is immune to dying
1778 here but will return incorrect data for the terminal.
1779 .PP
1780 The "after tc expansion" length will have a similar effect to the
1781 above, but only for people who actually set TERM to that terminal
1782 type, since \fBtgetent\fP only does "tc" expansion once it is found the
1783 terminal type it was looking for, not while searching.
1784 .PP
1785 In summary, a termcap entry that is longer than 1023 bytes can cause,
1786 on various combinations of termcap libraries and applications, a core
1787 dump, warnings, or incorrect operation.
1788 If it is too long even before
1789 "tc" expansion, it will have this effect even for users of some other
1790 terminal types and users whose TERM variable does not have a termcap
1791 entry.
1792 .PP
1793 When in \-C (translate to termcap) mode, the \fBncurses\fR implementation of
1794 \fB@TIC@\fR(1M) issues warning messages when the pre-tc length of a termcap
1795 translation is too long.
1796 The \-c (check) option also checks resolved (after tc
1797 expansion) lengths.
1798 .SS Binary Compatibility
1799 It is not wise to count on portability of binary terminfo entries between
1800 commercial UNIX versions.
1801 The problem is that there are at least two versions
1802 of terminfo (under HP\-UX and AIX) which diverged from System V terminfo after
1803 SVr1, and have added extension capabilities to the string table that (in the
1804 binary format) collide with System V and XSI Curses extensions.
1805 .SH EXTENSIONS
1806 .PP
1807 Searching for terminal descriptions in
1808 \fB$HOME/.terminfo\fR and TERMINFO_DIRS 
1809 is not supported by older implementations.
1810 .PP
1811 Some SVr4 \fBcurses\fR implementations, and all previous to SVr4, do not
1812 interpret the %A and %O operators in parameter strings.
1813 .PP
1814 SVr4/XPG4 do not specify whether \fBmsgr\fR licenses movement while in
1815 an alternate-character-set mode (such modes may, among other things, map
1816 CR and NL to characters that do not trigger local motions).
1817 The \fBncurses\fR implementation ignores \fBmsgr\fR in \fBALTCHARSET\fR
1818 mode.
1819 This raises the possibility that an XPG4
1820 implementation making the opposite interpretation may need terminfo
1821 entries made for \fBncurses\fR to have \fBmsgr\fR turned off.
1822 .PP
1823 The \fBncurses\fR library handles insert-character and insert-character modes
1824 in a slightly non-standard way to get better update efficiency.
1825 See
1826 the \fBInsert/Delete Character\fR subsection above.
1827 .PP
1828 The parameter substitutions for \fBset_clock\fR and \fBdisplay_clock\fR are
1829 not documented in SVr4 or the XSI Curses standard.
1830 They are deduced from the
1831 documentation for the AT&T 505 terminal.
1832 .PP
1833 Be careful assigning the \fBkmous\fR capability.
1834 The \fBncurses\fR library wants to interpret it as \fBKEY_MOUSE\fR,
1835 for use by terminals and emulators like xterm
1836 that can return mouse-tracking information in the keyboard-input stream.
1837 .PP
1838 X/Open Curses does not mention italics.
1839 Portable applications must assume that numeric capabilities are
1840 signed 16-bit values.
1841 This includes the \fIno_color_video\fP (ncv) capability.
1842 The 32768 mask value used for italics with ncv can be confused with
1843 an absent or cancelled ncv.
1844 If italics should work with colors,
1845 then the ncv value must be specified, even if it is zero.
1846 .PP
1847 Different commercial ports of terminfo and curses support different subsets of
1848 the XSI Curses standard and (in some cases) different extension sets.
1849 Here
1850 is a summary, accurate as of October 1995:
1851 .bP
1852 \fBSVR4, Solaris, ncurses\fR \-\-
1853 These support all SVr4 capabilities.
1854 .bP
1855 \fBSGI\fR \-\-
1856 Supports the SVr4 set, adds one undocumented extended string
1857 capability (\fBset_pglen\fR).
1858 .bP
1859 \fBSVr1, Ultrix\fR \-\-
1860 These support a restricted subset of terminfo capabilities.
1861 The booleans end with \fBxon_xoff\fR;
1862 the numerics with \fBwidth_status_line\fR;
1863 and the strings with \fBprtr_non\fR.
1864 .bP
1865 \fBHP/UX\fR \-\-
1866 Supports the SVr1 subset, plus the SVr[234] numerics \fBnum_labels\fR,
1867 \fBlabel_height\fR, \fBlabel_width\fR, plus function keys 11 through 63, plus
1868 \fBplab_norm\fR, \fBlabel_on\fR, and \fBlabel_off\fR, plus some incompatible
1869 extensions in the string table.
1870 .bP
1871 \fBAIX\fR \-\-
1872 Supports the SVr1 subset, plus function keys 11 through 63, plus a number
1873 of incompatible string table extensions.
1874 .bP
1875 \fBOSF\fR \-\-
1876 Supports both the SVr4 set and the AIX extensions.
1877 .SH FILES
1878 .TP 25
1879 \*d/?/*
1880 files containing terminal descriptions
1881 .SH SEE ALSO
1882 \fB@TABS@\fR(1M),
1883 \fB@TIC@\fR(1M),
1884 \fB@INFOCMP@\fR(1M),
1885 \fBcurses\fR(3X),
1886 \fBcurs_color\fR(3X),
1887 \fBcurs_variables\fR(3X),
1888 \fBprintf\fR(3),
1889 \fBterm\fR(\*n).
1890 \fBterm_variables\fR(3X).
1891 \fBuser_caps\fR(5).
1892 .SH AUTHORS
1893 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
1894 Based on pcurses by Pavel Curtis.