Update ncurses to version 5.4.
[dragonfly.git] / lib / libncurses / man / terminfo.5
1 '\" t
2 .\" DO NOT EDIT THIS FILE BY HAND!
3 .\" It is generated from terminfo.head, Caps, and terminfo.tail.
4 .\"
5 .\" Note: this must be run through tbl before nroff.
6 .\" The magic cookie on the first line triggers this under some man programs.
7 .\"***************************************************************************
8 .\" Copyright (c) 1998-2000,2002 Free Software Foundation, Inc.              *
9 .\"                                                                          *
10 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
11 .\" copy of this software and associated documentation files (the            *
12 .\" "Software"), to deal in the Software without restriction, including      *
13 .\" without limitation the rights to use, copy, modify, merge, publish,      *
14 .\" distribute, distribute with modifications, sublicense, and/or sell       *
15 .\" copies of the Software, and to permit persons to whom the Software is    *
16 .\" furnished to do so, subject to the following conditions:                 *
17 .\"                                                                          *
18 .\" The above copyright notice and this permission notice shall be included  *
19 .\" in all copies or substantial portions of the Software.                   *
20 .\"                                                                          *
21 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
22 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
23 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
24 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
25 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
26 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
27 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
28 .\"                                                                          *
29 .\" Except as contained in this notice, the name(s) of the above copyright   *
30 .\" holders shall not be used in advertising or otherwise to promote the     *
31 .\" sale, use or other dealings in this Software without prior written       *
32 .\" authorization.                                                           *
33 .\"***************************************************************************
34 .\"
35 .\" $Id: terminfo.head,v 1.10 2002/08/17 23:37:10 tom Exp $
36 .\" $DragonFly: src/lib/libncurses/man/terminfo.5,v 1.1 2005/03/12 19:13:54 eirikn Exp $
37 .TH TERMINFO 5 "" "" "File Formats"
38 .ds n 5
39 .ds d /usr/share/terminfo
40 .SH NAME
41 terminfo \- terminal capability data base
42 .SH SYNOPSIS
43 \*d/*/*
44 .SH DESCRIPTION
45 .I Terminfo
46 is a data base describing terminals, used by screen-oriented programs such as
47 \fBnvi\fR(1),
48 \fBrogue\fR(1)
49 and libraries such as
50 \fBcurses\fR(3X).
51 .I Terminfo
52 describes terminals by giving a set of capabilities which they
53 have, by specifying how to perform screen operations, and by
54 specifying padding requirements and initialization sequences.
55 .PP
56 Entries in
57 .I terminfo
58 consist of a sequence of `,' separated fields (embedded commas may be
59 escaped with a backslash or notated as \e054).
60 White space after the `,' separator is ignored.
61 The first entry for each terminal gives the names which are known for the
62 terminal, separated by `|' characters.
63 The first name given is the most common abbreviation for the terminal,
64 the last name given should be a long name fully identifying the terminal,
65 and all others are understood as synonyms for the terminal name.
66 All names but the last should be in lower case and contain no blanks;
67 the last name may well contain upper case and blanks for readability.
68 .PP
69 Terminal names (except for the last, verbose entry) should
70 be chosen using the following conventions.
71 The particular piece of hardware making up the terminal should
72 have a root name, thus ``hp2621''.
73 This name should not contain hyphens.
74 Modes that the hardware can be in, or user preferences, should
75 be indicated by appending a hyphen and a mode suffix.
76 Thus, a vt100 in 132 column mode would be vt100-w.
77 The following suffixes should be used where possible:
78 .PP
79 .TS
80 center ;
81 l c l
82 l l l.
83 \fBSuffix       Meaning Example\fP
84 -\fInn\fP       Number of lines on the screen   aaa-60
85 -\fIn\fPp       Number of pages of memory       c100-4p
86 -am     With automargins (usually the default)  vt100-am
87 -m      Mono mode; suppress color               ansi-m
88 -mc     Magic cookie; spaces when highlighting  wy30-mc
89 -na     No arrow keys (leave them in local)     c100-na
90 -nam    Without automatic margins               vt100-nam
91 -nl     No status line                          att4415-nl
92 -ns     No status line                          hp2626-ns
93 -rv     Reverse video                           c100-rv
94 -s      Enable status line                      vt100-s
95 -vb     Use visible bell instead of beep        wy370-vb
96 -w      Wide mode (> 80 columns, usually 132)   vt100-w
97 .TE
98 .PP
99 For more on terminal naming conventions, see the \fBterm(7)\fR manual page.
100 .SS Capabilities
101 .\" Head of terminfo man page ends here
102 .ps -1
103 The following is a complete table of the capabilities included in a
104 terminfo description block and available to terminfo-using code.  In each
105 line of the table,
106
107 The \fBvariable\fR is the name by which the programmer (at the terminfo level)
108 accesses the capability.
109
110 The \fBcapname\fR is the short name used in the text of the database,
111 and is used by a person updating the database.
112 Whenever possible, capnames are chosen to be the same as or similar to
113 the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses 
114 identical or very similar names).  Semantics are also intended to match
115 those of the specification.
116
117 The termcap code is the old
118 .B termcap
119 capability name (some capabilities are new, and have names which termcap
120 did not originate).
121 .P
122 Capability names have no hard length limit, but an informal limit of 5
123 characters has been adopted to keep them short and to allow the tabs in
124 the source file
125 .B Caps
126 to line up nicely.
127
128 Finally, the description field attempts to convey the semantics of the
129 capability.  You may find some codes in the description field:
130 .TP
131 (P)
132 indicates that padding may be specified
133 .TP
134 #[1-9]
135 in the description field indicates that the string is passed through tparm with
136 parms as given (#\fIi\fP).
137 .TP
138 (P*)
139 indicates that padding may vary in proportion to the number of
140 lines affected
141 .TP
142 (#\d\fIi\fP\u)
143 indicates the \fIi\fP\uth\d parameter.
144
145 .PP
146 These are the boolean capabilities:
147
148 .na
149 .TS H
150 center expand;
151 c l l c
152 c l l c
153 lw25 lw6 lw2 lw20.
154 \fBVariable     Cap-    TCap    Description\fR
155 \fBBooleans     name    Code\fR
156 auto_left_margin        bw      bw      T{
157 cub1 wraps from column 0 to last column
158 T}
159 auto_right_margin       am      am      T{
160 terminal has automatic margins
161 T}
162 back_color_erase        bce     ut      T{
163 screen erased with background color
164 T}
165 can_change      ccc     cc      T{
166 terminal can re-define existing colors
167 T}
168 ceol_standout_glitch    xhp     xs      T{
169 standout not erased by overwriting (hp)
170 T}
171 col_addr_glitch xhpa    YA      T{
172 only positive motion for hpa/mhpa caps
173 T}
174 cpi_changes_res cpix    YF      T{
175 changing character pitch changes resolution
176 T}
177 cr_cancels_micro_mode   crxm    YB      T{
178 using cr turns off micro mode
179 T}
180 dest_tabs_magic_smso    xt      xt      T{
181 tabs destructive, magic so char (t1061)
182 T}
183 eat_newline_glitch      xenl    xn      T{
184 newline ignored after 80 cols (concept)
185 T}
186 erase_overstrike        eo      eo      T{
187 can erase overstrikes with a blank
188 T}
189 generic_type    gn      gn      T{
190 generic line type
191 T}
192 hard_copy       hc      hc      T{
193 hardcopy terminal
194 T}
195 hard_cursor     chts    HC      T{
196 cursor is hard to see
197 T}
198 has_meta_key    km      km      T{
199 Has a meta key (i.e., sets 8th-bit)
200 T}
201 has_print_wheel daisy   YC      T{
202 printer needs operator to change character set
203 T}
204 has_status_line hs      hs      T{
205 has extra status line
206 T}
207 hue_lightness_saturation        hls     hl      T{
208 terminal uses only HLS color notation (Tektronix)
209 T}
210 insert_null_glitch      in      in      T{
211 insert mode distinguishes nulls
212 T}
213 lpi_changes_res lpix    YG      T{
214 changing line pitch changes resolution
215 T}
216 memory_above    da      da      T{
217 display may be retained above the screen
218 T}
219 memory_below    db      db      T{
220 display may be retained below the screen
221 T}
222 move_insert_mode        mir     mi      T{
223 safe to move while in insert mode
224 T}
225 move_standout_mode      msgr    ms      T{
226 safe to move while in standout mode
227 T}
228 needs_xon_xoff  nxon    nx      T{
229 padding will not work, xon/xoff required
230 T}
231 no_esc_ctlc     xsb     xb      T{
232 beehive (f1=escape, f2=ctrl C)
233 T}
234 no_pad_char     npc     NP      T{
235 pad character does not exist
236 T}
237 non_dest_scroll_region  ndscr   ND      T{
238 scrolling region is non-destructive
239 T}
240 non_rev_rmcup   nrrmc   NR      T{
241 smcup does not reverse rmcup
242 T}
243 over_strike     os      os      T{
244 terminal can overstrike
245 T}
246 prtr_silent     mc5i    5i      T{
247 printer will not echo on screen
248 T}
249 row_addr_glitch xvpa    YD      T{
250 only positive motion for vpa/mvpa caps
251 T}
252 semi_auto_right_margin  sam     YE      T{
253 printing in last column causes cr
254 T}
255 status_line_esc_ok      eslok   es      T{
256 escape can be used on the status line
257 T}
258 tilde_glitch    hz      hz      T{
259 cannot print ~'s (hazeltine)
260 T}
261 transparent_underline   ul      ul      T{
262 underline character overstrikes
263 T}
264 xon_xoff        xon     xo      T{
265 terminal uses xon/xoff handshaking
266 T}
267 .TE
268 .ad
269
270 These are the numeric capabilities:
271
272 .na
273 .TS H
274 center expand;
275 c l l c
276 c l l c
277 lw25 lw6 lw2 lw20.
278 \fBVariable     Cap-    TCap    Description\fR
279 \fBNumeric      name    Code\fR
280 columns cols    co      T{
281 number of columns in a line
282 T}
283 init_tabs       it      it      T{
284 tabs initially every # spaces
285 T}
286 label_height    lh      lh      T{
287 rows in each label
288 T}
289 label_width     lw      lw      T{
290 columns in each label
291 T}
292 lines   lines   li      T{
293 number of lines on screen or page
294 T}
295 lines_of_memory lm      lm      T{
296 lines of memory if > line. 0 means varies
297 T}
298 magic_cookie_glitch     xmc     sg      T{
299 number of blank characters left by smso or rmso
300 T}
301 max_attributes  ma      ma      T{
302 maximum combined attributes terminal can handle
303 T}
304 max_colors      colors  Co      T{
305 maximum number of colors on screen
306 T}
307 max_pairs       pairs   pa      T{
308 maximum number of color-pairs on the screen
309 T}
310 maximum_windows wnum    MW      T{
311 maximum number of defineable windows
312 T}
313 no_color_video  ncv     NC      T{
314 video attributes that cannot be used with colors
315 T}
316 num_labels      nlab    Nl      T{
317 number of labels on screen
318 T}
319 padding_baud_rate       pb      pb      T{
320 lowest baud rate where padding needed
321 T}
322 virtual_terminal        vt      vt      T{
323 virtual terminal number (CB/unix)
324 T}
325 width_status_line       wsl     ws      T{
326 number of columns in status line
327 T}
328 .TE
329 .ad
330
331 The following numeric capabilities are present in the SVr4.0 term structure,
332 but are not yet documented in the man page.  They came in with SVr4's
333 printer support.
334
335 .na
336 .TS H
337 center expand;
338 c l l c
339 c l l c
340 lw25 lw6 lw2 lw20.
341 \fBVariable     Cap-    TCap    Description\fR
342 \fBNumeric      name    Code\fR
343 bit_image_entwining     bitwin  Yo      T{
344 number of passes for each bit-image row
345 T}
346 bit_image_type  bitype  Yp      T{
347 type of bit-image device
348 T}
349 buffer_capacity bufsz   Ya      T{
350 numbers of bytes buffered before printing
351 T}
352 buttons btns    BT      T{
353 number of buttons on mouse
354 T}
355 dot_horz_spacing        spinh   Yc      T{
356 spacing of dots horizontally in dots per inch
357 T}
358 dot_vert_spacing        spinv   Yb      T{
359 spacing of pins vertically in pins per inch
360 T}
361 max_micro_address       maddr   Yd      T{
362 maximum value in micro_..._address
363 T}
364 max_micro_jump  mjump   Ye      T{
365 maximum value in parm_..._micro
366 T}
367 micro_col_size  mcs     Yf      T{
368 character step size when in micro mode
369 T}
370 micro_line_size mls     Yg      T{
371 line step size when in micro mode
372 T}
373 number_of_pins  npins   Yh      T{
374 numbers of pins in print-head
375 T}
376 output_res_char orc     Yi      T{
377 horizontal resolution in units per line
378 T}
379 output_res_horz_inch    orhi    Yk      T{
380 horizontal resolution in units per inch
381 T}
382 output_res_line orl     Yj      T{
383 vertical resolution in units per line
384 T}
385 output_res_vert_inch    orvi    Yl      T{
386 vertical resolution in units per inch
387 T}
388 print_rate      cps     Ym      T{
389 print rate in characters per second
390 T}
391 wide_char_size  widcs   Yn      T{
392 character step size when in double wide mode
393 T}
394 .TE
395 .ad
396
397 These are the string capabilities:
398
399 .na
400 .TS H
401 center expand;
402 c l l c
403 c l l c
404 lw25 lw6 lw2 lw20.
405 \fBVariable     Cap-    TCap    Description\fR
406 \fBString       name    Code\fR
407 acs_chars       acsc    ac      T{
408 graphics charset pairs, based on vt100
409 T}
410 back_tab        cbt     bt      T{
411 back tab (P)
412 T}
413 bell    bel     bl      T{
414 audible signal (bell) (P)
415 T}
416 carriage_return cr      cr      T{
417 carriage return (P*) (P*)
418 T}
419 change_char_pitch       cpi     ZA      T{
420 Change number of characters per inch to #1
421 T}
422 change_line_pitch       lpi     ZB      T{
423 Change number of lines per inch to #1
424 T}
425 change_res_horz chr     ZC      T{
426 Change horizontal resolution to #1
427 T}
428 change_res_vert cvr     ZD      T{
429 Change vertical resolution to #1
430 T}
431 change_scroll_region    csr     cs      T{
432 change region to line #1 to line #2 (P)
433 T}
434 char_padding    rmp     rP      T{
435 like ip but when in insert mode
436 T}
437 clear_all_tabs  tbc     ct      T{
438 clear all tab stops (P)
439 T}
440 clear_margins   mgc     MC      T{
441 clear right and left soft margins
442 T}
443 clear_screen    clear   cl      T{
444 clear screen and home cursor (P*)
445 T}
446 clr_bol el1     cb      T{
447 Clear to beginning of line
448 T}
449 clr_eol el      ce      T{
450 clear to end of line (P)
451 T}
452 clr_eos ed      cd      T{
453 clear to end of screen (P*)
454 T}
455 column_address  hpa     ch      T{
456 horizontal position #1, absolute (P)
457 T}
458 command_character       cmdch   CC      T{
459 terminal settable cmd character in prototype !?
460 T}
461 create_window   cwin    CW      T{
462 define a window #1 from #2,#3 to #4,#5
463 T}
464 cursor_address  cup     cm      T{
465 move to row #1 columns #2
466 T}
467 cursor_down     cud1    do      T{
468 down one line
469 T}
470 cursor_home     home    ho      T{
471 home cursor (if no cup)
472 T}
473 cursor_invisible        civis   vi      T{
474 make cursor invisible
475 T}
476 cursor_left     cub1    le      T{
477 move left one space
478 T}
479 cursor_mem_address      mrcup   CM      T{
480 memory relative cursor addressing, move to row #1 columns #2
481 T}
482 cursor_normal   cnorm   ve      T{
483 make cursor appear normal (undo civis/cvvis)
484 T}
485 cursor_right    cuf1    nd      T{
486 non-destructive space (move right one space)
487 T}
488 cursor_to_ll    ll      ll      T{
489 last line, first column (if no cup)
490 T}
491 cursor_up       cuu1    up      T{
492 up one line
493 T}
494 cursor_visible  cvvis   vs      T{
495 make cursor very visible
496 T}
497 define_char     defc    ZE      T{
498 Define a character #1, #2 dots wide, descender #3
499 T}
500 delete_character        dch1    dc      T{
501 delete character (P*)
502 T}
503 delete_line     dl1     dl      T{
504 delete line (P*)
505 T}
506 dial_phone      dial    DI      T{
507 dial number #1
508 T}
509 dis_status_line dsl     ds      T{
510 disable status line
511 T}
512 display_clock   dclk    DK      T{
513 display clock
514 T}
515 down_half_line  hd      hd      T{
516 half a line down
517 T}
518 ena_acs enacs   eA      T{
519 enable alternate char set
520 T}
521 enter_alt_charset_mode  smacs   as      T{
522 start alternate character set (P)
523 T}
524 enter_am_mode   smam    SA      T{
525 turn on automatic margins
526 T}
527 enter_blink_mode        blink   mb      T{
528 turn on blinking
529 T}
530 enter_bold_mode bold    md      T{
531 turn on bold (extra bright) mode
532 T}
533 enter_ca_mode   smcup   ti      T{
534 string to start programs using cup
535 T}
536 enter_delete_mode       smdc    dm      T{
537 enter delete mode
538 T}
539 enter_dim_mode  dim     mh      T{
540 turn on half-bright mode
541 T}
542 enter_doublewide_mode   swidm   ZF      T{
543 Enter double-wide mode
544 T}
545 enter_draft_quality     sdrfq   ZG      T{
546 Enter draft-quality mode
547 T}
548 enter_insert_mode       smir    im      T{
549 enter insert mode
550 T}
551 enter_italics_mode      sitm    ZH      T{
552 Enter italic mode
553 T}
554 enter_leftward_mode     slm     ZI      T{
555 Start leftward carriage motion
556 T}
557 enter_micro_mode        smicm   ZJ      T{
558 Start micro-motion mode
559 T}
560 enter_near_letter_quality       snlq    ZK      T{
561 Enter NLQ mode
562 T}
563 enter_normal_quality    snrmq   ZL      T{
564 Enter normal-quality mode
565 T}
566 enter_protected_mode    prot    mp      T{
567 turn on protected mode
568 T}
569 enter_reverse_mode      rev     mr      T{
570 turn on reverse video mode
571 T}
572 enter_secure_mode       invis   mk      T{
573 turn on blank mode (characters invisible)
574 T}
575 enter_shadow_mode       sshm    ZM      T{
576 Enter shadow-print mode
577 T}
578 enter_standout_mode     smso    so      T{
579 begin standout mode
580 T}
581 enter_subscript_mode    ssubm   ZN      T{
582 Enter subscript mode
583 T}
584 enter_superscript_mode  ssupm   ZO      T{
585 Enter superscript mode
586 T}
587 enter_underline_mode    smul    us      T{
588 begin underline mode
589 T}
590 enter_upward_mode       sum     ZP      T{
591 Start upward carriage motion
592 T}
593 enter_xon_mode  smxon   SX      T{
594 turn on xon/xoff handshaking
595 T}
596 erase_chars     ech     ec      T{
597 erase #1 characters (P)
598 T}
599 exit_alt_charset_mode   rmacs   ae      T{
600 end alternate character set (P)
601 T}
602 exit_am_mode    rmam    RA      T{
603 turn off automatic margins
604 T}
605 exit_attribute_mode     sgr0    me      T{
606 turn off all attributes
607 T}
608 exit_ca_mode    rmcup   te      T{
609 strings to end programs using cup
610 T}
611 exit_delete_mode        rmdc    ed      T{
612 end delete mode
613 T}
614 exit_doublewide_mode    rwidm   ZQ      T{
615 End double-wide mode
616 T}
617 exit_insert_mode        rmir    ei      T{
618 exit insert mode
619 T}
620 exit_italics_mode       ritm    ZR      T{
621 End italic mode
622 T}
623 exit_leftward_mode      rlm     ZS      T{
624 End left-motion mode
625 T}
626 exit_micro_mode rmicm   ZT      T{
627 End micro-motion mode
628 T}
629 exit_shadow_mode        rshm    ZU      T{
630 End shadow-print mode
631 T}
632 exit_standout_mode      rmso    se      T{
633 exit standout mode
634 T}
635 exit_subscript_mode     rsubm   ZV      T{
636 End subscript mode
637 T}
638 exit_superscript_mode   rsupm   ZW      T{
639 End superscript mode
640 T}
641 exit_underline_mode     rmul    ue      T{
642 exit underline mode
643 T}
644 exit_upward_mode        rum     ZX      T{
645 End reverse character motion
646 T}
647 exit_xon_mode   rmxon   RX      T{
648 turn off xon/xoff handshaking
649 T}
650 fixed_pause     pause   PA      T{
651 pause for 2-3 seconds
652 T}
653 flash_hook      hook    fh      T{
654 flash switch hook
655 T}
656 flash_screen    flash   vb      T{
657 visible bell (may not move cursor)
658 T}
659 form_feed       ff      ff      T{
660 hardcopy terminal page eject (P*)
661 T}
662 from_status_line        fsl     fs      T{
663 return from status line
664 T}
665 goto_window     wingo   WG      T{
666 go to window #1
667 T}
668 hangup  hup     HU      T{
669 hang-up phone
670 T}
671 init_1string    is1     i1      T{
672 initialization string
673 T}
674 init_2string    is2     is      T{
675 initialization string
676 T}
677 init_3string    is3     i3      T{
678 initialization string
679 T}
680 init_file       if      if      T{
681 name of initialization file
682 T}
683 init_prog       iprog   iP      T{
684 path name of program for initialization
685 T}
686 initialize_color        initc   Ic      T{
687 initialize color #1 to (#2,#3,#4)
688 T}
689 initialize_pair initp   Ip      T{
690 Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7)
691 T}
692 insert_character        ich1    ic      T{
693 insert character (P)
694 T}
695 insert_line     il1     al      T{
696 insert line (P*)
697 T}
698 insert_padding  ip      ip      T{
699 insert padding after inserted character
700 T}
701 key_a1  ka1     K1      T{
702 upper left of keypad
703 T}
704 key_a3  ka3     K3      T{
705 upper right of keypad
706 T}
707 key_b2  kb2     K2      T{
708 center of keypad
709 T}
710 key_backspace   kbs     kb      T{
711 backspace key
712 T}
713 key_beg kbeg    @1      T{
714 begin key
715 T}
716 key_btab        kcbt    kB      T{
717 back-tab key
718 T}
719 key_c1  kc1     K4      T{
720 lower left of keypad
721 T}
722 key_c3  kc3     K5      T{
723 lower right of keypad
724 T}
725 key_cancel      kcan    @2      T{
726 cancel key
727 T}
728 key_catab       ktbc    ka      T{
729 clear-all-tabs key
730 T}
731 key_clear       kclr    kC      T{
732 clear-screen or erase key
733 T}
734 key_close       kclo    @3      T{
735 close key
736 T}
737 key_command     kcmd    @4      T{
738 command key
739 T}
740 key_copy        kcpy    @5      T{
741 copy key
742 T}
743 key_create      kcrt    @6      T{
744 create key
745 T}
746 key_ctab        kctab   kt      T{
747 clear-tab key
748 T}
749 key_dc  kdch1   kD      T{
750 delete-character key
751 T}
752 key_dl  kdl1    kL      T{
753 delete-line key
754 T}
755 key_down        kcud1   kd      T{
756 down-arrow key
757 T}
758 key_eic krmir   kM      T{
759 sent by rmir or smir in insert mode
760 T}
761 key_end kend    @7      T{
762 end key
763 T}
764 key_enter       kent    @8      T{
765 enter/send key
766 T}
767 key_eol kel     kE      T{
768 clear-to-end-of-line key
769 T}
770 key_eos ked     kS      T{
771 clear-to-end-of-screen key
772 T}
773 key_exit        kext    @9      T{
774 exit key
775 T}
776 key_f0  kf0     k0      T{
777 F0 function key
778 T}
779 key_f1  kf1     k1      T{
780 F1 function key
781 T}
782 key_f10 kf10    k;      T{
783 F10 function key
784 T}
785 key_f11 kf11    F1      T{
786 F11 function key
787 T}
788 key_f12 kf12    F2      T{
789 F12 function key
790 T}
791 key_f13 kf13    F3      T{
792 F13 function key
793 T}
794 key_f14 kf14    F4      T{
795 F14 function key
796 T}
797 key_f15 kf15    F5      T{
798 F15 function key
799 T}
800 key_f16 kf16    F6      T{
801 F16 function key
802 T}
803 key_f17 kf17    F7      T{
804 F17 function key
805 T}
806 key_f18 kf18    F8      T{
807 F18 function key
808 T}
809 key_f19 kf19    F9      T{
810 F19 function key
811 T}
812 key_f2  kf2     k2      T{
813 F2 function key
814 T}
815 key_f20 kf20    FA      T{
816 F20 function key
817 T}
818 key_f21 kf21    FB      T{
819 F21 function key
820 T}
821 key_f22 kf22    FC      T{
822 F22 function key
823 T}
824 key_f23 kf23    FD      T{
825 F23 function key
826 T}
827 key_f24 kf24    FE      T{
828 F24 function key
829 T}
830 key_f25 kf25    FF      T{
831 F25 function key
832 T}
833 key_f26 kf26    FG      T{
834 F26 function key
835 T}
836 key_f27 kf27    FH      T{
837 F27 function key
838 T}
839 key_f28 kf28    FI      T{
840 F28 function key
841 T}
842 key_f29 kf29    FJ      T{
843 F29 function key
844 T}
845 key_f3  kf3     k3      T{
846 F3 function key
847 T}
848 key_f30 kf30    FK      T{
849 F30 function key
850 T}
851 key_f31 kf31    FL      T{
852 F31 function key
853 T}
854 key_f32 kf32    FM      T{
855 F32 function key
856 T}
857 key_f33 kf33    FN      T{
858 F33 function key
859 T}
860 key_f34 kf34    FO      T{
861 F34 function key
862 T}
863 key_f35 kf35    FP      T{
864 F35 function key
865 T}
866 key_f36 kf36    FQ      T{
867 F36 function key
868 T}
869 key_f37 kf37    FR      T{
870 F37 function key
871 T}
872 key_f38 kf38    FS      T{
873 F38 function key
874 T}
875 key_f39 kf39    FT      T{
876 F39 function key
877 T}
878 key_f4  kf4     k4      T{
879 F4 function key
880 T}
881 key_f40 kf40    FU      T{
882 F40 function key
883 T}
884 key_f41 kf41    FV      T{
885 F41 function key
886 T}
887 key_f42 kf42    FW      T{
888 F42 function key
889 T}
890 key_f43 kf43    FX      T{
891 F43 function key
892 T}
893 key_f44 kf44    FY      T{
894 F44 function key
895 T}
896 key_f45 kf45    FZ      T{
897 F45 function key
898 T}
899 key_f46 kf46    Fa      T{
900 F46 function key
901 T}
902 key_f47 kf47    Fb      T{
903 F47 function key
904 T}
905 key_f48 kf48    Fc      T{
906 F48 function key
907 T}
908 key_f49 kf49    Fd      T{
909 F49 function key
910 T}
911 key_f5  kf5     k5      T{
912 F5 function key
913 T}
914 key_f50 kf50    Fe      T{
915 F50 function key
916 T}
917 key_f51 kf51    Ff      T{
918 F51 function key
919 T}
920 key_f52 kf52    Fg      T{
921 F52 function key
922 T}
923 key_f53 kf53    Fh      T{
924 F53 function key
925 T}
926 key_f54 kf54    Fi      T{
927 F54 function key
928 T}
929 key_f55 kf55    Fj      T{
930 F55 function key
931 T}
932 key_f56 kf56    Fk      T{
933 F56 function key
934 T}
935 key_f57 kf57    Fl      T{
936 F57 function key
937 T}
938 key_f58 kf58    Fm      T{
939 F58 function key
940 T}
941 key_f59 kf59    Fn      T{
942 F59 function key
943 T}
944 key_f6  kf6     k6      T{
945 F6 function key
946 T}
947 key_f60 kf60    Fo      T{
948 F60 function key
949 T}
950 key_f61 kf61    Fp      T{
951 F61 function key
952 T}
953 key_f62 kf62    Fq      T{
954 F62 function key
955 T}
956 key_f63 kf63    Fr      T{
957 F63 function key
958 T}
959 key_f7  kf7     k7      T{
960 F7 function key
961 T}
962 key_f8  kf8     k8      T{
963 F8 function key
964 T}
965 key_f9  kf9     k9      T{
966 F9 function key
967 T}
968 key_find        kfnd    @0      T{
969 find key
970 T}
971 key_help        khlp    %1      T{
972 help key
973 T}
974 key_home        khome   kh      T{
975 home key
976 T}
977 key_ic  kich1   kI      T{
978 insert-character key
979 T}
980 key_il  kil1    kA      T{
981 insert-line key
982 T}
983 key_left        kcub1   kl      T{
984 left-arrow key
985 T}
986 key_ll  kll     kH      T{
987 lower-left key (home down)
988 T}
989 key_mark        kmrk    %2      T{
990 mark key
991 T}
992 key_message     kmsg    %3      T{
993 message key
994 T}
995 key_move        kmov    %4      T{
996 move key
997 T}
998 key_next        knxt    %5      T{
999 next key
1000 T}
1001 key_npage       knp     kN      T{
1002 next-page key
1003 T}
1004 key_open        kopn    %6      T{
1005 open key
1006 T}
1007 key_options     kopt    %7      T{
1008 options key
1009 T}
1010 key_ppage       kpp     kP      T{
1011 previous-page key
1012 T}
1013 key_previous    kprv    %8      T{
1014 previous key
1015 T}
1016 key_print       kprt    %9      T{
1017 print key
1018 T}
1019 key_redo        krdo    %0      T{
1020 redo key
1021 T}
1022 key_reference   kref    &1      T{
1023 reference key
1024 T}
1025 key_refresh     krfr    &2      T{
1026 refresh key
1027 T}
1028 key_replace     krpl    &3      T{
1029 replace key
1030 T}
1031 key_restart     krst    &4      T{
1032 restart key
1033 T}
1034 key_resume      kres    &5      T{
1035 resume key
1036 T}
1037 key_right       kcuf1   kr      T{
1038 right-arrow key
1039 T}
1040 key_save        ksav    &6      T{
1041 save key
1042 T}
1043 key_sbeg        kBEG    &9      T{
1044 shifted begin key
1045 T}
1046 key_scancel     kCAN    &0      T{
1047 shifted cancel key
1048 T}
1049 key_scommand    kCMD    *1      T{
1050 shifted command key
1051 T}
1052 key_scopy       kCPY    *2      T{
1053 shifted copy key
1054 T}
1055 key_screate     kCRT    *3      T{
1056 shifted create key
1057 T}
1058 key_sdc kDC     *4      T{
1059 shifted delete-character key
1060 T}
1061 key_sdl kDL     *5      T{
1062 shifted delete-line key
1063 T}
1064 key_select      kslt    *6      T{
1065 select key
1066 T}
1067 key_send        kEND    *7      T{
1068 shifted end key
1069 T}
1070 key_seol        kEOL    *8      T{
1071 shifted clear-to-end-of-line key
1072 T}
1073 key_sexit       kEXT    *9      T{
1074 shifted exit key
1075 T}
1076 key_sf  kind    kF      T{
1077 scroll-forward key
1078 T}
1079 key_sfind       kFND    *0      T{
1080 shifted find key
1081 T}
1082 key_shelp       kHLP    #1      T{
1083 shifted help key
1084 T}
1085 key_shome       kHOM    #2      T{
1086 shifted home key
1087 T}
1088 key_sic kIC     #3      T{
1089 shifted insert-character key
1090 T}
1091 key_sleft       kLFT    #4      T{
1092 shifted left-arrow key
1093 T}
1094 key_smessage    kMSG    %a      T{
1095 shifted message key
1096 T}
1097 key_smove       kMOV    %b      T{
1098 shifted move key
1099 T}
1100 key_snext       kNXT    %c      T{
1101 shifted next key
1102 T}
1103 key_soptions    kOPT    %d      T{
1104 shifted options key
1105 T}
1106 key_sprevious   kPRV    %e      T{
1107 shifted previous key
1108 T}
1109 key_sprint      kPRT    %f      T{
1110 shifted print key
1111 T}
1112 key_sr  kri     kR      T{
1113 scroll-backward key
1114 T}
1115 key_sredo       kRDO    %g      T{
1116 shifted redo key
1117 T}
1118 key_sreplace    kRPL    %h      T{
1119 shifted replace key
1120 T}
1121 key_sright      kRIT    %i      T{
1122 shifted right-arrow key
1123 T}
1124 key_srsume      kRES    %j      T{
1125 shifted resume key
1126 T}
1127 key_ssave       kSAV    !1      T{
1128 shifted save key
1129 T}
1130 key_ssuspend    kSPD    !2      T{
1131 shifted suspend key
1132 T}
1133 key_stab        khts    kT      T{
1134 set-tab key
1135 T}
1136 key_sundo       kUND    !3      T{
1137 shifted undo key
1138 T}
1139 key_suspend     kspd    &7      T{
1140 suspend key
1141 T}
1142 key_undo        kund    &8      T{
1143 undo key
1144 T}
1145 key_up  kcuu1   ku      T{
1146 up-arrow key
1147 T}
1148 keypad_local    rmkx    ke      T{
1149 leave 'keyboard_transmit' mode
1150 T}
1151 keypad_xmit     smkx    ks      T{
1152 enter 'keyboard_transmit' mode
1153 T}
1154 lab_f0  lf0     l0      T{
1155 label on function key f0 if not f0
1156 T}
1157 lab_f1  lf1     l1      T{
1158 label on function key f1 if not f1
1159 T}
1160 lab_f10 lf10    la      T{
1161 label on function key f10 if not f10
1162 T}
1163 lab_f2  lf2     l2      T{
1164 label on function key f2 if not f2
1165 T}
1166 lab_f3  lf3     l3      T{
1167 label on function key f3 if not f3
1168 T}
1169 lab_f4  lf4     l4      T{
1170 label on function key f4 if not f4
1171 T}
1172 lab_f5  lf5     l5      T{
1173 label on function key f5 if not f5
1174 T}
1175 lab_f6  lf6     l6      T{
1176 label on function key f6 if not f6
1177 T}
1178 lab_f7  lf7     l7      T{
1179 label on function key f7 if not f7
1180 T}
1181 lab_f8  lf8     l8      T{
1182 label on function key f8 if not f8
1183 T}
1184 lab_f9  lf9     l9      T{
1185 label on function key f9 if not f9
1186 T}
1187 label_format    fln     Lf      T{
1188 label format
1189 T}
1190 label_off       rmln    LF      T{
1191 turn off soft labels
1192 T}
1193 label_on        smln    LO      T{
1194 turn on soft labels
1195 T}
1196 meta_off        rmm     mo      T{
1197 turn off meta mode
1198 T}
1199 meta_on smm     mm      T{
1200 turn on meta mode (8th-bit on)
1201 T}
1202 micro_column_address    mhpa    ZY      T{
1203 Like column_address in micro mode
1204 T}
1205 micro_down      mcud1   ZZ      T{
1206 Like cursor_down in micro mode
1207 T}
1208 micro_left      mcub1   Za      T{
1209 Like cursor_left in micro mode
1210 T}
1211 micro_right     mcuf1   Zb      T{
1212 Like cursor_right in micro mode
1213 T}
1214 micro_row_address       mvpa    Zc      T{
1215 Like row_address #1 in micro mode
1216 T}
1217 micro_up        mcuu1   Zd      T{
1218 Like cursor_up in micro mode
1219 T}
1220 newline nel     nw      T{
1221 newline (behave like cr followed by lf)
1222 T}
1223 order_of_pins   porder  Ze      T{
1224 Match software bits to print-head pins
1225 T}
1226 orig_colors     oc      oc      T{
1227 Set all color pairs to the original ones
1228 T}
1229 orig_pair       op      op      T{
1230 Set default pair to its original value
1231 T}
1232 pad_char        pad     pc      T{
1233 padding char (instead of null)
1234 T}
1235 parm_dch        dch     DC      T{
1236 delete #1 characters (P*)
1237 T}
1238 parm_delete_line        dl      DL      T{
1239 delete #1 lines (P*)
1240 T}
1241 parm_down_cursor        cud     DO      T{
1242 down #1 lines (P*)
1243 T}
1244 parm_down_micro mcud    Zf      T{
1245 Like parm_down_cursor in micro mode
1246 T}
1247 parm_ich        ich     IC      T{
1248 insert #1 characters (P*)
1249 T}
1250 parm_index      indn    SF      T{
1251 scroll forward #1 lines (P)
1252 T}
1253 parm_insert_line        il      AL      T{
1254 insert #1 lines (P*)
1255 T}
1256 parm_left_cursor        cub     LE      T{
1257 move #1 characters to the left (P)
1258 T}
1259 parm_left_micro mcub    Zg      T{
1260 Like parm_left_cursor in micro mode
1261 T}
1262 parm_right_cursor       cuf     RI      T{
1263 move #1 characters to the right (P*)
1264 T}
1265 parm_right_micro        mcuf    Zh      T{
1266 Like parm_right_cursor in micro mode
1267 T}
1268 parm_rindex     rin     SR      T{
1269 scroll back #1 lines (P)
1270 T}
1271 parm_up_cursor  cuu     UP      T{
1272 up #1 lines (P*)
1273 T}
1274 parm_up_micro   mcuu    Zi      T{
1275 Like parm_up_cursor in micro mode
1276 T}
1277 pkey_key        pfkey   pk      T{
1278 program function key #1 to type string #2
1279 T}
1280 pkey_local      pfloc   pl      T{
1281 program function key #1 to execute string #2
1282 T}
1283 pkey_xmit       pfx     px      T{
1284 program function key #1 to transmit string #2
1285 T}
1286 plab_norm       pln     pn      T{
1287 program label #1 to show string #2
1288 T}
1289 print_screen    mc0     ps      T{
1290 print contents of screen
1291 T}
1292 prtr_non        mc5p    pO      T{
1293 turn on printer for #1 bytes
1294 T}
1295 prtr_off        mc4     pf      T{
1296 turn off printer
1297 T}
1298 prtr_on mc5     po      T{
1299 turn on printer
1300 T}
1301 pulse   pulse   PU      T{
1302 select pulse dialing
1303 T}
1304 quick_dial      qdial   QD      T{
1305 dial number #1 without checking
1306 T}
1307 remove_clock    rmclk   RC      T{
1308 remove clock
1309 T}
1310 repeat_char     rep     rp      T{
1311 repeat char #1 #2 times (P*)
1312 T}
1313 req_for_input   rfi     RF      T{
1314 send next input char (for ptys)
1315 T}
1316 reset_1string   rs1     r1      T{
1317 reset string
1318 T}
1319 reset_2string   rs2     r2      T{
1320 reset string
1321 T}
1322 reset_3string   rs3     r3      T{
1323 reset string
1324 T}
1325 reset_file      rf      rf      T{
1326 name of reset file
1327 T}
1328 restore_cursor  rc      rc      T{
1329 restore cursor to position of last save_cursor
1330 T}
1331 row_address     vpa     cv      T{
1332 vertical position #1 absolute (P)
1333 T}
1334 save_cursor     sc      sc      T{
1335 save current cursor position (P)
1336 T}
1337 scroll_forward  ind     sf      T{
1338 scroll text up (P)
1339 T}
1340 scroll_reverse  ri      sr      T{
1341 scroll text down (P)
1342 T}
1343 select_char_set scs     Zj      T{
1344 Select character set, #1
1345 T}
1346 set_attributes  sgr     sa      T{
1347 define video attributes #1-#9 (PG9)
1348 T}
1349 set_background  setb    Sb      T{
1350 Set background color #1
1351 T}
1352 set_bottom_margin       smgb    Zk      T{
1353 Set bottom margin at current line
1354 T}
1355 set_bottom_margin_parm  smgbp   Zl      T{
1356 Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom
1357 T}
1358 set_clock       sclk    SC      T{
1359 set clock, #1 hrs #2 mins #3 secs
1360 T}
1361 set_color_pair  scp     sp      T{
1362 Set current color pair to #1
1363 T}
1364 set_foreground  setf    Sf      T{
1365 Set foreground color #1
1366 T}
1367 set_left_margin smgl    ML      T{
1368 set left soft margin at current column.  See smgl. (ML is not in BSD termcap).
1369 T}
1370 set_left_margin_parm    smglp   Zm      T{
1371 Set left (right) margin at column #1
1372 T}
1373 set_right_margin        smgr    MR      T{
1374 set right soft margin at current column
1375 T}
1376 set_right_margin_parm   smgrp   Zn      T{
1377 Set right margin at column #1
1378 T}
1379 set_tab hts     st      T{
1380 set a tab in every row, current columns
1381 T}
1382 set_top_margin  smgt    Zo      T{
1383 Set top margin at current line
1384 T}
1385 set_top_margin_parm     smgtp   Zp      T{
1386 Set top (bottom) margin at row #1
1387 T}
1388 set_window      wind    wi      T{
1389 current window is lines #1-#2 cols #3-#4
1390 T}
1391 start_bit_image sbim    Zq      T{
1392 Start printing bit image graphics
1393 T}
1394 start_char_set_def      scsd    Zr      T{
1395 Start character set definition #1, with #2 characters in the set
1396 T}
1397 stop_bit_image  rbim    Zs      T{
1398 Stop printing bit image graphics
1399 T}
1400 stop_char_set_def       rcsd    Zt      T{
1401 End definition of character set #1
1402 T}
1403 subscript_characters    subcs   Zu      T{
1404 List of subscriptable characters
1405 T}
1406 superscript_characters  supcs   Zv      T{
1407 List of superscriptable characters
1408 T}
1409 tab     ht      ta      T{
1410 tab to next 8-space hardware tab stop
1411 T}
1412 these_cause_cr  docr    Zw      T{
1413 Printing any of these characters causes CR
1414 T}
1415 to_status_line  tsl     ts      T{
1416 move to status line, column #1
1417 T}
1418 tone    tone    TO      T{
1419 select touch tone dialing
1420 T}
1421 underline_char  uc      uc      T{
1422 underline char and move past it
1423 T}
1424 up_half_line    hu      hu      T{
1425 half a line up
1426 T}
1427 user0   u0      u0      T{
1428 User string #0
1429 T}
1430 user1   u1      u1      T{
1431 User string #1
1432 T}
1433 user2   u2      u2      T{
1434 User string #2
1435 T}
1436 user3   u3      u3      T{
1437 User string #3
1438 T}
1439 user4   u4      u4      T{
1440 User string #4
1441 T}
1442 user5   u5      u5      T{
1443 User string #5
1444 T}
1445 user6   u6      u6      T{
1446 User string #6
1447 T}
1448 user7   u7      u7      T{
1449 User string #7
1450 T}
1451 user8   u8      u8      T{
1452 User string #8
1453 T}
1454 user9   u9      u9      T{
1455 User string #9
1456 T}
1457 wait_tone       wait    WA      T{
1458 wait for dial-tone
1459 T}
1460 xoff_character  xoffc   XF      T{
1461 XOFF character
1462 T}
1463 xon_character   xonc    XN      T{
1464 XON character
1465 T}
1466 zero_motion     zerom   Zx      T{
1467 No motion for subsequent character
1468 T}
1469 .TE
1470 .ad
1471
1472 The following string capabilities are present in the SVr4.0 term structure,
1473 but were originally not documented in the man page.
1474
1475 .na
1476 .TS H
1477 center expand;
1478 c l l c
1479 c l l c
1480 lw25 lw6 lw2 lw18.
1481 \fBVariable     Cap-    TCap    Description\fR
1482 \fBString       name    Code\fR
1483 alt_scancode_esc        scesa   S8      T{
1484 Alternate escape for scancode emulation
1485 T}
1486 bit_image_carriage_return       bicr    Yv      T{
1487 Move to beginning of same row
1488 T}
1489 bit_image_newline       binel   Zz      T{
1490 Move to next row of the bit image
1491 T}
1492 bit_image_repeat        birep   Xy      T{
1493 Repeat bit image cell #1 #2 times
1494 T}
1495 char_set_names  csnm    Zy      T{
1496 Produce #1'th item from list of character set names
1497 T}
1498 code_set_init   csin    ci      T{
1499 Init sequence for multiple codesets
1500 T}
1501 color_names     colornm Yw      T{
1502 Give name for color #1
1503 T}
1504 define_bit_image_region defbi   Yx      T{
1505 Define rectangualar bit image region
1506 T}
1507 device_type     devt    dv      T{
1508 Indicate language/codeset support
1509 T}
1510 display_pc_char dispc   S1      T{
1511 Display PC character #1
1512 T}
1513 end_bit_image_region    endbi   Yy      T{
1514 End a bit-image region
1515 T}
1516 enter_pc_charset_mode   smpch   S2      T{
1517 Enter PC character display mode
1518 T}
1519 enter_scancode_mode     smsc    S4      T{
1520 Enter PC scancode mode
1521 T}
1522 exit_pc_charset_mode    rmpch   S3      T{
1523 Exit PC character display mode
1524 T}
1525 exit_scancode_mode      rmsc    S5      T{
1526 Exit PC scancode mode
1527 T}
1528 get_mouse       getm    Gm      T{
1529 Curses should get button events, parameter #1 not documented.
1530 T}
1531 key_mouse       kmous   Km      T{
1532 Mouse event has occurred
1533 T}
1534 mouse_info      minfo   Mi      T{
1535 Mouse status information
1536 T}
1537 pc_term_options pctrm   S6      T{
1538 PC terminal options
1539 T}
1540 pkey_plab       pfxl    xl      T{
1541 Program function key #1 to type string #2 and show string #3
1542 T}
1543 req_mouse_pos   reqmp   RQ      T{
1544 Request mouse position
1545 T}
1546 scancode_escape scesc   S7      T{
1547 Escape for scancode emulation
1548 T}
1549 set0_des_seq    s0ds    s0      T{
1550 Shift to codeset 0 (EUC set 0, ASCII)
1551 T}
1552 set1_des_seq    s1ds    s1      T{
1553 Shift to codeset 1
1554 T}
1555 set2_des_seq    s2ds    s2      T{
1556 Shift to codeset 2
1557 T}
1558 set3_des_seq    s3ds    s3      T{
1559 Shift to codeset 3
1560 T}
1561 set_a_background        setab   AB      T{
1562 Set background color to #1, using ANSI escape
1563 T}
1564 set_a_foreground        setaf   AF      T{
1565 Set foreground color to #1, using ANSI escape
1566 T}
1567 set_color_band  setcolor        Yz      T{
1568 Change to ribbon color #1
1569 T}
1570 set_lr_margin   smglr   ML      T{
1571 Set both left and right margins to #1, #2.  (ML is not in BSD termcap).
1572 T}
1573 set_page_length slines  YZ      T{
1574 Set page length to #1 lines
1575 T}
1576 set_tb_margin   smgtb   MT      T{
1577 Sets both top and bottom margins to #1, #2
1578 T}
1579 .TE
1580 .ad
1581
1582 .in .8i
1583 The XSI Curses standard added these.  They are some post-4.1 
1584 versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x.
1585 The \fBncurses\fR termcap names for them are invented; according to the
1586 XSI Curses standard, they have no termcap names.  If your compiled terminfo
1587 entries use these, they may not be binary-compatible with System V terminfo
1588 entries after SVr4.1; beware!
1589
1590 .na
1591 .TS H
1592 center expand;
1593 c l l c
1594 c l l c
1595 lw25 lw6 lw2 lw20.
1596 \fBVariable     Cap-    TCap    Description\fR
1597 \fBString       name    Code\fR
1598 enter_horizontal_hl_mode        ehhlm   Xh      T{
1599 Enter horizontal highlight mode
1600 T}
1601 enter_left_hl_mode      elhlm   Xl      T{
1602 Enter left highlight mode
1603 T}
1604 enter_low_hl_mode       elohlm  Xo      T{
1605 Enter low highlight mode
1606 T}
1607 enter_right_hl_mode     erhlm   Xr      T{
1608 Enter right highlight mode
1609 T}
1610 enter_top_hl_mode       ethlm   Xt      T{
1611 Enter top highlight mode
1612 T}
1613 enter_vertical_hl_mode  evhlm   Xv      T{
1614 Enter vertical highlight mode
1615 T}
1616 set_a_attributes        sgr1    sA      T{
1617 Define second set of video attributes #1-#6
1618 T}
1619 set_pglen_inch  slength sL      T{
1620 YI Set page length to #1 hundredth of an inch
1621 T}
1622 .TE
1623 .ad
1624 .\" $Id: terminfo.tail,v 1.38 2003/01/05 22:47:05 tom Exp $
1625 .\" Beginning of terminfo.tail file
1626 .ps +1
1627 .PP
1628 .SS A Sample Entry
1629 .PP
1630 The following entry, describing an ANSI-standard terminal, is representative
1631 of what a \fBterminfo\fR entry for a modern terminal typically looks like.
1632 .PP
1633 .nf
1634 .in -2
1635 .ta .3i
1636 .ft CW
1637 \s-2ansi|ansi/pc-term compatible with color,
1638         mc5i,
1639         colors#8, ncv#3, pairs#64,
1640         cub=\\E[%p1%dD, cud=\\E[%p1%dB, cuf=\\E[%p1%dC,
1641         cuu=\\E[%p1%dA, dch=\\E[%p1%dP, dl=\\E[%p1%dM,
1642         ech=\\E[%p1%dX, el1=\\E[1K, hpa=\\E[%p1%dG, ht=\\E[I,
1643         ich=\\E[%p1%d@, il=\\E[%p1%dL, indn=\\E[%p1%dS, .indn=\\E[%p1%dT,
1644         kbs=^H, kcbt=\\E[Z, kcub1=\\E[D, kcud1=\\E[B,
1645         kcuf1=\\E[C, kcuu1=\\E[A, kf1=\\E[M, kf10=\\E[V,
1646         kf11=\\E[W, kf12=\\E[X, kf2=\\E[N, kf3=\\E[O, kf4=\\E[P,
1647         kf5=\\E[Q, kf6=\\E[R, kf7=\\E[S, kf8=\\E[T, kf9=\\E[U,
1648         kich1=\\E[L, mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S,
1649         op=\\E[37;40m, rep=%p1%c\\E[%p2%{1}%-%db,
1650         rin=\\E[%p1%dT, s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B,
1651         s3ds=\\E+B, setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,
1652         setb=\\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
1653         setf=\\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
1654         sgr=\\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m,
1655         sgr0=\\E[0;10m, tbc=\\E[2g, u6=\\E[%d;%dR, u7=\\E[6n,
1656         u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%p1%dd,\s+2
1657 .in +2
1658 .fi
1659 .ft R
1660 .PP
1661 Entries may continue onto multiple lines by placing white space at
1662 the beginning of each line except the first.
1663 Comments may be included on lines beginning with ``#''.
1664 Capabilities in
1665 .I terminfo
1666 are of three types:
1667 Boolean capabilities which indicate that the terminal has
1668 some particular feature, numeric capabilities giving the size of the terminal
1669 or the size of particular delays, and string
1670 capabilities, which give a sequence which can be used to perform particular
1671 terminal operations.
1672 .PP
1673 .SS Types of Capabilities
1674 .PP
1675 All capabilities have names.
1676 For instance, the fact that
1677 ANSI-standard terminals have
1678 .I "automatic margins"
1679 (i.e., an automatic return and line-feed
1680 when the end of a line is reached) is indicated by the capability \fBam\fR.
1681 Hence the description of ansi includes \fBam\fR.
1682 Numeric capabilities are followed by the character `#' and then a positive value.
1683 Thus \fBcols\fR, which indicates the number of columns the terminal has,
1684 gives the value `80' for ansi.
1685 Values for numeric capabilities may be specified in decimal, octal or hexadecimal,
1686 using the C programming language conventions (e.g., 255, 0377 and 0xff or 0xFF).
1687 .PP
1688 Finally, string valued capabilities, such as \fBel\fR (clear to end of line
1689 sequence) are given by the two-character code, an `=', and then a string
1690 ending at the next following `,'.
1691 .PP
1692 A number of escape sequences are provided in the string valued capabilities
1693 for easy encoding of characters there.
1694 Both \fB\eE\fR and \fB\ee\fR
1695 map to an \s-1ESCAPE\s0 character,
1696 \fB^x\fR maps to a control-x for any appropriate x, and the sequences
1697 \fB\en \el \er \et \eb \ef \es\fR give
1698 a newline, line-feed, return, tab, backspace, form-feed, and space.
1699 Other escapes include \fB\e^\fR for \fB^\fR,
1700 \fB\e\e\fR for \fB\e\fR,
1701 \fB\e\fR, for comma,
1702 \fB\e:\fR for \fB:\fR,
1703 and \fB\e0\fR for null.
1704 (\fB\e0\fR will produce \e200, which does not terminate a string but behaves
1705 as a null character on most terminals, providing CS7 is specified.
1706 See stty(1).)
1707 Finally, characters may be given as three octal digits after a \fB\e\fR.
1708 .PP
1709 A delay in milliseconds may appear anywhere in a string capability, enclosed in
1710 $<..> brackets, as in \fBel\fP=\eEK$<5>, and padding characters are supplied by
1711 .I tputs
1712 to provide this delay.
1713 The delay must be a number with at most one decimal
1714 place of precision; it may be followed by suffixes `*' or '/' or both.
1715 A `*'
1716 indicates that the padding required is proportional to the number of lines
1717 affected by the operation, and the amount given is the per-affected-unit
1718 padding required.
1719 (In the case of insert character, the factor is still the
1720 number of
1721 .IR lines
1722 affected.)  Normally, padding is advisory if the device has the \fBxon\fR
1723 capability; it is used for cost computation but does not trigger delays.
1724 A `/'
1725 suffix indicates that the padding is mandatory and forces a delay of the given
1726 number of milliseconds even on devices for which \fBxon\fR is present to
1727 indicate flow control.
1728 .PP
1729 Sometimes individual capabilities must be commented out.
1730 To do this, put a period before the capability name.
1731 For example, see the second
1732 .B ind
1733 in the example above.
1734 .br
1735 .ne 5
1736 .PP
1737 .SS Fetching Compiled Descriptions
1738 .PP
1739 If the environment variable TERMINFO is set, it is interpreted as the pathname
1740 of a directory containing the compiled description you are working on.
1741 Only
1742 that directory is searched.
1743 .PP
1744 If TERMINFO is not set, the \fBncurses\fR version of the terminfo reader code
1745 will instead look in the directory \fB$HOME/.terminfo\fR
1746 for a compiled description.
1747 If it fails to find one there, and the environment variable TERMINFO_DIRS is
1748 set, it will interpret the contents of that variable as a list of colon-
1749 separated directories to be searched (an empty entry is interpreted as a
1750 command to search \fI\*d\fR).
1751 If no description is found in any of the
1752 TERMINFO_DIRS directories, the fetch fails.
1753 .PP
1754 If neither TERMINFO nor TERMINFO_DIRS is set, the last place tried will be the
1755 system terminfo directory, \fI\*d\fR.
1756 .PP
1757 (Neither the \fB$HOME/.terminfo\fR lookups nor TERMINFO_DIRS extensions are
1758 supported under stock System V terminfo/curses.)
1759 .PP
1760 .SS Preparing Descriptions
1761 .PP
1762 We now outline how to prepare descriptions of terminals.
1763 The most effective way to prepare a terminal description is by imitating
1764 the description of a similar terminal in
1765 .I terminfo
1766 and to build up a description gradually, using partial descriptions
1767 with
1768 .I vi
1769 or some other screen-oriented program to check that they are correct.
1770 Be aware that a very unusual terminal may expose deficiencies in
1771 the ability of the
1772 .I terminfo
1773 file to describe it
1774 or bugs in the screen-handling code of the test program.
1775 .PP
1776 To get the padding for insert line right (if the terminal manufacturer
1777 did not document it) a severe test is to edit a large file at 9600 baud,
1778 delete 16 or so lines from the middle of the screen, then hit the `u'
1779 key several times quickly.
1780 If the terminal messes up, more padding is usually needed.
1781 A similar test can be used for insert character.
1782 .PP
1783 .SS Basic Capabilities
1784 .PP
1785 The number of columns on each line for the terminal is given by the
1786 \fBcols\fR numeric capability.
1787 If the terminal is a \s-1CRT\s0, then the
1788 number of lines on the screen is given by the \fBlines\fR capability.
1789 If the terminal wraps around to the beginning of the next line when
1790 it reaches the right margin, then it should have the \fBam\fR capability.
1791 If the terminal can clear its screen, leaving the cursor in the home
1792 position, then this is given by the \fBclear\fR string capability.
1793 If the terminal overstrikes
1794 (rather than clearing a position when a character is struck over)
1795 then it should have the \fBos\fR capability.
1796 If the terminal is a printing terminal, with no soft copy unit,
1797 give it both
1798 .B hc
1799 and
1800 .BR os .
1801 .RB ( os
1802 applies to storage scope terminals, such as \s-1TEKTRONIX\s+1 4010
1803 series, as well as hard copy and APL terminals.)
1804 If there is a code to move the cursor to the left edge of the current
1805 row, give this as
1806 .BR cr .
1807 (Normally this will be carriage return, control M.)
1808 If there is a code to produce an audible signal (bell, beep, etc)
1809 give this as
1810 .BR bel .
1811 .PP
1812 If there is a code to move the cursor one position to the left
1813 (such as backspace) that capability should be given as
1814 .BR cub1 .
1815 Similarly, codes to move to the right, up, and down should be
1816 given as
1817 .BR cuf1 ,
1818 .BR cuu1 ,
1819 and
1820 .BR cud1 .
1821 These local cursor motions should not alter the text they pass over,
1822 for example, you would not normally use `\fBcuf1\fP=\ ' because the
1823 space would erase the character moved over.
1824 .PP
1825 A very important point here is that the local cursor motions encoded
1826 in
1827 .I terminfo
1828 are undefined at the left and top edges of a \s-1CRT\s0 terminal.
1829 Programs should never attempt to backspace around the left edge,
1830 unless
1831 .B bw
1832 is given,
1833 and never attempt to go up locally off the top.
1834 In order to scroll text up, a program will go to the bottom left corner
1835 of the screen and send the
1836 .B ind
1837 (index) string.
1838 .PP
1839 To scroll text down, a program goes to the top left corner
1840 of the screen and sends the
1841 .B ri
1842 (reverse index) string.
1843 The strings
1844 .B ind
1845 and
1846 .B ri
1847 are undefined when not on their respective corners of the screen.
1848 .PP
1849 Parameterized versions of the scrolling sequences are
1850 .B indn
1851 and
1852 .B rin
1853 which have the same semantics as
1854 .B ind
1855 and
1856 .B ri
1857 except that they take one parameter, and scroll that many lines.
1858 They are also undefined except at the appropriate edge of the screen.
1859 .PP
1860 The \fBam\fR capability tells whether the cursor sticks at the right
1861 edge of the screen when text is output, but this does not necessarily
1862 apply to a
1863 .B cuf1
1864 from the last column.
1865 The only local motion which is defined from the left edge is if
1866 .B bw
1867 is given, then a
1868 .B cub1
1869 from the left edge will move to the right edge of the previous row.
1870 If
1871 .B bw
1872 is not given, the effect is undefined.
1873 This is useful for drawing a box around the edge of the screen, for example.
1874 If the terminal has switch selectable automatic margins,
1875 the
1876 .I terminfo
1877 file usually assumes that this is on; i.e., \fBam\fR.
1878 If the terminal has a command which moves to the first column of the next
1879 line, that command can be given as
1880 .B nel
1881 (newline).
1882 It does not matter if the command clears the remainder of the current line,
1883 so if the terminal has no
1884 .B cr
1885 and
1886 .B lf
1887 it may still be possible to craft a working
1888 .B nel
1889 out of one or both of them.
1890 .PP
1891 These capabilities suffice to describe hard-copy and \*(lqglass-tty\*(rq terminals.
1892 Thus the model 33 teletype is described as
1893 .PP
1894 .DT
1895 .nf
1896 .ft CW
1897 .in -7
1898         \s-133\||\|tty33\||\|tty\||\|model 33 teletype,
1899         bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1
1900 .in +7
1901 .ft R
1902 .PP
1903 while the Lear Siegler \s-1ADM\-3\s0 is described as
1904 .PP
1905 .DT
1906 .nf
1907 .ft CW
1908 .in -7
1909         \s-1adm3\||\|3\||\|lsi adm3,
1910         am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
1911         ind=^J, lines#24,\s+1
1912 .in +7
1913 .ft R
1914 .fi
1915 .PP
1916 .SS Parameterized Strings
1917 .PP
1918 Cursor addressing and other strings requiring parameters
1919 in the terminal are described by a
1920 parameterized string capability, with
1921 .IR printf (3S)
1922 like escapes \fB%x\fR in it.
1923 For example, to address the cursor, the
1924 .B cup
1925 capability is given, using two parameters:
1926 the row and column to address to.
1927 (Rows and columns are numbered from zero and refer to the
1928 physical screen visible to the user, not to any unseen memory.)
1929 If the terminal has memory relative cursor addressing,
1930 that can be indicated by
1931 .BR mrcup .
1932 .PP
1933 The parameter mechanism uses a stack and special \fB%\fP codes
1934 to manipulate it.
1935 Typically a sequence will push one of the
1936 parameters onto the stack and then print it in some format.
1937 Print (e.g., "%d") is a special case.
1938 Other operations, including "%t" pop their operand from the stack.
1939 It is noted that more complex operations are often necessary,
1940 e.g., in the \fBsgr\fP string.
1941 .PP
1942 The \fB%\fR encodings have the following meanings:
1943 .PP
1944 .TP 5
1945 \s-1%%
1946 outputs `%'
1947 .TP
1948 %\fI[[\fP:\fI]flags][width[.precision]][\fPdoxXs\fI]\fP
1949 as in \fBprintf\fP, flags are [-+#] and space
1950 .TP
1951 %c
1952 print pop() like %c in \fBprintf\fP
1953 .TP
1954 %s
1955 print pop() like %s in \fBprintf\fP
1956 .TP
1957 %p[1-9]
1958 push \fIi\fP'th parameter
1959 .TP
1960 %P[a-z]
1961 set dynamic variable [a-z] to pop()
1962 .TP
1963 %g[a-z]
1964 get dynamic variable [a-z] and push it
1965 .TP
1966 %P[A-Z]
1967 set static variable [a-z] to pop()
1968 .TP
1969 %g[A-Z]
1970 get static variable [a-z] and push it
1971 .IP
1972 The terms "static" and "dynamic" are misleading.
1973 Historically, these are simply two different sets of variables,
1974 whose values are not reset between calls to \fBtparm\fP.
1975 However, that fact is not documented in other implementations.
1976 Relying on it will adversely impact portability to other implementations.
1977 .TP
1978 %'\fIc\fP'
1979 char constant \fIc\fP
1980 .TP
1981 %{\fInn\fP}
1982 integer constant \fInn\fP
1983 .TP
1984 %l
1985 push strlen(pop)
1986 .TP
1987 %+ %- %* %/ %m
1988 arithmetic (%m is mod): push(pop() op pop())
1989 .TP
1990 %& %| %^
1991 bit operations: push(pop() op pop())
1992 .TP
1993 %= %> %<
1994 logical operations: push(pop() op pop())
1995 .TP
1996 %A, %O
1997 logical and & or operations (for conditionals)
1998 .TP
1999 %! %~
2000 unary operations push(op pop())
2001 .TP
2002 %i
2003 add 1 to first two parameters (for ANSI terminals)
2004 .TP
2005 %? \fIexpr\fP %t \fIthenpart\fP %e \fIelsepart\fP %;
2006 if-then-else, %e \fIelsepart\fP is optional.
2007 else-if's are possible a la Algol 68:
2008 .br
2009 %? c\d1\u %t b\d1\u %e c\d2\u %t b\d2\u %e c\d3\u %t b\d3\u %e c\d4\u %t b\d4\u %e %;
2010 .br
2011 c\di\u are conditions, b\di\u are bodies.
2012 .PP
2013 Binary operations are in postfix form with the operands in the usual order.
2014 That is, to get x-5 one would use "%gx%{5}%-".
2015 %P and %g variables are
2016 persistent across escape-string evaluations.
2017 .PP
2018 Consider the HP2645, which, to get to row 3 and column 12, needs
2019 to be sent \eE&a12c03Y padded for 6 milliseconds.
2020 Note that the order
2021 of the rows and columns is inverted here, and that the row and column
2022 are printed as two digits.
2023 Thus its \fBcup\fR capability is \*(lqcup=6\eE&%p2%2dc%p1%2dY\*(rq.
2024 .PP
2025 The Microterm \s-1ACT-IV\s0 needs the current row and column sent
2026 preceded by a \fB^T\fR, with the row and column simply encoded in binary,
2027 \*(lqcup=^T%p1%c%p2%c\*(rq.
2028 Terminals which use \*(lq%c\*(rq need to be able to
2029 backspace the cursor (\fBcub1\fR),
2030 and to move the cursor up one line on the screen (\fBcuu1\fR).
2031 This is necessary because it is not always safe to transmit \fB\en\fR
2032 \fB^D\fR and \fB\er\fR, as the system may change or discard them.
2033 (The library routines dealing with terminfo set tty modes so that
2034 tabs are never expanded, so \et is safe to send.
2035 This turns out to be essential for the Ann Arbor 4080.)
2036 .PP
2037 A final example is the \s-1LSI ADM\s0-3a, which uses row and column
2038 offset by a blank character, thus \*(lqcup=\eE=%p1%' '%+%c%p2%' '%+%c\*(rq.
2039 After sending `\eE=', this pushes the first parameter, pushes the
2040 ASCII value for a space (32), adds them (pushing the sum on the stack
2041 in place of the two previous values) and outputs that value as a character.
2042 Then the same is done for the second parameter.
2043 More complex arithmetic is possible using the stack.
2044 .PP
2045 .SS Cursor Motions
2046 .PP
2047 If the terminal has a fast way to home the cursor
2048 (to very upper left corner of screen) then this can be given as
2049 \fBhome\fR; similarly a fast way of getting to the lower left-hand corner
2050 can be given as \fBll\fR; this may involve going up with \fBcuu1\fR
2051 from the home position,
2052 but a program should never do this itself (unless \fBll\fR does) because it
2053 can make no assumption about the effect of moving up from the home position.
2054 Note that the home position is the same as addressing to (0,0):
2055 to the top left corner of the screen, not of memory.
2056 (Thus, the \eEH sequence on HP terminals cannot be used for
2057 .BR home .)
2058 .PP
2059 If the terminal has row or column absolute cursor addressing,
2060 these can be given as single parameter capabilities
2061 .B hpa
2062 (horizontal position absolute)
2063 and
2064 .B vpa
2065 (vertical position absolute).
2066 Sometimes these are shorter than the more general two parameter
2067 sequence (as with the hp2645) and can be used in preference to
2068 .BR cup .
2069 If there are parameterized local motions (e.g., move
2070 .I n
2071 spaces to the right) these can be given as
2072 .BR cud ,
2073 .BR cub ,
2074 .BR cuf ,
2075 and
2076 .BR cuu
2077 with a single parameter indicating how many spaces to move.
2078 These are primarily useful if the terminal does not have
2079 .BR cup ,
2080 such as the \s-1TEKTRONIX\s+1 4025.
2081 .PP
2082 If the terminal needs to be in a special mode when running
2083 a program that uses these capabilities,
2084 the codes to enter and exit this mode can be given as \fBsmcup\fR and \fBrmcup\fR.
2085 This arises, for example, from terminals like the Concept with more than
2086 one page of memory.
2087 If the terminal has only memory relative cursor addressing and not screen
2088 relative cursor addressing, a one screen-sized window must be fixed into
2089 the terminal for cursor addressing to work properly.
2090 This is also used for the \s-1TEKTRONIX\s+1 4025,
2091 where
2092 .B smcup
2093 sets the command character to be the one used by terminfo.
2094 If the \fBsmcup\fP sequence will not restore the screen after an
2095 \fBrmcup\fP sequence is output (to the state prior to outputting
2096 \fBrmcup\fP), specify \fBnrrmc\fP.
2097 .PP
2098 .SS Area Clears
2099 .PP
2100 If the terminal can clear from the current position to the end of the
2101 line, leaving the cursor where it is, this should be given as \fBel\fR.
2102 If the terminal can clear from the beginning of the line to the current
2103 position inclusive, leaving
2104 the cursor where it is, this should be given as \fBel1\fP.
2105 If the terminal can clear from the current position to the end of the
2106 display, then this should be given as \fBed\fR.
2107 \fBEd\fR is only defined from the first column of a line.
2108 (Thus, it can be simulated by a request to delete a large number of lines,
2109 if a true
2110 .B ed
2111 is not available.)
2112 .PP
2113 .SS Insert/delete line and vertical motions
2114 .PP
2115 If the terminal can open a new blank line before the line where the cursor
2116 is, this should be given as \fBil1\fR; this is done only from the first
2117 position of a line.
2118 The cursor must then appear on the newly blank line.
2119 If the terminal can delete the line which the cursor is on, then this
2120 should be given as \fBdl1\fR; this is done only from the first position on
2121 the line to be deleted.
2122 Versions of
2123 .B il1
2124 and
2125 .B dl1
2126 which take a single parameter and insert or delete that many lines can
2127 be given as
2128 .B il
2129 and
2130 .BR dl .
2131 .PP
2132 If the terminal has a settable scrolling region (like the vt100)
2133 the command to set this can be described with the
2134 .B csr
2135 capability, which takes two parameters:
2136 the top and bottom lines of the scrolling region.
2137 The cursor position is, alas, undefined after using this command.
2138 .PP
2139 It is possible to get the effect of insert or delete line using
2140 .B csr
2141 on a properly chosen region; the
2142 .B sc
2143 and
2144 .B rc
2145 (save and restore cursor) commands may be useful for ensuring that
2146 your synthesized insert/delete string does not move the cursor.
2147 (Note that the \fBncurses\fR(3X) library does this synthesis
2148 automatically, so you need not compose insert/delete strings for
2149 an entry with \fBcsr\fR).
2150 .PP
2151 Yet another way to construct insert and delete might be to use a combination of
2152 index with the memory-lock feature found on some terminals (like the HP-700/90
2153 series, which however also has insert/delete).
2154 .PP
2155 Inserting lines at the top or bottom of the screen can also be
2156 done using
2157 .B ri
2158 or
2159 .B ind
2160 on many terminals without a true insert/delete line,
2161 and is often faster even on terminals with those features.
2162 .PP
2163 The boolean \fBnon_dest_scroll_region\fR should be set if each scrolling
2164 window is effectively a view port on a screen-sized canvas.
2165 To test for
2166 this capability, create a scrolling region in the middle of the screen,
2167 write something to the bottom line, move the cursor to the top of the region,
2168 and do \fBri\fR followed by \fBdl1\fR or \fBind\fR.
2169 If the data scrolled
2170 off the bottom of the region by the \fBri\fR re-appears, then scrolling
2171 is non-destructive.
2172 System V and XSI Curses expect that \fBind\fR, \fBri\fR,
2173 \fBindn\fR, and \fBrin\fR will simulate destructive scrolling; their
2174 documentation cautions you not to define \fBcsr\fR unless this is true.
2175 This \fBcurses\fR implementation is more liberal and will do explicit erases
2176 after scrolling if \fBndstr\fR is defined.
2177 .PP
2178 If the terminal has the ability to define a window as part of
2179 memory, which all commands affect,
2180 it should be given as the parameterized string
2181 .BR wind .
2182 The four parameters are the starting and ending lines in memory
2183 and the starting and ending columns in memory, in that order.
2184 .PP
2185 If the terminal can retain display memory above, then the
2186 \fBda\fR capability should be given; if display memory can be retained
2187 below, then \fBdb\fR should be given.
2188 These indicate
2189 that deleting a line or scrolling may bring non-blank lines up from below
2190 or that scrolling back with \fBri\fR may bring down non-blank lines.
2191 .PP
2192 .SS Insert/Delete Character
2193 .PP
2194 There are two basic kinds of intelligent terminals with respect to
2195 insert/delete character which can be described using
2196 .I terminfo.
2197 The most common insert/delete character operations affect only the characters
2198 on the current line and shift characters off the end of the line rigidly.
2199 Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make
2200 a distinction between typed and untyped blanks on the screen, shifting
2201 upon an insert or delete only to an untyped blank on the screen which is
2202 either eliminated, or expanded to two untyped blanks.
2203 You can determine the
2204 kind of terminal you have by clearing the screen and then typing
2205 text separated by cursor motions.
2206 Type \*(lqabc\ \ \ \ def\*(rq using local
2207 cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq.
2208 Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert
2209 mode.
2210 If typing characters causes the rest of the line to shift
2211 rigidly and characters to fall off the end, then your terminal does
2212 not distinguish between blanks and untyped positions.
2213 If the \*(lqabc\*(rq
2214 shifts over to the \*(lqdef\*(rq which then move together around the end of the
2215 current line and onto the next as you insert, you have the second type of
2216 terminal, and should give the capability \fBin\fR, which stands for
2217 \*(lqinsert null\*(rq.
2218 While these are two logically separate attributes (one line versus multi-line
2219 insert mode, and special treatment of untyped spaces) we have seen no
2220 terminals whose insert mode cannot be described with the single attribute.
2221 .PP
2222 Terminfo can describe both terminals which have an insert mode, and terminals
2223 which send a simple sequence to open a blank position on the current line.
2224 Give as \fBsmir\fR the sequence to get into insert mode.
2225 Give as \fBrmir\fR the sequence to leave insert mode.
2226 Now give as \fBich1\fR any sequence needed to be sent just before sending
2227 the character to be inserted.
2228 Most terminals with a true insert mode
2229 will not give \fBich1\fR; terminals which send a sequence to open a screen
2230 position should give it here.
2231 .PP
2232 If your terminal has both, insert mode is usually preferable to \fBich1\fR.
2233 Technically, you should not give both unless the terminal actually requires
2234 both to be used in combination.
2235 Accordingly, some non-curses applications get
2236 confused if both are present; the symptom is doubled characters in an update
2237 using insert.
2238 This requirement is now rare; most \fBich\fR sequences do not
2239 require previous smir, and most smir insert modes do not require \fBich1\fR
2240 before each character.
2241 Therefore, the new \fBcurses\fR actually assumes this
2242 is the case and uses either \fBrmir\fR/\fBsmir\fR or \fBich\fR/\fBich1\fR as
2243 appropriate (but not both).
2244 If you have to write an entry to be used under
2245 new curses for a terminal old enough to need both, include the
2246 \fBrmir\fR/\fBsmir\fR sequences in \fBich1\fR.
2247 .PP
2248 If post insert padding is needed, give this as a number of milliseconds
2249 in \fBip\fR (a string option).
2250 Any other sequence which may need to be
2251 sent after an insert of a single character may also be given in \fBip\fR.
2252 If your terminal needs both to be placed into an `insert mode' and
2253 a special code to precede each inserted character, then both
2254 .BR smir / rmir
2255 and
2256 .B ich1
2257 can be given, and both will be used.
2258 The
2259 .B ich
2260 capability, with one parameter,
2261 .IR n ,
2262 will repeat the effects of
2263 .B ich1
2264 .I n
2265 times.
2266 .PP
2267 If padding is necessary between characters typed while not
2268 in insert mode, give this as a number of milliseconds padding in \fBrmp\fP.
2269 .PP
2270 It is occasionally necessary to move around while in insert mode
2271 to delete characters on the same line (e.g., if there is a tab after
2272 the insertion position).
2273 If your terminal allows motion while in
2274 insert mode you can give the capability \fBmir\fR to speed up inserting
2275 in this case.
2276 Omitting \fBmir\fR will affect only speed.
2277 Some terminals
2278 (notably Datamedia's) must not have \fBmir\fR because of the way their
2279 insert mode works.
2280 .PP
2281 Finally, you can specify
2282 .B dch1
2283 to delete a single character,
2284 .B dch
2285 with one parameter,
2286 .IR n ,
2287 to delete
2288 .I n characters,
2289 and delete mode by giving \fBsmdc\fR and \fBrmdc\fR
2290 to enter and exit delete mode (any mode the terminal needs to be placed
2291 in for
2292 .B dch1
2293 to work).
2294 .PP
2295 A command to erase
2296 .I n
2297 characters (equivalent to outputting
2298 .I n
2299 blanks without moving the cursor)
2300 can be given as
2301 .B ech
2302 with one parameter.
2303 .PP
2304 .SS "Highlighting, Underlining, and Visible Bells"
2305 .PP
2306 If your terminal has one or more kinds of display attributes,
2307 these can be represented in a number of different ways.
2308 You should choose one display form as
2309 \f2standout mode\fR,
2310 representing a good, high contrast, easy-on-the-eyes,
2311 format for highlighting error messages and other attention getters.
2312 (If you have a choice, reverse video plus half-bright is good,
2313 or reverse video alone.)
2314 The sequences to enter and exit standout mode
2315 are given as \fBsmso\fR and \fBrmso\fR, respectively.
2316 If the code to change into or out of standout
2317 mode leaves one or even two blank spaces on the screen,
2318 as the TVI 912 and Teleray 1061 do,
2319 then \fBxmc\fR should be given to tell how many spaces are left.
2320 .PP
2321 Codes to begin underlining and end underlining can be given as \fBsmul\fR
2322 and \fBrmul\fR respectively.
2323 If the terminal has a code to underline the current character and move
2324 the cursor one space to the right,
2325 such as the Microterm Mime,
2326 this can be given as \fBuc\fR.
2327 .PP
2328 Other capabilities to enter various highlighting modes include
2329 .B blink
2330 (blinking)
2331 .B bold
2332 (bold or extra bright)
2333 .B dim
2334 (dim or half-bright)
2335 .B invis
2336 (blanking or invisible text)
2337 .B prot
2338 (protected)
2339 .B rev
2340 (reverse video)
2341 .B sgr0
2342 (turn off
2343 .I all
2344 attribute modes)
2345 .B smacs
2346 (enter alternate character set mode)
2347 and
2348 .B rmacs
2349 (exit alternate character set mode).
2350 Turning on any of these modes singly may or may not turn off other modes.
2351 .PP
2352 If there is a sequence to set arbitrary combinations of modes,
2353 this should be given as
2354 .B sgr
2355 (set attributes),
2356 taking 9 parameters.
2357 Each parameter is either 0 or nonzero, as the corresponding attribute is on or off.
2358 The 9 parameters are, in order:
2359 standout, underline, reverse, blink, dim, bold, blank, protect, alternate
2360 character set.
2361 Not all modes need be supported by
2362 .BR sgr ,
2363 only those for which corresponding separate attribute commands exist.
2364 .PP
2365 For example, the DEC vt220 supports most of the modes:
2366 .PP
2367 .TS
2368 center;
2369 l c c
2370 l c c
2371 lw28 lw6 lw2 lw20.
2372 \fBtparm parameter      attribute       escape sequence\fP
2373
2374 none    none    \\E[0m
2375 p1      standout        \\E[0;1;7m
2376 p2      underline       \\E[0;4m
2377 p3      reverse \\E[0;7m
2378 p4      blink   \\E[0;5m
2379 p5      dim     not available
2380 p6      bold    \\E[0;1m
2381 p7      invis   \\E[0;8m
2382 p8      protect not used
2383 p9      altcharset      ^O (off) ^N (on)
2384 .TE
2385 .PP
2386 We begin each escape sequence by turning off any existing modes, since
2387 there is no quick way to determine whether they are active.
2388 Standout is set up to be the combination of reverse and bold.
2389 The vt220 terminal has a protect mode,
2390 though it is not commonly used in sgr
2391 because it protects characters on the screen from the host's erasures.
2392 The altcharset mode also is different in that it is either ^O or ^N,
2393 depending on whether it is off or on.
2394 If all modes are turned on, the resulting sequence is \\E[0;1;4;5;7;8m^N.
2395 .PP
2396 Some sequences are common to different modes.
2397 For example, ;7 is output when either p1 or p3 is true, that is, if
2398 either standout or reverse modes are turned on.
2399 .PP
2400 Writing out the above sequences, along with their dependencies yields
2401 .PP
2402 .TS
2403 center;
2404 l c c
2405 l c c
2406 lw28 lw6 lw2 lw20.
2407 \fBsequence     when to output  terminfo translation\fP
2408
2409 \\E[0   always  \\E[0
2410 ;1      if p1 or p6     %?%p1%p6%|%t;1%;
2411 ;4      if p2   %?%p2%|%t;4%;
2412 ;5      if p4   %?%p4%|%t;5%;
2413 ;7      if p1 or p3     %?%p1%p3%|%t;7%;
2414 ;8      if p7   %?%p7%|%t;8%;
2415 m       always  m
2416 ^N or ^O        if p9 ^N, else ^O       %?%p9%t^N%e^O%;
2417 .TE
2418 .PP
2419 Putting this all together into the sgr sequence gives:
2420 .PP
2421 .nf
2422     sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;
2423         %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;,
2424 .fi
2425 .PP
2426 Remember that if you specify sgr, you must also specify sgr0.
2427 .PP
2428 Terminals with the ``magic cookie'' glitch
2429 .RB ( xmc )
2430 deposit special ``cookies'' when they receive mode-setting sequences,
2431 which affect the display algorithm rather than having extra bits for
2432 each character.
2433 Some terminals, such as the HP 2621, automatically leave standout
2434 mode when they move to a new line or the cursor is addressed.
2435 Programs using standout mode should exit standout mode before
2436 moving the cursor or sending a newline,
2437 unless the
2438 .B msgr
2439 capability, asserting that it is safe to move in standout mode, is present.
2440 .PP
2441 If the terminal has
2442 a way of flashing the screen to indicate an error quietly (a bell replacement)
2443 then this can be given as \fBflash\fR; it must not move the cursor.
2444 .PP
2445 If the cursor needs to be made more visible than normal when it is
2446 not on the bottom line (to make, for example, a non-blinking underline into an
2447 easier to find block or blinking underline)
2448 give this sequence as
2449 .BR cvvis .
2450 If there is a way to make the cursor completely invisible, give that as
2451 .BR civis .
2452 The capability
2453 .BR cnorm
2454 should be given which undoes the effects of both of these modes.
2455 .PP
2456 If your terminal correctly generates underlined characters
2457 (with no special codes needed)
2458 even though it does not overstrike,
2459 then you should give the capability \fBul\fR.
2460 If a character overstriking another leaves both characters on the screen,
2461 specify the capability \fBos\fP.
2462 If overstrikes are erasable with a blank,
2463 then this should be indicated by giving \fBeo\fR.
2464 .PP
2465 .SS Keypad and Function Keys
2466 .PP
2467 If the terminal has a keypad that transmits codes when the keys are pressed,
2468 this information can be given.
2469 Note that it is not possible to handle
2470 terminals where the keypad only works in local (this applies, for example,
2471 to the unshifted HP 2621 keys).
2472 If the keypad can be set to transmit or not transmit,
2473 give these codes as \fBsmkx\fR and \fBrmkx\fR.
2474 Otherwise the keypad is assumed to always transmit.
2475 The codes sent by the left arrow, right arrow, up arrow, down arrow,
2476 and home keys can be given as
2477 \fBkcub1, kcuf1, kcuu1, kcud1, \fRand\fB khome\fR respectively.
2478 If there are function keys such as f0, f1, ..., f10, the codes they send
2479 can be given as \fBkf0, kf1, ..., kf10\fR.
2480 If these keys have labels other than the default f0 through f10, the labels
2481 can be given as \fBlf0, lf1, ..., lf10\fR.
2482 The codes transmitted by certain other special keys can be given:
2483 .B kll
2484 (home down),
2485 .B kbs
2486 (backspace),
2487 .B ktbc
2488 (clear all tabs),
2489 .B kctab
2490 (clear the tab stop in this column),
2491 .B kclr
2492 (clear screen or erase key),
2493 .B kdch1
2494 (delete character),
2495 .B kdl1
2496 (delete line),
2497 .B krmir
2498 (exit insert mode),
2499 .B kel
2500 (clear to end of line),
2501 .B ked
2502 (clear to end of screen),
2503 .B kich1
2504 (insert character or enter insert mode),
2505 .B kil1
2506 (insert line),
2507 .B knp
2508 (next page),
2509 .B kpp
2510 (previous page),
2511 .B kind
2512 (scroll forward/down),
2513 .B kri
2514 (scroll backward/up),
2515 .B khts
2516 (set a tab stop in this column).
2517 In addition, if the keypad has a 3 by 3 array of keys including the four
2518 arrow keys, the other five keys can be given as
2519 .BR ka1 ,
2520 .BR ka3 ,
2521 .BR kb2 ,
2522 .BR kc1 ,
2523 and
2524 .BR kc3 .
2525 These keys are useful when the effects of a 3 by 3 directional pad are needed.
2526 .PP
2527 Strings to program function keys can be given as
2528 .BR pfkey ,
2529 .BR pfloc ,
2530 and
2531 .BR pfx .
2532 A string to program screen labels should be specified as \fBpln\fP.
2533 Each of these strings takes two parameters: the function key number to
2534 program (from 0 to 10) and the string to program it with.
2535 Function key numbers out of this range may program undefined keys in
2536 a terminal dependent manner.
2537 The difference between the capabilities is that
2538 .B pfkey
2539 causes pressing the given key to be the same as the user typing the
2540 given string;
2541 .B pfloc
2542 causes the string to be executed by the terminal in local; and
2543 .B pfx
2544 causes the string to be transmitted to the computer.
2545 .PP
2546 The capabilities \fBnlab\fP, \fBlw\fP and \fBlh\fP
2547 define the number of programmable
2548 screen labels and their width and height.
2549 If there are commands to turn the labels on and off,
2550 give them in \fBsmln\fP and \fBrmln\fP.
2551 \fBsmln\fP is normally output after one or more pln
2552 sequences to make sure that the change becomes visible.
2553 .PP
2554 .SS Tabs and Initialization
2555 .PP
2556 If the terminal has hardware tabs, the command to advance to the next
2557 tab stop can be given as
2558 .B ht
2559 (usually control I).
2560 A ``back-tab'' command which moves leftward to the preceding tab stop can
2561 be given as
2562 .BR cbt .
2563 By convention, if the teletype modes indicate that tabs are being
2564 expanded by the computer rather than being sent to the terminal,
2565 programs should not use
2566 .B ht
2567 or
2568 .B cbt
2569 even if they are present, since the user may not have the tab stops
2570 properly set.
2571 If the terminal has hardware tabs which are initially set every
2572 .I n
2573 spaces when the terminal is powered up,
2574 the numeric parameter
2575 .B it
2576 is given, showing the number of spaces the tabs are set to.
2577 This is normally used by the
2578 .IR tset
2579 command to determine whether to set the mode for hardware tab expansion,
2580 and whether to set the tab stops.
2581 If the terminal has tab stops that can be saved in non-volatile memory,
2582 the terminfo description can assume that they are properly set.
2583 .PP
2584 Other capabilities
2585 include
2586 .BR is1 ,
2587 .BR is2 ,
2588 and
2589 .BR is3 ,
2590 initialization strings for the terminal,
2591 .BR iprog ,
2592 the path name of a program to be run to initialize the terminal,
2593 and \fBif\fR, the name of a file containing long initialization strings.
2594 These strings are expected to set the terminal into modes consistent
2595 with the rest of the terminfo description.
2596 They are normally sent to the terminal, by the
2597 .I init
2598 option of the
2599 .IR tput
2600 program, each time the user logs in.
2601 They will be printed in the following order:
2602 run the program
2603 .BR iprog ;
2604 output
2605 .BR is1 ;
2606 .BR is2 ;
2607 set the margins using
2608 .BR mgc ,
2609 .BR smgl
2610 and
2611 .BR smgr ;
2612 set tabs using
2613 .B tbc
2614 and
2615 .BR hts ;
2616 print the file
2617 .BR if ;
2618 and finally
2619 output
2620 .BR is3 .
2621 .PP
2622 Most initialization is done with
2623 .BR is2 .
2624 Special terminal modes can be set up without duplicating strings
2625 by putting the common sequences in
2626 .B is2
2627 and special cases in
2628 .B is1
2629 and
2630 .BR is3 .
2631 A pair of sequences that does a harder reset from a totally unknown state
2632 can be analogously given as
2633 .BR rs1 ,
2634 .BR rs2 ,
2635 .BR rf ,
2636 and
2637 .BR rs3 ,
2638 analogous to
2639 .B is2
2640 and
2641 .BR if .
2642 These strings are output by the
2643 .IR reset
2644 program, which is used when the terminal gets into a wedged state.
2645 Commands are normally placed in
2646 .BR rs1 ,
2647 .BR rs2
2648 .B rs3
2649 and
2650 .B rf
2651 only if they produce annoying effects on the screen and are not
2652 necessary when logging in.
2653 For example, the command to set the vt100 into 80-column mode would
2654 normally be part of
2655 .BR is2 ,
2656 but it causes an annoying glitch of the screen and is not normally
2657 needed since the terminal is usually already in 80 column mode.
2658 .PP
2659 If there are commands to set and clear tab stops, they can be given as
2660 .B tbc
2661 (clear all tab stops)
2662 and
2663 .B hts
2664 (set a tab stop in the current column of every row).
2665 If a more complex sequence is needed to set the tabs than can be
2666 described by this, the sequence can be placed in
2667 .B is2
2668 or
2669 .BR if .
2670 .SS Delays and Padding
2671 .PP
2672 Many older and slower terminals don't support either XON/XOFF or DTR
2673 handshaking, including hard copy terminals and some very archaic CRTs
2674 (including, for example, DEC VT100s).
2675 These may require padding characters
2676 after certain cursor motions and screen changes.
2677 .PP
2678 If the terminal uses xon/xoff handshaking for flow control (that is,
2679 it automatically emits ^S back to the host when its input buffers are
2680 close to full), set
2681 .BR xon .
2682 This capability suppresses the emission of padding.
2683 You can also set it
2684 for memory-mapped console devices effectively that don't have a speed limit.
2685 Padding information should still be included so that routines can
2686 make better decisions about relative costs, but actual pad characters will
2687 not be transmitted.
2688 .PP
2689 If \fBpb\fR (padding baud rate) is given, padding is suppressed at baud rates
2690 below the value of \fBpb\fR.
2691 If the entry has no padding baud rate, then
2692 whether padding is emitted or not is completely controlled by \fBxon\fR.
2693 .PP
2694 If the terminal requires other than a null (zero) character as a pad,
2695 then this can be given as \fBpad\fR.
2696 Only the first character of the
2697 .B pad
2698 string is used.
2699 .PP
2700 .SS Status Lines
2701 Some terminals have an extra `status line' which is not normally used by
2702 software (and thus not counted in the terminal's \fBlines\fR capability).
2703 .PP
2704 The simplest case is a status line which is cursor-addressable but not
2705 part of the main scrolling region on the screen; the Heathkit H19 has
2706 a status line of this kind, as would a 24-line VT100 with a 23-line
2707 scrolling region set up on initialization.
2708 This situation is indicated
2709 by the \fBhs\fR capability.
2710 .PP
2711 Some terminals with status lines need special sequences to access the
2712 status line.
2713 These may be expressed as a string with single parameter
2714 \fBtsl\fR which takes the cursor to a given zero-origin column on the
2715 status line.
2716 The capability \fBfsl\fR must return to the main-screen
2717 cursor positions before the last \fBtsl\fR.
2718 You may need to embed the
2719 string values of \fBsc\fR (save cursor) and \fBrc\fR (restore cursor)
2720 in \fBtsl\fR and \fBfsl\fR to accomplish this.
2721 .PP
2722 The status line is normally assumed to be the same width as the width
2723 of the terminal.
2724 If this is untrue, you can specify it with the numeric
2725 capability \fBwsl\fR.
2726 .PP
2727 A command to erase or blank the status line may be specified as \fBdsl\fR.
2728 .PP
2729 The boolean capability \fBeslok\fR specifies that escape sequences, tabs,
2730 etc., work ordinarily in the status line.
2731 .PP
2732 The \fBncurses\fR implementation does not yet use any of these capabilities.
2733 They are documented here in case they ever become important.
2734 .PP
2735 .SS Line Graphics
2736 .PP
2737 Many terminals have alternate character sets useful for forms-drawing.
2738 Terminfo and \fBcurses\fR build in support for the drawing characters
2739 supported by the VT100, with some characters from the AT&T 4410v1 added.
2740 This alternate character set may be specified by the \fBacsc\fR capability.
2741 .PP
2742 .TS H
2743 center expand;
2744 c l l c
2745 c l l c
2746 lw28 lw6 lw2 lw20.
2747 .\".TH
2748 \fBGlyph        ACS     Ascii   VT100\fR
2749 \fBName Name    Default Name\fR
2750 UK pound sign           ACS_STERLING    f       }
2751 arrow pointing down     ACS_DARROW      v       .
2752 arrow pointing left     ACS_LARROW      <       ,
2753 arrow pointing right    ACS_RARROW      >       +
2754 arrow pointing up       ACS_UARROW      ^       -
2755 board of squares        ACS_BOARD       #       h
2756 bullet                  ACS_BULLET      o       ~
2757 checker board (stipple) ACS_CKBOARD     :       a
2758 degree symbol           ACS_DEGREE      \e      f
2759 diamond                 ACS_DIAMOND     +       `
2760 greater-than-or-equal-to        ACS_GEQUAL      >       z
2761 greek pi                ACS_PI  *       {
2762 horizontal line         ACS_HLINE       -       q
2763 lantern symbol          ACS_LANTERN     #       i
2764 large plus or crossover ACS_PLUS        +       n
2765 less-than-or-equal-to   ACS_LEQUAL      <       y
2766 lower left corner       ACS_LLCORNER    +       m
2767 lower right corner      ACS_LRCORNER    +       j
2768 not-equal               ACS_NEQUAL      !       |
2769 plus/minus              ACS_PLMINUS     #       g
2770 scan line 1             ACS_S1          ~       o
2771 scan line 3             ACS_S3          -       p
2772 scan line 7             ACS_S7          -       r
2773 scan line 9             ACS_S9          \&_     s
2774 solid square block      ACS_BLOCK       #       0
2775 tee pointing down       ACS_TTEE        +       w
2776 tee pointing left       ACS_RTEE        +       u
2777 tee pointing right      ACS_LTEE        +       t
2778 tee pointing up         ACS_BTEE        +       v
2779 upper left corner       ACS_ULCORNER    +       l
2780 upper right corner      ACS_URCORNER    +       k
2781 vertical line           ACS_VLINE       |       x
2782 .TE
2783 .PP
2784 The best way to define a new device's graphics set is to add a column
2785 to a copy of this table for your terminal, giving the character which
2786 (when emitted between \fBsmacs\fR/\fBrmacs\fR switches) will be rendered
2787 as the corresponding graphic.
2788 Then read off the VT100/your terminal
2789 character pairs right to left in sequence; these become the ACSC string.
2790 .PP
2791 .SS Color Handling
2792 .PP
2793 Most color terminals are either `Tektronix-like' or `HP-like'.
2794 Tektronix-like
2795 terminals have a predefined set of N colors (where N usually 8), and can set
2796 character-cell foreground and background characters independently, mixing them
2797 into N * N color-pairs.
2798 On HP-like terminals, the use must set each color
2799 pair up separately (foreground and background are not independently settable).
2800 Up to M color-pairs may be set up from 2*M different colors.
2801 ANSI-compatible
2802 terminals are Tektronix-like.
2803 .PP
2804 Some basic color capabilities are independent of the color method.
2805 The numeric
2806 capabilities \fBcolors\fR and \fBpairs\fR specify the maximum numbers of colors
2807 and color-pairs that can be displayed simultaneously.
2808 The \fBop\fR (original
2809 pair) string resets foreground and background colors to their default values
2810 for the terminal.
2811 The \fBoc\fR string resets all colors or color-pairs to
2812 their default values for the terminal.
2813 Some terminals (including many PC
2814 terminal emulators) erase screen areas with the current background color rather
2815 than the power-up default background; these should have the boolean capability
2816 \fBbce\fR.
2817 .PP
2818 To change the current foreground or background color on a Tektronix-type
2819 terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI
2820 background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background).
2821 These take one parameter, the color number.
2822 The SVr4 documentation describes
2823 only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal
2824 supports ANSI escape sequences to set background and foreground, they should
2825 be coded as \fBsetaf\fR and \fBsetab\fR, respectively.
2826 If the terminal
2827 supports other escape sequences to set background and foreground, they should
2828 be coded as \fBsetf\fR and \fBsetb\fR, respectively.
2829 The \fIvidputs()\fR
2830 function and the refresh functions use \fBsetaf\fR and \fBsetab\fR if they are
2831 defined."
2832 .PP
2833 The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a
2834 single numeric argument each.
2835 Argument values 0-7 of \fBsetaf\fR/\fBsetab\fR are portably defined as
2836 follows (the middle column is the symbolic #define available in the header for
2837 the \fBcurses\fR or \fBncurses\fR libraries).
2838 The terminal hardware is free to
2839 map these as it likes, but the RGB values indicate normal locations in color
2840 space.
2841 .PP
2842 .TS H
2843 center;
2844 l c c c
2845 l l n l.
2846 \fBColor        #define         Value   RGB\fR
2847 black   \fBCOLOR_BLACK\fR       0       0, 0, 0
2848 red     \fBCOLOR_RED\ \fR       1       max,0,0
2849 green   \fBCOLOR_GREEN\fR       2       0,max,0
2850 yellow  \fBCOLOR_YELLOW\fR      3       max,max,0
2851 blue    \fBCOLOR_BLUE\fR        4       0,0,max
2852 magenta \fBCOLOR_MAGENTA\fR     5       max,0,max
2853 cyan    \fBCOLOR_CYAN\fR        6       0,max,max
2854 white   \fBCOLOR_WHITE\fR       7       max,max,max
2855 .TE
2856 .PP
2857 The argument values of \fBsetf\fR/\fBsetb\fR historically correspond to
2858 a different mapping, i.e.,
2859 .TS H
2860 center;
2861 l c c c
2862 l l n l.
2863 \fBColor        #define         Value   RGB\fR
2864 black   \fBCOLOR_BLACK\fR       0       0, 0, 0
2865 blue    \fBCOLOR_BLUE\fR        1       0,0,max
2866 green   \fBCOLOR_GREEN\fR       2       0,max,0
2867 cyan    \fBCOLOR_CYAN\fR        3       0,max,max
2868 red     \fBCOLOR_RED\ \fR       4       max,0,0
2869 magenta \fBCOLOR_MAGENTA\fR     5       max,0,max
2870 yellow  \fBCOLOR_YELLOW\fR      6       max,max,0
2871 white   \fBCOLOR_WHITE\fR       7       max,max,max
2872 .TE
2873 It is important to not confuse the two sets of color capabilities;
2874 otherwise red/blue will be interchanged on the display.
2875 .PP
2876 On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set
2877 which color pair is current.
2878 .PP
2879 On a Tektronix-like terminal, the capability \fBccc\fR may be present to
2880 indicate that colors can be modified.
2881 If so, the \fBinitc\fR capability will
2882 take a color number (0 to \fBcolors\fR - 1)and three more parameters which
2883 describe the color.
2884 These three parameters default to being interpreted as RGB
2885 (Red, Green, Blue) values.
2886 If the boolean capability \fBhls\fR is present,
2887 they are instead as HLS (Hue, Lightness, Saturation) indices.
2888 The ranges are
2889 terminal-dependent.
2890 .PP
2891 On an HP-like terminal, \fBinitp\fR may give a capability for changing a
2892 color-pair value.
2893 It will take seven parameters; a color-pair number (0 to
2894 \fBmax_pairs\fR - 1), and two triples describing first background and then
2895 foreground colors.
2896 These parameters must be (Red, Green, Blue) or
2897 (Hue, Lightness, Saturation) depending on \fBhls\fR.
2898 .PP
2899 On some color terminals, colors collide with highlights.
2900 You can register
2901 these collisions with the \fBncv\fR capability.
2902 This is a bit-mask of
2903 attributes not to be used when colors are enabled.
2904 The correspondence with the
2905 attributes understood by \fBcurses\fR is as follows:
2906 .PP
2907 .TS
2908 center;
2909 l c c
2910 lw25 lw2 lw10.
2911 \fBAttribute    Bit     Decimal\fR
2912 A_STANDOUT      0       1
2913 A_UNDERLINE     1       2
2914 A_REVERSE       2       4
2915 A_BLINK         3       8
2916 A_DIM           4       16
2917 A_BOLD          5       32
2918 A_INVIS         6       64
2919 A_PROTECT       7       128
2920 A_ALTCHARSET    8       256
2921 .TE
2922 .PP
2923 For example, on many IBM PC consoles, the underline attribute collides with the
2924 foreground color blue and is not available in color mode.
2925 These should have
2926 an \fBncv\fR capability of 2.
2927 .PP
2928 SVr4 curses does nothing with \fBncv\fR, ncurses recognizes it and optimizes
2929 the output in favor of colors.
2930 .PP
2931 .SS Miscellaneous
2932 If the terminal requires other than a null (zero) character as a pad, then this
2933 can be given as pad.
2934 Only the first character of the pad string is used.
2935 If the terminal does not have a pad character, specify npc.
2936 Note that ncurses implements the termcap-compatible \fBPC\fR variable;
2937 though the application may set this value to something other than
2938 a null, ncurses will test \fBnpc\fR first and use napms if the terminal
2939 has no pad character.
2940 .PP
2941 If the terminal can move up or down half a line,
2942 this can be indicated with
2943 .B hu
2944 (half-line up)
2945 and
2946 .B hd
2947 (half-line down).
2948 This is primarily useful for superscripts and subscripts on hard-copy terminals.
2949 If a hard-copy terminal can eject to the next page (form feed), give this as
2950 .B ff
2951 (usually control L).
2952 .PP
2953 If there is a command to repeat a given character a given number of
2954 times (to save time transmitting a large number of identical characters)
2955 this can be indicated with the parameterized string
2956 .BR rep .
2957 The first parameter is the character to be repeated and the second
2958 is the number of times to repeat it.
2959 Thus, tparm(repeat_char, 'x', 10) is the same as `xxxxxxxxxx'.
2960 .PP
2961 If the terminal has a settable command character, such as the \s-1TEKTRONIX\s+1 4025,
2962 this can be indicated with
2963 .BR cmdch .
2964 A prototype command character is chosen which is used in all capabilities.
2965 This character is given in the
2966 .B cmdch
2967 capability to identify it.
2968 The following convention is supported on some UNIX systems:
2969 The environment is to be searched for a
2970 .B CC
2971 variable, and if found, all
2972 occurrences of the prototype character are replaced with the character
2973 in the environment variable.
2974 .PP
2975 Terminal descriptions that do not represent a specific kind of known
2976 terminal, such as
2977 .IR switch ,
2978 .IR dialup ,
2979 .IR patch ,
2980 and
2981 .IR network ,
2982 should include the
2983 .B gn
2984 (generic) capability so that programs can complain that they do not know
2985 how to talk to the terminal.
2986 (This capability does not apply to
2987 .I virtual
2988 terminal descriptions for which the escape sequences are known.)
2989 .PP
2990 If the terminal has a ``meta key'' which acts as a shift key,
2991 setting the 8th bit of any character transmitted, this fact can
2992 be indicated with
2993 .BR km .
2994 Otherwise, software will assume that the 8th bit is parity and it
2995 will usually be cleared.
2996 If strings exist to turn this ``meta mode'' on and off, they
2997 can be given as
2998 .B smm
2999 and
3000 .BR rmm .
3001 .PP
3002 If the terminal has more lines of memory than will fit on the screen
3003 at once, the number of lines of memory can be indicated with
3004 .BR lm .
3005 A value of
3006 .BR lm #0
3007 indicates that the number of lines is not fixed,
3008 but that there is still more memory than fits on the screen.
3009 .PP
3010 If the terminal is one of those supported by the \s-1UNIX\s+1 virtual
3011 terminal protocol, the terminal number can be given as
3012 .BR vt .
3013 .PP
3014 Media copy
3015 strings which control an auxiliary printer connected to the terminal
3016 can be given as
3017 .BR mc0 :
3018 print the contents of the screen,
3019 .BR mc4 :
3020 turn off the printer, and
3021 .BR mc5 :
3022 turn on the printer.
3023 When the printer is on, all text sent to the terminal will be sent
3024 to the printer.
3025 It is undefined whether the text is also displayed on the terminal screen
3026 when the printer is on.
3027 A variation
3028 .B mc5p
3029 takes one parameter, and leaves the printer on for as many characters
3030 as the value of the parameter, then turns the printer off.
3031 The parameter should not exceed 255.
3032 All text, including
3033 .BR mc4 ,
3034 is transparently passed to the printer while an
3035 .B mc5p
3036 is in effect.
3037 .PP
3038 .SS Glitches and Braindamage
3039 .PP
3040 Hazeltine terminals, which do not allow `~' characters to be displayed should
3041 indicate \fBhz\fR.
3042 .PP
3043 Terminals which ignore a line-feed immediately after an \fBam\fR wrap,
3044 such as the Concept and vt100,
3045 should indicate \fBxenl\fR.
3046 .PP
3047 If
3048 .B el
3049 is required to get rid of standout
3050 (instead of merely writing normal text on top of it),
3051 \fBxhp\fP should be given.
3052 .PP
3053 Teleray terminals, where tabs turn all characters moved over to blanks,
3054 should indicate \fBxt\fR (destructive tabs).
3055 Note: the variable indicating this is now `dest_tabs_magic_smso'; in
3056 older versions, it was teleray_glitch.
3057 This glitch is also taken to mean that it is not possible to position
3058 the cursor on top of a ``magic cookie'',
3059 that to erase standout mode it is instead necessary to use
3060 delete and insert line.
3061 The ncurses implementation ignores this glitch.
3062 .PP
3063 The Beehive Superbee, which is unable to correctly transmit the escape
3064 or control C characters, has
3065 .BR xsb ,
3066 indicating that the f1 key is used for escape and f2 for control C.
3067 (Only certain Superbees have this problem, depending on the ROM.)
3068 Note that in older terminfo versions, this capability was called
3069 `beehive_glitch'; it is now `no_esc_ctl_c'.
3070 .PP
3071 Other specific terminal problems may be corrected by adding more
3072 capabilities of the form \fBx\fR\fIx\fR.
3073 .PP
3074 .SS Similar Terminals
3075 .PP
3076 If there are two very similar terminals, one (the variant) can be defined as
3077 being just like the other (the base) with certain exceptions.
3078 In the
3079 definition of the variant, the string capability \fBuse\fR can be given with
3080 the name of the base terminal.
3081 The capabilities given before
3082 .B use
3083 override those in the base type named by
3084 .BR use .
3085 If there are multiple \fBuse\fR capabilities, they are merged in reverse order.
3086 That is, the rightmost \fBuse\fR reference is processed first, then the one to
3087 its left, and so forth.
3088 Capabilities given explicitly in the entry override
3089 those brought in by \fBuse\fR references.
3090 .PP
3091 A capability can be canceled by placing \fBxx@\fR to the left of the
3092 use reference that imports it, where \fIxx\fP is the capability.
3093 For example, the entry
3094 .PP
3095         2621-nl, smkx@, rmkx@, use=2621,
3096 .PP
3097 defines a 2621-nl that does not have the \fBsmkx\fR or \fBrmkx\fR capabilities,
3098 and hence does not turn on the function key labels when in visual mode.
3099 This is useful for different modes for a terminal, or for different
3100 user preferences.
3101 .PP
3102 .SS Pitfalls of Long Entries
3103 .PP
3104 Long terminfo entries are unlikely to be a problem; to date, no entry has even
3105 approached terminfo's 4K string-table maximum.
3106 Unfortunately, the termcap
3107 translations are much more strictly limited (to 1K), thus termcap translations
3108 of long terminfo entries can cause problems.
3109 .PP
3110 The man pages for 4.3BSD and older versions of tgetent() instruct the user to
3111 allocate a 1K buffer for the termcap entry.
3112 The entry gets null-terminated by
3113 the termcap library, so that makes the maximum safe length for a termcap entry
3114 1k-1 (1023) bytes.
3115 Depending on what the application and the termcap library
3116 being used does, and where in the termcap file the terminal type that tgetent()
3117 is searching for is, several bad things can happen.
3118 .PP
3119 Some termcap libraries print a warning message or exit if they find an
3120 entry that's longer than 1023 bytes; others don't; others truncate the
3121 entries to 1023 bytes.
3122 Some application programs allocate more than
3123 the recommended 1K for the termcap entry; others don't.
3124 .PP
3125 Each termcap entry has two important sizes associated with it: before
3126 "tc" expansion, and after "tc" expansion.
3127 "tc" is the capability that
3128 tacks on another termcap entry to the end of the current one, to add
3129 on its capabilities.
3130 If a termcap entry doesn't use the "tc"
3131 capability, then of course the two lengths are the same.
3132 .PP
3133 The "before tc expansion" length is the most important one, because it
3134 affects more than just users of that particular terminal.
3135 This is the
3136 length of the entry as it exists in /etc/termcap, minus the
3137 backslash-newline pairs, which tgetent() strips out while reading it.
3138 Some termcap libraries strip off the final newline, too (GNU termcap does not).
3139 Now suppose:
3140 .TP 5
3141 *
3142 a termcap entry before expansion is more than 1023 bytes long,
3143 .TP 5
3144 *
3145 and the application has only allocated a 1k buffer,
3146 .TP 5
3147 *
3148 and the termcap library (like the one in BSD/OS 1.1 and GNU) reads
3149 the whole entry into the buffer, no matter what its length, to see
3150 if it's the entry it wants,
3151 .TP 5
3152 *
3153 and tgetent() is searching for a terminal type that either is the
3154 long entry, appears in the termcap file after the long entry, or
3155 doesn't appear in the file at all (so that tgetent() has to search
3156 the whole termcap file).
3157 .PP
3158 Then tgetent() will overwrite memory, perhaps its stack, and probably core dump
3159 the program.
3160 Programs like telnet are particularly vulnerable; modern telnets
3161 pass along values like the terminal type automatically.
3162 The results are almost
3163 as undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, that
3164 prints warning messages when it reads an overly long termcap entry.
3165 If a
3166 termcap library truncates long entries, like OSF/1 3.0, it is immune to dying
3167 here but will return incorrect data for the terminal.
3168 .PP
3169 The "after tc expansion" length will have a similar effect to the
3170 above, but only for people who actually set TERM to that terminal
3171 type, since tgetent() only does "tc" expansion once it's found the
3172 terminal type it was looking for, not while searching.
3173 .PP
3174 In summary, a termcap entry that is longer than 1023 bytes can cause,
3175 on various combinations of termcap libraries and applications, a core
3176 dump, warnings, or incorrect operation.
3177 If it's too long even before
3178 "tc" expansion, it will have this effect even for users of some other
3179 terminal types and users whose TERM variable does not have a termcap
3180 entry.
3181 .PP
3182 When in -C (translate to termcap) mode, the \fBncurses\fR implementation of
3183 \fBtic\fR(1) issues warning messages when the pre-tc length of a termcap
3184 translation is too long.
3185 The -c (check) option also checks resolved (after tc
3186 expansion) lengths.
3187 .SS Binary Compatibility
3188 It is not wise to count on portability of binary terminfo entries between
3189 commercial UNIX versions.
3190 The problem is that there are at least two versions
3191 of terminfo (under HP-UX and AIX) which diverged from System V terminfo after
3192 SVr1, and have added extension capabilities to the string table that (in the
3193 binary format) collide with System V and XSI Curses extensions.
3194 .SH EXTENSIONS
3195 Some SVr4 \fBcurses\fR implementations, and all previous to SVr4, don't
3196 interpret the %A and %O operators in parameter strings.
3197 .PP
3198 SVr4/XPG4 do not specify whether \fBmsgr\fR licenses movement while in
3199 an alternate-character-set mode (such modes may, among other things, map
3200 CR and NL to characters that don't trigger local motions).
3201 The \fBncurses\fR implementation ignores \fBmsgr\fR in \fBALTCHARSET\fR
3202 mode.
3203 This raises the possibility that an XPG4
3204 implementation making the opposite interpretation may need terminfo
3205 entries made for \fBncurses\fR to have \fBmsgr\fR turned off.
3206 .PP
3207 The \fBncurses\fR library handles insert-character and insert-character modes
3208 in a slightly non-standard way to get better update efficiency.
3209 See
3210 the \fBInsert/Delete Character\fR subsection above.
3211 .PP
3212 The parameter substitutions for \fBset_clock\fR and \fBdisplay_clock\fR are
3213 not documented in SVr4 or the XSI Curses standard.
3214 They are deduced from the
3215 documentation for the AT&T 505 terminal.
3216 .PP
3217 Be careful assigning the \fBkmous\fR capability.
3218 The \fBncurses\fR wants to
3219 interpret it as \fBKEY_MOUSE\fR, for use by terminals and emulators like xterm
3220 that can return mouse-tracking information in the keyboard-input stream.
3221 .PP
3222 Different commercial ports of terminfo and curses support different subsets of
3223 the XSI Curses standard and (in some cases) different extension sets.
3224 Here
3225 is a summary, accurate as of October 1995:
3226 .PP
3227 \fBSVR4, Solaris, ncurses\fR --
3228 These support all SVr4 capabilities.
3229 .PP
3230 \fBSGI\fR --
3231 Supports the SVr4 set, adds one undocumented extended string
3232 capability (\fBset_pglen\fR).
3233 .PP
3234 \fBSVr1, Ultrix\fR --
3235 These support a restricted subset of terminfo capabilities.
3236 The booleans
3237 end with \fBxon_xoff\fR; the numerics with \fBwidth_status_line\fR; and the
3238 strings with \fBprtr_non\fR.
3239 .PP
3240 \fBHP/UX\fR --
3241 Supports the SVr1 subset, plus the SVr[234] numerics \fBnum_labels\fR,
3242 \fBlabel_height\fR, \fBlabel_width\fR, plus function keys 11 through 63, plus
3243 \fBplab_norm\fR, \fBlabel_on\fR, and \fBlabel_off\fR, plus some incompatible
3244 extensions in the string table.
3245 .PP
3246 \fBAIX\fR --
3247 Supports the SVr1 subset, plus function keys 11 through 63, plus a number
3248 of incompatible string table extensions.
3249 .PP
3250 \fBOSF\fR --
3251 Supports both the SVr4 set and the AIX extensions.
3252 .SH FILES
3253 .TP 25
3254 \*d/?/*
3255 files containing terminal descriptions
3256 .SH SEE ALSO
3257 \fBtic\fR(1M), \fBcurses\fR(3X), \fBprintf\fR(3S), \fBterm\fR(\*n).
3258 .SH AUTHORS
3259 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
3260 Based on pcurses by Pavel Curtis.
3261 .\"#
3262 .\"# The following sets edit modes for GNU EMACS
3263 .\"# Local Variables:
3264 .\"# mode:nroff
3265 .\"# fill-column:79
3266 .\"# End: