3 * DO NOT EDIT THIS FILE BY HAND!
4 * It is generated from terminfo.head, Caps, and terminfo.tail.
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-2016,2017 Free Software Foundation, Inc. *
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: *
18 * The above copyright notice and this permission notice shall be included *
19 * in all copies or substantial portions of the Software. *
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. *
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 *
33 ****************************************************************************
34 * @Id: terminfo.head,v 1.31 2017/03/06 09:58:14 tom Exp @
35 * Head of terminfo man page ends here
36 * @Id: terminfo.tail,v 1.78 2017/03/04 23:52:35 tom Exp @
37 * Beginning of terminfo.tail file
38 * This file is part of ncurses.
39 * See "terminfo.head" for copyright.
46 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
49 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
50 <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts">
51 <TITLE>terminfo 5 File Formats</TITLE>
52 <link rev=made href="mailto:bug-ncurses@gnu.org">
53 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
56 <H1 class="no-header">terminfo 5 File Formats</H1>
58 <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG> File Formats <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
63 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
64 terminfo - terminal capability data base
67 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
68 /usr/share/terminfo/*/*
71 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
72 <EM>Terminfo</EM> is a data base describing terminals, used by
73 screen-oriented programs such as <STRONG>nvi(1)</STRONG>, <STRONG>rogue(1)</STRONG> and
74 libraries such as <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>. <EM>Terminfo</EM> describes termi-
75 nals by giving a set of capabilities which they have, by
76 specifying how to perform screen operations, and by speci-
77 fying padding requirements and initialization sequences.
78 This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20170318).
81 </PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
82 Entries in <EM>terminfo</EM> consist of a sequence of fields:
84 <STRONG>o</STRONG> Each field ends with a comma "," (embedded commas may
85 be escaped with a backslash or written as "\054").
87 <STRONG>o</STRONG> White space between fields is ignored.
89 <STRONG>o</STRONG> The first field in a <EM>terminfo</EM> entry begins in the
92 <STRONG>o</STRONG> Newlines and leading whitespace (spaces or tabs) may
93 be used for formatting entries for readability. These
94 are removed from parsed entries.
96 The <STRONG>infocmp</STRONG> <STRONG>-f</STRONG> and <STRONG>-W</STRONG> options rely on this to format
97 if-then-else expressions, or to enforce maximum line-
98 width. The resulting formatted terminal description
99 can be read by <STRONG>tic</STRONG>.
101 <STRONG>o</STRONG> The first field for each terminal gives the names
102 which are known for the terminal, separated by "|"
105 The first name given is the most common abbreviation
106 for the terminal (its primary name), the last name
107 given should be a long name fully identifying the ter-
108 minal (see <STRONG><A HREF="curs_termattrs.3x.html">longname(3x)</A></STRONG>), and all others are treated
109 as synonyms (aliases) for the primary terminal name.
111 X/Open Curses advises that all names but the last
112 should be in lower case and contain no blanks; the
113 last name may well contain upper case and blanks for
116 This implementation is not so strict; it allows mixed
117 case in the primary name and aliases. If the last
118 name has no embedded blanks, it allows that to be both
119 an alias and a verbose name (but will warn about this
122 <STRONG>o</STRONG> Lines beginning with a "#" in the first column are
125 While comment lines are legal at any point, the output
126 of <STRONG>captoinfo</STRONG> and <STRONG>infotocap</STRONG> (aliases for <STRONG>tic</STRONG>) will move
127 comments so they occur only between entries.
129 Terminal names (except for the last, verbose entry) should
130 be chosen using the following conventions. The particular
131 piece of hardware making up the terminal should have a
132 root name, thus "hp2621". This name should not contain
133 hyphens. Modes that the hardware can be in, or user pref-
134 erences, should be indicated by appending a hyphen and a
135 mode suffix. Thus, a vt100 in 132 column mode would be
136 vt100-w. The following suffixes should be used where pos-
139 <STRONG>Suffix</STRONG> <STRONG>Meaning</STRONG> <STRONG>Example</STRONG>
140 -<EM>nn</EM> Number of lines on the screen aaa-60
141 -<EM>n</EM>p Number of pages of memory c100-4p
142 -am With automargins (usually the default) vt100-am
143 -m Mono mode; suppress color ansi-m
144 -mc Magic cookie; spaces when highlighting wy30-mc
145 -na No arrow keys (leave them in local) c100-na
146 -nam Without automatic margins vt100-nam
147 -nl No status line att4415-nl
148 -ns No status line hp2626-ns
149 -rv Reverse video c100-rv
150 -s Enable status line vt100-s
151 -vb Use visible bell instead of beep wy370-vb
152 -w Wide mode (> 80 columns, usually 132) vt100-w
154 For more on terminal naming conventions, see the <STRONG>term(7)</STRONG>
158 </PRE><H3><a name="h3-Terminfo-Capabilities-Syntax">Terminfo Capabilities Syntax</a></H3><PRE>
159 The terminfo entry consists of several <EM>capabilities</EM>, i.e.,
160 features that the terminal has, or methods for exercising
161 the terminal's features.
163 After the first field (giving the name(s) of the terminal
164 entry), there should be one or more <EM>capability</EM> fields.
165 These are boolean, numeric or string names with corre-
168 <STRONG>o</STRONG> Boolean capabilities are true when present, false when
169 absent. There is no explicit value for boolean capa-
172 <STRONG>o</STRONG> Numeric capabilities have a "#" following the name,
173 then an unsigned decimal integer value.
175 <STRONG>o</STRONG> String capabilities have a "=" following the name,
176 then an string of characters making up the capability
179 String capabilities can be split into multiple lines,
180 just as the fields comprising a terminal entry can be
181 split into multiple lines. While blanks between
182 fields are ignored, blanks embedded within a string
183 value are retained, except for leading blanks on a
186 Any capability can be <EM>canceled</EM>, i.e., suppressed from the
187 terminal entry, by following its name with "@" rather than
191 </PRE><H3><a name="h3-Similar-Terminals">Similar Terminals</a></H3><PRE>
192 If there are two very similar terminals, one (the variant)
193 can be defined as being just like the other (the base)
194 with certain exceptions. In the definition of the vari-
195 ant, the string capability <STRONG>use</STRONG> can be given with the name
196 of the base terminal:
198 <STRONG>o</STRONG> The capabilities given before <STRONG>use</STRONG> override those in
199 the base type named by <STRONG>use</STRONG>.
201 <STRONG>o</STRONG> If there are multiple <STRONG>use</STRONG> capabilities, they are
202 merged in reverse order. That is, the rightmost <STRONG>use</STRONG>
203 reference is processed first, then the one to its
206 <STRONG>o</STRONG> Capabilities given explicitly in the entry override
207 those brought in by <STRONG>use</STRONG> references.
209 A capability can be canceled by placing <STRONG>xx@</STRONG> to the left of
210 the use reference that imports it, where <EM>xx</EM> is the capa-
211 bility. For example, the entry
213 2621-nl, smkx@, rmkx@, use=2621,
215 defines a 2621-nl that does not have the <STRONG>smkx</STRONG> or <STRONG>rmkx</STRONG>
216 capabilities, and hence does not turn on the function key
217 labels when in visual mode. This is useful for different
218 modes for a terminal, or for different user preferences.
220 An entry included via <STRONG>use</STRONG> can contain canceled capabili-
221 ties, which have the same effect as if those cancels were
222 inline in the using terminal entry.
225 </PRE><H3><a name="h3-Predefined-Capabilities">Predefined Capabilities</a></H3><PRE>
226 The following is a complete table of the capabilities
227 included in a terminfo description block and available to
228 terminfo-using code. In each line of the table,
230 The <STRONG>variable</STRONG> is the name by which the programmer (at the
231 terminfo level) accesses the capability.
233 The <STRONG>capname</STRONG> is the short name used in the text of the
234 database, and is used by a person updating the database.
235 Whenever possible, capnames are chosen to be the same as
236 or similar to the ANSI X3.64-1979 standard (now superseded
237 by ECMA-48, which uses identical or very similar names).
238 Semantics are also intended to match those of the specifi-
241 The termcap code is the old <STRONG>termcap</STRONG> capability name (some
242 capabilities are new, and have names which termcap did not
245 Capability names have no hard length limit, but an infor-
246 mal limit of 5 characters has been adopted to keep them
247 short and to allow the tabs in the source file <STRONG>Caps</STRONG> to
250 Finally, the description field attempts to convey the
251 semantics of the capability. You may find some codes in
252 the description field:
254 (P) indicates that padding may be specified
256 #[1-9] in the description field indicates that the string
257 is passed through tparm with parms as given (#<EM>i</EM>).
259 (P*) indicates that padding may vary in proportion to
260 the number of lines affected
262 (#<EM>i</EM>) indicates the <EM>i</EM>th parameter.
265 These are the boolean capabilities:
268 <STRONG>Variable</STRONG> <STRONG>Cap-</STRONG> <STRONG>TCap</STRONG> <STRONG>Description</STRONG>
269 <STRONG>Booleans</STRONG> <STRONG>name</STRONG> <STRONG>Code</STRONG>
270 auto_left_margin bw bw cub1 wraps from col-
272 auto_right_margin am am terminal has auto-
274 back_color_erase bce ut screen erased with
276 can_change ccc cc terminal can re-
279 ceol_standout_glitch xhp xs standout not erased
281 col_addr_glitch xhpa YA only positive motion
283 cpi_changes_res cpix YF changing character
286 cr_cancels_micro_mode crxm YB using cr turns off
288 dest_tabs_magic_smso xt xt tabs destructive,
291 eat_newline_glitch xenl xn newline ignored
294 erase_overstrike eo eo can erase over-
296 generic_type gn gn generic line type
297 hard_copy hc hc hardcopy terminal
298 hard_cursor chts HC cursor is hard to
300 has_meta_key km km Has a meta key
302 has_print_wheel daisy YC printer needs opera-
305 has_status_line hs hs has extra status
307 hue_lightness_saturation hls hl terminal uses only
310 insert_null_glitch in in insert mode distin-
312 lpi_changes_res lpix YG changing line pitch
314 memory_above da da display may be
317 memory_below db db display may be
320 move_insert_mode mir mi safe to move while
322 move_standout_mode msgr ms safe to move while
324 needs_xon_xoff nxon nx padding will not
327 no_esc_ctlc xsb xb beehive (f1=escape,
331 no_pad_char npc NP pad character does
333 non_dest_scroll_region ndscr ND scrolling region is
335 non_rev_rmcup nrrmc NR smcup does not
337 over_strike os os terminal can over-
339 prtr_silent mc5i 5i printer will not
341 row_addr_glitch xvpa YD only positive motion
343 semi_auto_right_margin sam YE printing in last
345 status_line_esc_ok eslok es escape can be used
347 tilde_glitch hz hz cannot print ~'s
349 transparent_underline ul ul underline character
351 xon_xoff xon xo terminal uses
354 These are the numeric capabilities:
357 <STRONG>Variable</STRONG> <STRONG>Cap-</STRONG> <STRONG>TCap</STRONG> <STRONG>Description</STRONG>
358 <STRONG>Numeric</STRONG> <STRONG>name</STRONG> <STRONG>Code</STRONG>
359 columns cols co number of columns in
361 init_tabs it it tabs initially every
363 label_height lh lh rows in each label
364 label_width lw lw columns in each
366 lines lines li number of lines on
368 lines_of_memory lm lm lines of memory if >
370 magic_cookie_glitch xmc sg number of blank
373 max_attributes ma ma maximum combined
376 max_colors colors Co maximum number of
378 max_pairs pairs pa maximum number of
381 maximum_windows wnum MW maximum number of
383 no_color_video ncv NC video attributes
386 num_labels nlab Nl number of labels on
388 padding_baud_rate pb pb lowest baud rate
390 virtual_terminal vt vt virtual terminal
392 width_status_line wsl ws number of columns in
395 The following numeric capabilities are present in the
396 SVr4.0 term structure, but are not yet documented in the
397 man page. They came in with SVr4's printer support.
400 <STRONG>Variable</STRONG> <STRONG>Cap-</STRONG> <STRONG>TCap</STRONG> <STRONG>Description</STRONG>
401 <STRONG>Numeric</STRONG> <STRONG>name</STRONG> <STRONG>Code</STRONG>
402 bit_image_entwining bitwin Yo number of passes for
404 bit_image_type bitype Yp type of bit-image
406 buffer_capacity bufsz Ya numbers of bytes
409 buttons btns BT number of buttons on
411 dot_horz_spacing spinh Yc spacing of dots hor-
414 dot_vert_spacing spinv Yb spacing of pins ver-
417 max_micro_address maddr Yd maximum value in
419 max_micro_jump mjump Ye maximum value in
421 micro_col_size mcs Yf character step size
423 micro_line_size mls Yg line step size when
425 number_of_pins npins Yh numbers of pins in
427 output_res_char orc Yi horizontal resolu-
430 output_res_horz_inch orhi Yk horizontal resolu-
433 output_res_line orl Yj vertical resolution
435 output_res_vert_inch orvi Yl vertical resolution
437 print_rate cps Ym print rate in char-
439 wide_char_size widcs Yn character step size
443 These are the string capabilities:
446 <STRONG>Variable</STRONG> <STRONG>Cap-</STRONG> <STRONG>TCap</STRONG> <STRONG>Description</STRONG>
447 <STRONG>String</STRONG> <STRONG>name</STRONG> <STRONG>Code</STRONG>
448 acs_chars acsc ac graphics charset
451 back_tab cbt bt back tab (P)
452 bell bel bl audible signal
454 carriage_return cr cr carriage return (P*)
456 change_char_pitch cpi ZA Change number of
459 change_line_pitch lpi ZB Change number of
462 change_res_horz chr ZC Change horizontal
466 change_res_vert cvr ZD Change vertical res-
468 change_scroll_region csr cs change region to
471 char_padding rmp rP like ip but when in
473 clear_all_tabs tbc ct clear all tab stops
475 clear_margins mgc MC clear right and left
477 clear_screen clear cl clear screen and
479 clr_bol el1 cb Clear to beginning
481 clr_eol el ce clear to end of line
483 clr_eos ed cd clear to end of
485 column_address hpa ch horizontal position
487 command_character cmdch CC terminal settable
490 create_window cwin CW define a window #1
492 cursor_address cup cm move to row #1 col-
494 cursor_down cud1 do down one line
495 cursor_home home ho home cursor (if no
497 cursor_invisible civis vi make cursor invisi-
499 cursor_left cub1 le move left one space
500 cursor_mem_address mrcup CM memory relative cur-
503 cursor_normal cnorm ve make cursor appear
506 cursor_right cuf1 nd non-destructive
509 cursor_to_ll ll ll last line, first
511 cursor_up cuu1 up up one line
512 cursor_visible cvvis vs make cursor very
514 define_char defc ZE Define a character
517 delete_character dch1 dc delete character
519 delete_line dl1 dl delete line (P*)
520 dial_phone dial DI dial number #1
521 dis_status_line dsl ds disable status line
522 display_clock dclk DK display clock
523 down_half_line hd hd half a line down
524 ena_acs enacs eA enable alternate
526 enter_alt_charset_mode smacs as start alternate
529 enter_am_mode smam SA turn on automatic
531 enter_blink_mode blink mb turn on blinking
534 enter_bold_mode bold md turn on bold (extra
536 enter_ca_mode smcup ti string to start pro-
538 enter_delete_mode smdc dm enter delete mode
539 enter_dim_mode dim mh turn on half-bright
541 enter_doublewide_mode swidm ZF Enter double-wide
543 enter_draft_quality sdrfq ZG Enter draft-quality
545 enter_insert_mode smir im enter insert mode
546 enter_italics_mode sitm ZH Enter italic mode
547 enter_leftward_mode slm ZI Start leftward car-
549 enter_micro_mode smicm ZJ Start micro-motion
551 enter_near_letter_quality snlq ZK Enter NLQ mode
552 enter_normal_quality snrmq ZL Enter normal-quality
554 enter_protected_mode prot mp turn on protected
556 enter_reverse_mode rev mr turn on reverse
558 enter_secure_mode invis mk turn on blank mode
561 enter_shadow_mode sshm ZM Enter shadow-print
563 enter_standout_mode smso so begin standout mode
564 enter_subscript_mode ssubm ZN Enter subscript mode
565 enter_superscript_mode ssupm ZO Enter superscript
567 enter_underline_mode smul us begin underline mode
568 enter_upward_mode sum ZP Start upward car-
570 enter_xon_mode smxon SX turn on xon/xoff
572 erase_chars ech ec erase #1 characters
574 exit_alt_charset_mode rmacs ae end alternate char-
576 exit_am_mode rmam RA turn off automatic
578 exit_attribute_mode sgr0 me turn off all
580 exit_ca_mode rmcup te strings to end pro-
582 exit_delete_mode rmdc ed end delete mode
583 exit_doublewide_mode rwidm ZQ End double-wide mode
584 exit_insert_mode rmir ei exit insert mode
585 exit_italics_mode ritm ZR End italic mode
586 exit_leftward_mode rlm ZS End left-motion mode
587 exit_micro_mode rmicm ZT End micro-motion
589 exit_shadow_mode rshm ZU End shadow-print
591 exit_standout_mode rmso se exit standout mode
592 exit_subscript_mode rsubm ZV End subscript mode
593 exit_superscript_mode rsupm ZW End superscript mode
594 exit_underline_mode rmul ue exit underline mode
595 exit_upward_mode rum ZX End reverse charac-
597 exit_xon_mode rmxon RX turn off xon/xoff
601 fixed_pause pause PA pause for 2-3 sec-
603 flash_hook hook fh flash switch hook
604 flash_screen flash vb visible bell (may
606 form_feed ff ff hardcopy terminal
608 from_status_line fsl fs return from status
610 goto_window wingo WG go to window #1
611 hangup hup HU hang-up phone
612 init_1string is1 i1 initialization
614 init_2string is2 is initialization
616 init_3string is3 i3 initialization
618 init_file if if name of initializa-
620 init_prog iprog iP path name of program
622 initialize_color initc Ic initialize color #1
624 initialize_pair initp Ip Initialize color
628 insert_character ich1 ic insert character (P)
629 insert_line il1 al insert line (P*)
630 insert_padding ip ip insert padding after
632 key_a1 ka1 K1 upper left of keypad
633 key_a3 ka3 K3 upper right of key-
635 key_b2 kb2 K2 center of keypad
636 key_backspace kbs kb backspace key
637 key_beg kbeg @1 begin key
638 key_btab kcbt kB back-tab key
639 key_c1 kc1 K4 lower left of keypad
640 key_c3 kc3 K5 lower right of key-
642 key_cancel kcan @2 cancel key
643 key_catab ktbc ka clear-all-tabs key
644 key_clear kclr kC clear-screen or
646 key_close kclo @3 close key
647 key_command kcmd @4 command key
648 key_copy kcpy @5 copy key
649 key_create kcrt @6 create key
650 key_ctab kctab kt clear-tab key
651 key_dc kdch1 kD delete-character key
652 key_dl kdl1 kL delete-line key
653 key_down kcud1 kd down-arrow key
654 key_eic krmir kM sent by rmir or smir
656 key_end kend @7 end key
657 key_enter kent @8 enter/send key
658 key_eol kel kE clear-to-end-of-line
660 key_eos ked kS clear-to-end-of-
662 key_exit kext @9 exit key
663 key_f0 kf0 k0 F0 function key
664 key_f1 kf1 k1 F1 function key
665 key_f10 kf10 k; F10 function key
666 key_f11 kf11 F1 F11 function key
668 key_f12 kf12 F2 F12 function key
669 key_f13 kf13 F3 F13 function key
670 key_f14 kf14 F4 F14 function key
671 key_f15 kf15 F5 F15 function key
672 key_f16 kf16 F6 F16 function key
673 key_f17 kf17 F7 F17 function key
674 key_f18 kf18 F8 F18 function key
675 key_f19 kf19 F9 F19 function key
676 key_f2 kf2 k2 F2 function key
677 key_f20 kf20 FA F20 function key
678 key_f21 kf21 FB F21 function key
679 key_f22 kf22 FC F22 function key
680 key_f23 kf23 FD F23 function key
681 key_f24 kf24 FE F24 function key
682 key_f25 kf25 FF F25 function key
683 key_f26 kf26 FG F26 function key
684 key_f27 kf27 FH F27 function key
685 key_f28 kf28 FI F28 function key
686 key_f29 kf29 FJ F29 function key
687 key_f3 kf3 k3 F3 function key
688 key_f30 kf30 FK F30 function key
689 key_f31 kf31 FL F31 function key
690 key_f32 kf32 FM F32 function key
691 key_f33 kf33 FN F33 function key
692 key_f34 kf34 FO F34 function key
693 key_f35 kf35 FP F35 function key
694 key_f36 kf36 FQ F36 function key
695 key_f37 kf37 FR F37 function key
696 key_f38 kf38 FS F38 function key
697 key_f39 kf39 FT F39 function key
698 key_f4 kf4 k4 F4 function key
699 key_f40 kf40 FU F40 function key
700 key_f41 kf41 FV F41 function key
701 key_f42 kf42 FW F42 function key
702 key_f43 kf43 FX F43 function key
703 key_f44 kf44 FY F44 function key
704 key_f45 kf45 FZ F45 function key
705 key_f46 kf46 Fa F46 function key
706 key_f47 kf47 Fb F47 function key
707 key_f48 kf48 Fc F48 function key
708 key_f49 kf49 Fd F49 function key
709 key_f5 kf5 k5 F5 function key
710 key_f50 kf50 Fe F50 function key
711 key_f51 kf51 Ff F51 function key
712 key_f52 kf52 Fg F52 function key
713 key_f53 kf53 Fh F53 function key
714 key_f54 kf54 Fi F54 function key
715 key_f55 kf55 Fj F55 function key
716 key_f56 kf56 Fk F56 function key
717 key_f57 kf57 Fl F57 function key
718 key_f58 kf58 Fm F58 function key
719 key_f59 kf59 Fn F59 function key
720 key_f6 kf6 k6 F6 function key
721 key_f60 kf60 Fo F60 function key
722 key_f61 kf61 Fp F61 function key
723 key_f62 kf62 Fq F62 function key
724 key_f63 kf63 Fr F63 function key
725 key_f7 kf7 k7 F7 function key
726 key_f8 kf8 k8 F8 function key
727 key_f9 kf9 k9 F9 function key
728 key_find kfnd @0 find key
729 key_help khlp %1 help key
730 key_home khome kh home key
731 key_ic kich1 kI insert-character key
732 key_il kil1 kA insert-line key
733 key_left kcub1 kl left-arrow key
735 key_ll kll kH lower-left key (home
737 key_mark kmrk %2 mark key
738 key_message kmsg %3 message key
739 key_move kmov %4 move key
740 key_next knxt %5 next key
741 key_npage knp kN next-page key
742 key_open kopn %6 open key
743 key_options kopt %7 options key
744 key_ppage kpp kP previous-page key
745 key_previous kprv %8 previous key
746 key_print kprt %9 print key
747 key_redo krdo %0 redo key
748 key_reference kref &1 reference key
749 key_refresh krfr &2 refresh key
750 key_replace krpl &3 replace key
751 key_restart krst &4 restart key
752 key_resume kres &5 resume key
753 key_right kcuf1 kr right-arrow key
754 key_save ksav &6 save key
755 key_sbeg kBEG &9 shifted begin key
756 key_scancel kCAN &0 shifted cancel key
757 key_scommand kCMD *1 shifted command key
758 key_scopy kCPY *2 shifted copy key
759 key_screate kCRT *3 shifted create key
760 key_sdc kDC *4 shifted delete-char-
762 key_sdl kDL *5 shifted delete-line
764 key_select kslt *6 select key
765 key_send kEND *7 shifted end key
766 key_seol kEOL *8 shifted clear-to-
768 key_sexit kEXT *9 shifted exit key
769 key_sf kind kF scroll-forward key
770 key_sfind kFND *0 shifted find key
771 key_shelp kHLP #1 shifted help key
772 key_shome kHOM #2 shifted home key
773 key_sic kIC #3 shifted insert-char-
775 key_sleft kLFT #4 shifted left-arrow
777 key_smessage kMSG %a shifted message key
778 key_smove kMOV %b shifted move key
779 key_snext kNXT %c shifted next key
780 key_soptions kOPT %d shifted options key
781 key_sprevious kPRV %e shifted previous key
782 key_sprint kPRT %f shifted print key
783 key_sr kri kR scroll-backward key
784 key_sredo kRDO %g shifted redo key
785 key_sreplace kRPL %h shifted replace key
786 key_sright kRIT %i shifted right-arrow
788 key_srsume kRES %j shifted resume key
789 key_ssave kSAV !1 shifted save key
790 key_ssuspend kSPD !2 shifted suspend key
791 key_stab khts kT set-tab key
792 key_sundo kUND !3 shifted undo key
793 key_suspend kspd &7 suspend key
794 key_undo kund &8 undo key
795 key_up kcuu1 ku up-arrow key
796 keypad_local rmkx ke leave 'key-
798 keypad_xmit smkx ks enter 'key-
802 lab_f0 lf0 l0 label on function
804 lab_f1 lf1 l1 label on function
806 lab_f10 lf10 la label on function
808 lab_f2 lf2 l2 label on function
810 lab_f3 lf3 l3 label on function
812 lab_f4 lf4 l4 label on function
814 lab_f5 lf5 l5 label on function
816 lab_f6 lf6 l6 label on function
818 lab_f7 lf7 l7 label on function
820 lab_f8 lf8 l8 label on function
822 lab_f9 lf9 l9 label on function
824 label_format fln Lf label format
825 label_off rmln LF turn off soft labels
826 label_on smln LO turn on soft labels
827 meta_off rmm mo turn off meta mode
828 meta_on smm mm turn on meta mode
830 micro_column_address mhpa ZY Like column_address
832 micro_down mcud1 ZZ Like cursor_down in
834 micro_left mcub1 Za Like cursor_left in
836 micro_right mcuf1 Zb Like cursor_right in
838 micro_row_address mvpa Zc Like row_address #1
840 micro_up mcuu1 Zd Like cursor_up in
842 newline nel nw newline (behave like
844 order_of_pins porder Ze Match software bits
846 orig_colors oc oc Set all color pairs
848 orig_pair op op Set default pair to
850 pad_char pad pc padding char
852 parm_dch dch DC delete #1 characters
854 parm_delete_line dl DL delete #1 lines (P*)
855 parm_down_cursor cud DO down #1 lines (P*)
856 parm_down_micro mcud Zf Like parm_down_cur-
858 parm_ich ich IC insert #1 characters
860 parm_index indn SF scroll forward #1
862 parm_insert_line il AL insert #1 lines (P*)
863 parm_left_cursor cub LE move #1 characters
865 parm_left_micro mcub Zg Like parm_left_cur-
869 parm_right_cursor cuf RI move #1 characters
871 parm_right_micro mcuf Zh Like parm_right_cur-
873 parm_rindex rin SR scroll back #1 lines
875 parm_up_cursor cuu UP up #1 lines (P*)
876 parm_up_micro mcuu Zi Like parm_up_cursor
878 pkey_key pfkey pk program function key
880 pkey_local pfloc pl program function key
883 pkey_xmit pfx px program function key
886 plab_norm pln pn program label #1 to
888 print_screen mc0 ps print contents of
890 prtr_non mc5p pO turn on printer for
892 prtr_off mc4 pf turn off printer
893 prtr_on mc5 po turn on printer
894 pulse pulse PU select pulse dialing
895 quick_dial qdial QD dial number #1 with-
897 remove_clock rmclk RC remove clock
898 repeat_char rep rp repeat char #1 #2
900 req_for_input rfi RF send next input char
902 reset_1string rs1 r1 reset string
903 reset_2string rs2 r2 reset string
904 reset_3string rs3 r3 reset string
905 reset_file rf rf name of reset file
906 restore_cursor rc rc restore cursor to
909 row_address vpa cv vertical position #1
911 save_cursor sc sc save current cursor
913 scroll_forward ind sf scroll text up (P)
914 scroll_reverse ri sr scroll text down (P)
915 select_char_set scs Zj Select character
917 set_attributes sgr sa define video
920 set_background setb Sb Set background color
922 set_bottom_margin smgb Zk Set bottom margin at
924 set_bottom_margin_parm smgbp Zl Set bottom margin at
928 set_clock sclk SC set clock, #1 hrs #2
930 set_color_pair scp sp Set current color
932 set_foreground setf Sf Set foreground color
936 set_left_margin smgl ML set left soft margin
940 set_left_margin_parm smglp Zm Set left (right)
942 set_right_margin smgr MR set right soft mar-
945 set_right_margin_parm smgrp Zn Set right margin at
947 set_tab hts st set a tab in every
949 set_top_margin smgt Zo Set top margin at
951 set_top_margin_parm smgtp Zp Set top (bottom)
953 set_window wind wi current window is
956 start_bit_image sbim Zq Start printing bit
958 start_char_set_def scsd Zr Start character set
962 stop_bit_image rbim Zs Stop printing bit
964 stop_char_set_def rcsd Zt End definition of
966 subscript_characters subcs Zu List of subscript-
968 superscript_characters supcs Zv List of superscript-
970 tab ht ta tab to next 8-space
972 these_cause_cr docr Zw Printing any of
975 to_status_line tsl ts move to status line,
977 tone tone TO select touch tone
979 underline_char uc uc underline char and
981 up_half_line hu hu half a line up
982 user0 u0 u0 User string #0
983 user1 u1 u1 User string #1
984 user2 u2 u2 User string #2
985 user3 u3 u3 User string #3
986 user4 u4 u4 User string #4
987 user5 u5 u5 User string #5
988 user6 u6 u6 User string #6
989 user7 u7 u7 User string #7
990 user8 u8 u8 User string #8
991 user9 u9 u9 User string #9
992 wait_tone wait WA wait for dial-tone
993 xoff_character xoffc XF XOFF character
994 xon_character xonc XN XON character
995 zero_motion zerom Zx No motion for subse-
998 The following string capabilities are present in the
999 SVr4.0 term structure, but were originally not documented
1003 <STRONG>Variable</STRONG> <STRONG>Cap-</STRONG> <STRONG>TCap</STRONG> <STRONG>Description</STRONG>
1004 <STRONG>String</STRONG> <STRONG>name</STRONG> <STRONG>Code</STRONG>
1005 alt_scancode_esc scesa S8 Alternate escape
1008 bit_image_carriage_return bicr Yv Move to beginning
1010 bit_image_newline binel Zz Move to next row
1012 bit_image_repeat birep Xy Repeat bit image
1014 char_set_names csnm Zy Produce #1'th item
1017 code_set_init csin ci Init sequence for
1019 color_names colornm Yw Give name for
1021 define_bit_image_region defbi Yx Define rectangular
1023 device_type devt dv Indicate lan-
1026 display_pc_char dispc S1 Display PC charac-
1028 end_bit_image_region endbi Yy End a bit-image
1030 enter_pc_charset_mode smpch S2 Enter PC character
1032 enter_scancode_mode smsc S4 Enter PC scancode
1034 exit_pc_charset_mode rmpch S3 Exit PC character
1036 exit_scancode_mode rmsc S5 Exit PC scancode
1038 get_mouse getm Gm Curses should get
1042 key_mouse kmous Km Mouse event has
1044 mouse_info minfo Mi Mouse status
1046 pc_term_options pctrm S6 PC terminal
1048 pkey_plab pfxl xl Program function
1052 req_mouse_pos reqmp RQ Request mouse
1054 scancode_escape scesc S7 Escape for scan-
1056 set0_des_seq s0ds s0 Shift to codeset 0
1058 set1_des_seq s1ds s1 Shift to codeset 1
1059 set2_des_seq s2ds s2 Shift to codeset 2
1060 set3_des_seq s3ds s3 Shift to codeset 3
1061 set_a_background setab AB Set background
1064 set_a_foreground setaf AF Set foreground
1067 set_color_band setcolor Yz Change to ribbon
1070 set_lr_margin smglr ML Set both left and
1075 set_page_length slines YZ Set page length to
1077 set_tb_margin smgtb MT Sets both top and
1081 The XSI Curses standard added these hardcopy capabili-
1082 ties. They were used in some post-4.1 versions of System
1083 V curses, e.g., Solaris 2.5 and IRIX 6.x. Except for <STRONG>YI</STRONG>,
1084 the <STRONG>ncurses</STRONG> termcap names for them are invented. Accord-
1085 ing to the XSI Curses standard, they have no termcap
1086 names. If your compiled terminfo entries use these, they
1087 may not be binary-compatible with System V terminfo
1088 entries after SVr4.1; beware!
1091 <STRONG>Variable</STRONG> <STRONG>Cap-</STRONG> <STRONG>TCap</STRONG> <STRONG>Description</STRONG>
1092 <STRONG>String</STRONG> <STRONG>name</STRONG> <STRONG>Code</STRONG>
1093 enter_horizontal_hl_mode ehhlm Xh Enter horizontal
1095 enter_left_hl_mode elhlm Xl Enter left highlight
1097 enter_low_hl_mode elohlm Xo Enter low highlight
1099 enter_right_hl_mode erhlm Xr Enter right high-
1101 enter_top_hl_mode ethlm Xt Enter top highlight
1103 enter_vertical_hl_mode evhlm Xv Enter vertical high-
1105 set_a_attributes sgr1 sA Define second set of
1108 set_pglen_inch slengthYI Set page length to
1110 inch (some implemen-
1115 </PRE><H3><a name="h3-User-Defined-Capabilities">User-Defined Capabilities</a></H3><PRE>
1116 The preceding section listed the <EM>predefined</EM> capabilities.
1117 They deal with some special features for terminals no
1118 longer (or possibly never) produced. Occasionally there
1119 are special features of newer terminals which are awkward
1120 or impossible to represent by reusing the predefined capa-
1123 <STRONG>ncurses</STRONG> addresses this limitation by allowing user-defined
1124 capabilities. The <STRONG>tic</STRONG> and <STRONG>infocmp</STRONG> programs provide the <STRONG>-x</STRONG>
1125 option for this purpose. When <STRONG>-x</STRONG> is set, <STRONG>tic</STRONG> treats
1126 unknown capabilities as user-defined. That is, if <STRONG>tic</STRONG>
1127 encounters a capability name which it does not recognize,
1128 it infers its type (boolean, number or string) from the
1129 syntax and makes an extended table entry for that capabil-
1130 ity. The <STRONG>use_extended_names</STRONG> function makes this informa-
1131 tion conditionally available to applications. The ncurses
1132 library provides the data leaving most of the behavior to
1135 <STRONG>o</STRONG> User-defined capability strings whose name begins with
1136 "k" are treated as function keys.
1138 <STRONG>o</STRONG> The types (boolean, number, string) determined by <STRONG>tic</STRONG>
1139 can be inferred by successful calls on <STRONG>tigetflag</STRONG>, etc.
1141 <STRONG>o</STRONG> If the capability name happens to be two characters,
1142 the capability is also available through the termcap
1145 While termcap is said to be extensible because it does not
1146 use a predefined set of capabilities, in practice it has
1147 been limited to the capabilities defined by terminfo
1148 implementations. As a rule, user-defined capabilities
1149 intended for use by termcap applications should be limited
1150 to booleans and numbers to avoid running past the 1023
1151 byte limit assumed by termcap implementations and their
1152 applications. In particular, providing extended sets of
1153 function keys (past the 60 numbered keys and the handful
1154 of special named keys) is best done using the longer names
1155 available using terminfo.
1158 </PRE><H3><a name="h3-A-Sample-Entry">A Sample Entry</a></H3><PRE>
1159 The following entry, describing an ANSI-standard terminal,
1160 is representative of what a <STRONG>terminfo</STRONG> entry for a modern
1161 terminal typically looks like.
1163 ansi|ansi/pc-term compatible with color,
1164 am, mc5i, mir, msgr,
1165 colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
1166 acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260
1167 j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303
1168 u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
1169 bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J,
1170 cr=^M, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B,
1171 cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
1172 cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P,
1173 dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
1174 el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, ht=\E[I, hts=\EH,
1175 ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=^J,
1176 indn=\E[%p1%dS, invis=\E[8m, kbs=^H, kcbt=\E[Z, kcub1=\E[D,
1177 kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, kich1=\E[L,
1178 mc4=\E[4i, mc5=\E[5i, nel=\r\E[S, op=\E[39;49m,
1179 rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, rin=\E[%p1%dT,
1180 rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m,
1181 s0ds=\E(B, s1ds=\E)B, s2ds=\E*B, s3ds=\E+B,
1182 setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
1183 sgr=\E[0;10%?%p1%t;7%;
1190 sgr0=\E[0;10m, smacs=\E[11m, smpch=\E[11m, smso=\E[7m,
1191 smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n,
1192 u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%i%p1%dd,
1194 Entries may continue onto multiple lines by placing white
1195 space at the beginning of each line except the first.
1196 Comments may be included on lines beginning with "#".
1197 Capabilities in <EM>terminfo</EM> are of three types:
1199 <STRONG>o</STRONG> Boolean capabilities which indicate that the terminal
1200 has some particular feature,
1202 <STRONG>o</STRONG> numeric capabilities giving the size of the terminal
1203 or the size of particular delays, and
1205 <STRONG>o</STRONG> string capabilities, which give a sequence which can
1206 be used to perform particular terminal operations.
1209 </PRE><H3><a name="h3-Types-of-Capabilities">Types of Capabilities</a></H3><PRE>
1210 All capabilities have names. For instance, the fact that
1211 ANSI-standard terminals have <EM>automatic</EM> <EM>margins</EM> (i.e., an
1212 automatic return and line-feed when the end of a line is
1213 reached) is indicated by the capability <STRONG>am</STRONG>. Hence the
1214 description of ansi includes <STRONG>am</STRONG>. Numeric capabilities are
1215 followed by the character "#" and then a positive value.
1216 Thus <STRONG>cols</STRONG>, which indicates the number of columns the ter-
1217 minal has, gives the value "80" for ansi. Values for
1218 numeric capabilities may be specified in decimal, octal or
1219 hexadecimal, using the C programming language conventions
1220 (e.g., 255, 0377 and 0xff or 0xFF).
1222 Finally, string valued capabilities, such as <STRONG>el</STRONG> (clear to
1223 end of line sequence) are given by the two-character code,
1224 an "=", and then a string ending at the next following
1227 A number of escape sequences are provided in the string
1228 valued capabilities for easy encoding of characters there.
1229 Both <STRONG>\E</STRONG> and <STRONG>\e</STRONG> map to an ESCAPE character, <STRONG>^x</STRONG> maps to a
1230 control-x for any appropriate x, and the sequences <STRONG>\n</STRONG> <STRONG>\l</STRONG>
1231 <STRONG>\r</STRONG> <STRONG>\t</STRONG> <STRONG>\b</STRONG> <STRONG>\f</STRONG> <STRONG>\s</STRONG> give a newline, line-feed, return, tab,
1232 backspace, form-feed, and space. Other escapes include
1234 <STRONG>o</STRONG> <STRONG>\^</STRONG> for <STRONG>^</STRONG>,
1236 <STRONG>o</STRONG> <STRONG>\\</STRONG> for <STRONG>\</STRONG>,
1238 <STRONG>o</STRONG> <STRONG>\</STRONG>, for comma,
1240 <STRONG>o</STRONG> <STRONG>\:</STRONG> for <STRONG>:</STRONG>,
1242 <STRONG>o</STRONG> and <STRONG>\0</STRONG> for null.
1244 <STRONG>\0</STRONG> will produce \200, which does not terminate a
1245 string but behaves as a null character on most termi-
1246 nals, providing CS7 is specified. See <STRONG>stty(1)</STRONG>.
1248 The reason for this quirk is to maintain binary com-
1249 patibility of the compiled terminfo files with other
1250 implementations, e.g., the SVr4 systems, which docu-
1251 ment this. Compiled terminfo files use null-termi-
1252 nated strings, with no lengths. Modifying this would
1253 require a new binary format, which would not work with
1254 other implementations.
1256 Finally, characters may be given as three octal digits
1257 after a <STRONG>\</STRONG>.
1259 A delay in milliseconds may appear anywhere in a string
1260 capability, enclosed in $<..> brackets, as in <STRONG>el</STRONG>=\EK$<5>,
1261 and padding characters are supplied by <STRONG><A HREF="curs_terminfo.3x.html">tputs(3x)</A></STRONG> to pro-
1264 <STRONG>o</STRONG> The delay must be a number with at most one decimal
1265 place of precision; it may be followed by suffixes "*"
1268 <STRONG>o</STRONG> A "*" indicates that the padding required is propor-
1269 tional to the number of lines affected by the opera-
1270 tion, and the amount given is the per-affected-unit
1271 padding required. (In the case of insert character,
1272 the factor is still the number of <EM>lines</EM> affected.)
1274 Normally, padding is advisory if the device has the
1275 <STRONG>xon</STRONG> capability; it is used for cost computation but
1276 does not trigger delays.
1278 <STRONG>o</STRONG> A "/" suffix indicates that the padding is mandatory
1279 and forces a delay of the given number of milliseconds
1280 even on devices for which <STRONG>xon</STRONG> is present to indicate
1283 Sometimes individual capabilities must be commented out.
1284 To do this, put a period before the capability name. For
1285 example, see the second <STRONG>ind</STRONG> in the example above.
1288 </PRE><H3><a name="h3-Fetching-Compiled-Descriptions">Fetching Compiled Descriptions</a></H3><PRE>
1289 The <STRONG>ncurses</STRONG> library searches for terminal descriptions in
1290 several places. It uses only the first description found.
1291 The library has a compiled-in list of places to search
1292 which can be overridden by environment variables. Before
1293 starting to search, <STRONG>ncurses</STRONG> eliminates duplicates in its
1296 <STRONG>o</STRONG> If the environment variable TERMINFO is set, it is
1297 interpreted as the pathname of a directory containing
1298 the compiled description you are working on. Only
1299 that directory is searched.
1301 <STRONG>o</STRONG> If TERMINFO is not set, <STRONG>ncurses</STRONG> will instead look in
1302 the directory <STRONG>$HOME/.terminfo</STRONG> for a compiled descrip-
1305 <STRONG>o</STRONG> Next, if the environment variable TERMINFO_DIRS is
1306 set, <STRONG>ncurses</STRONG> will interpret the contents of that vari-
1307 able as a list of colon-separated directories (or
1308 database files) to be searched.
1310 An empty directory name (i.e., if the variable begins
1311 or ends with a colon, or contains adjacent colons) is
1312 interpreted as the system location <EM>/usr/share/ter-</EM>
1315 <STRONG>o</STRONG> Finally, <STRONG>ncurses</STRONG> searches these compiled-in locations:
1317 <STRONG>o</STRONG> a list of directories
1318 (/usr/local/ncurses/share/terminfo:/usr/share/ter-
1321 <STRONG>o</STRONG> the system terminfo directory, <EM>/usr/share/terminfo</EM>
1322 (the compiled-in default).
1325 </PRE><H3><a name="h3-Preparing-Descriptions">Preparing Descriptions</a></H3><PRE>
1326 We now outline how to prepare descriptions of terminals.
1327 The most effective way to prepare a terminal description
1328 is by imitating the description of a similar terminal in
1329 <EM>terminfo</EM> and to build up a description gradually, using
1330 partial descriptions with <EM>vi</EM> or some other screen-oriented
1331 program to check that they are correct. Be aware that a
1332 very unusual terminal may expose deficiencies in the abil-
1333 ity of the <EM>terminfo</EM> file to describe it or bugs in the
1334 screen-handling code of the test program.
1336 To get the padding for insert line right (if the terminal
1337 manufacturer did not document it) a severe test is to edit
1338 a large file at 9600 baud, delete 16 or so lines from the
1339 middle of the screen, then hit the "u" key several times
1340 quickly. If the terminal messes up, more padding is usu-
1341 ally needed. A similar test can be used for insert char-
1345 </PRE><H3><a name="h3-Basic-Capabilities">Basic Capabilities</a></H3><PRE>
1346 The number of columns on each line for the terminal is
1347 given by the <STRONG>cols</STRONG> numeric capability. If the terminal is
1348 a CRT, then the number of lines on the screen is given by
1349 the <STRONG>lines</STRONG> capability. If the terminal wraps around to the
1350 beginning of the next line when it reaches the right mar-
1351 gin, then it should have the <STRONG>am</STRONG> capability. If the termi-
1352 nal can clear its screen, leaving the cursor in the home
1353 position, then this is given by the <STRONG>clear</STRONG> string capabil-
1354 ity. If the terminal overstrikes (rather than clearing a
1355 position when a character is struck over) then it should
1356 have the <STRONG>os</STRONG> capability. If the terminal is a printing
1357 terminal, with no soft copy unit, give it both <STRONG>hc</STRONG> and <STRONG>os</STRONG>.
1358 (<STRONG>os</STRONG> applies to storage scope terminals, such as TEKTRONIX
1359 4010 series, as well as hard copy and APL terminals.) If
1360 there is a code to move the cursor to the left edge of the
1361 current row, give this as <STRONG>cr</STRONG>. (Normally this will be car-
1362 riage return, control M.) If there is a code to produce
1363 an audible signal (bell, beep, etc) give this as <STRONG>bel</STRONG>.
1365 If there is a code to move the cursor one position to the
1366 left (such as backspace) that capability should be given
1367 as <STRONG>cub1</STRONG>. Similarly, codes to move to the right, up, and
1368 down should be given as <STRONG>cuf1</STRONG>, <STRONG>cuu1</STRONG>, and <STRONG>cud1</STRONG>. These local
1369 cursor motions should not alter the text they pass over,
1370 for example, you would not normally use "<STRONG>cuf1</STRONG>= " because
1371 the space would erase the character moved over.
1373 A very important point here is that the local cursor
1374 motions encoded in <EM>terminfo</EM> are undefined at the left and
1375 top edges of a CRT terminal. Programs should never
1376 attempt to backspace around the left edge, unless <STRONG>bw</STRONG> is
1377 given, and never attempt to go up locally off the top. In
1378 order to scroll text up, a program will go to the bottom
1379 left corner of the screen and send the <STRONG>ind</STRONG> (index) string.
1381 To scroll text down, a program goes to the top left corner
1382 of the screen and sends the <STRONG>ri</STRONG> (reverse index) string.
1383 The strings <STRONG>ind</STRONG> and <STRONG>ri</STRONG> are undefined when not on their
1384 respective corners of the screen.
1386 Parameterized versions of the scrolling sequences are <STRONG>indn</STRONG>
1387 and <STRONG>rin</STRONG> which have the same semantics as <STRONG>ind</STRONG> and <STRONG>ri</STRONG> except
1388 that they take one parameter, and scroll that many lines.
1389 They are also undefined except at the appropriate edge of
1392 The <STRONG>am</STRONG> capability tells whether the cursor sticks at the
1393 right edge of the screen when text is output, but this
1394 does not necessarily apply to a <STRONG>cuf1</STRONG> from the last column.
1395 The only local motion which is defined from the left edge
1396 is if <STRONG>bw</STRONG> is given, then a <STRONG>cub1</STRONG> from the left edge will
1397 move to the right edge of the previous row. If <STRONG>bw</STRONG> is not
1398 given, the effect is undefined. This is useful for draw-
1399 ing a box around the edge of the screen, for example. If
1400 the terminal has switch selectable automatic margins, the
1401 <EM>terminfo</EM> file usually assumes that this is on; i.e., <STRONG>am</STRONG>.
1402 If the terminal has a command which moves to the first
1403 column of the next line, that command can be given as <STRONG>nel</STRONG>
1404 (newline). It does not matter if the command clears the
1405 remainder of the current line, so if the terminal has no
1406 <STRONG>cr</STRONG> and <STRONG>lf</STRONG> it may still be possible to craft a working <STRONG>nel</STRONG>
1407 out of one or both of them.
1409 These capabilities suffice to describe hard-copy and
1410 "glass-tty" terminals. Thus the model 33 teletype is
1413 33|tty33|tty|model 33 teletype,
1414 bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,
1416 while the Lear Siegler ADM-3 is described as
1419 am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
1423 </PRE><H3><a name="h3-Parameterized-Strings">Parameterized Strings</a></H3><PRE>
1424 Cursor addressing and other strings requiring parameters
1425 in the terminal are described by a parameterized string
1426 capability, with <EM>printf</EM>-like escapes such as <EM>%x</EM> in it.
1427 For example, to address the cursor, the <STRONG>cup</STRONG> capability is
1428 given, using two parameters: the row and column to address
1429 to. (Rows and columns are numbered from zero and refer to
1430 the physical screen visible to the user, not to any unseen
1431 memory.) If the terminal has memory relative cursor
1432 addressing, that can be indicated by <STRONG>mrcup</STRONG>.
1434 The parameter mechanism uses a stack and special <STRONG>%</STRONG> codes
1435 to manipulate it. Typically a sequence will push one of
1436 the parameters onto the stack and then print it in some
1437 format. Print (e.g., "%d") is a special case. Other
1438 operations, including "%t" pop their operand from the
1439 stack. It is noted that more complex operations are often
1440 necessary, e.g., in the <STRONG>sgr</STRONG> string.
1442 The <STRONG>%</STRONG> encodings have the following meanings:
1444 <STRONG>%%</STRONG> outputs "%"
1446 <STRONG>%</STRONG><EM>[[</EM>:<EM>]flags][width[.precision]][</EM><STRONG>doxXs</STRONG><EM>]</EM>
1447 as in <STRONG>printf</STRONG>, flags are <EM>[-+#]</EM> and <EM>space</EM>. Use a ":"
1448 to allow the next character to be a "-" flag, avoid-
1449 ing interpreting "%-" as an operator.
1451 %c print <EM>pop()</EM> like %c in <STRONG>printf</STRONG>
1453 <STRONG>%s</STRONG> print <EM>pop()</EM> like %s in <STRONG>printf</STRONG>
1455 <STRONG>%p</STRONG><EM>[1-9]</EM>
1456 push <EM>i</EM>'th parameter
1458 <STRONG>%P</STRONG><EM>[a-z]</EM>
1459 set dynamic variable <EM>[a-z]</EM> to <EM>pop()</EM>
1461 <STRONG>%g</STRONG><EM>[a-z]/</EM>
1462 get dynamic variable <EM>[a-z]</EM> and push it
1464 <STRONG>%P</STRONG><EM>[A-Z]</EM>
1465 set static variable <EM>[a-z]</EM> to <EM>pop()</EM>
1467 <STRONG>%g</STRONG><EM>[A-Z]</EM>
1468 get static variable <EM>[a-z]</EM> and push it
1470 The terms "static" and "dynamic" are misleading.
1471 Historically, these are simply two different sets of
1472 variables, whose values are not reset between calls
1473 to <STRONG><A HREF="curs_terminfo.3x.html">tparm(3x)</A></STRONG>. However, that fact is not documented
1474 in other implementations. Relying on it will
1475 adversely impact portability to other implementa-
1478 <STRONG>%'</STRONG><EM>c</EM><STRONG>'</STRONG> char constant <EM>c</EM>
1480 <STRONG>%{</STRONG><EM>nn</EM><STRONG>}</STRONG>
1481 integer constant <EM>nn</EM>
1483 <STRONG>%l</STRONG> push strlen(pop)
1485 <STRONG>%+</STRONG>, <STRONG>%-</STRONG>, <STRONG>%*</STRONG>, <STRONG>%/</STRONG>, <STRONG>%m</STRONG>
1486 arithmetic (%m is <EM>mod</EM>): <EM>push(pop()</EM> <EM>op</EM> <EM>pop())</EM>
1488 <STRONG>%&</STRONG>, <STRONG>%|</STRONG>, <STRONG>%^</STRONG>
1489 bit operations (AND, OR and exclusive-OR): <EM>push(pop()</EM>
1490 <EM>op</EM> <EM>pop())</EM>
1492 <STRONG>%=</STRONG>, <STRONG>%></STRONG>, <STRONG>%<</STRONG>
1493 logical operations: <EM>push(pop()</EM> <EM>op</EM> <EM>pop())</EM>
1495 <STRONG>%A</STRONG>, <STRONG>%O</STRONG>
1496 logical AND and OR operations (for conditionals)
1498 <STRONG>%!</STRONG>, <STRONG>%~</STRONG>
1499 unary operations (logical and bit complement):
1500 <EM>push(op</EM> <EM>pop())</EM>
1502 <STRONG>%i</STRONG> add 1 to first two parameters (for ANSI terminals)
1504 <STRONG>%?</STRONG> <EM>expr</EM> <STRONG>%t</STRONG> <EM>thenpart</EM> <STRONG>%e</STRONG> <EM>elsepart</EM> <STRONG>%;</STRONG>
1505 This forms an if-then-else. The <STRONG>%e</STRONG> <EM>elsepart</EM> is
1506 optional. Usually the <STRONG>%?</STRONG> <EM>expr</EM> part pushes a value
1507 onto the stack, and <STRONG>%t</STRONG> pops it from the stack, test-
1508 ing if it is nonzero (true). If it is zero (false),
1509 control passes to the <STRONG>%e</STRONG> (else) part.
1511 It is possible to form else-if's a la Algol 68:
1512 <STRONG>%?</STRONG> c1 <STRONG>%t</STRONG> b1 <STRONG>%e</STRONG> c2 <STRONG>%t</STRONG> b2 <STRONG>%e</STRONG> c3 <STRONG>%t</STRONG> b3 <STRONG>%e</STRONG> c4 <STRONG>%t</STRONG> b4 <STRONG>%e</STRONG> <STRONG>%;</STRONG>
1514 where ci are conditions, bi are bodies.
1516 Use the <STRONG>-f</STRONG> option of <STRONG>tic</STRONG> or <STRONG>infocmp</STRONG> to see the struc-
1517 ture of if-then-else's. Some strings, e.g., <STRONG>sgr</STRONG> can
1518 be very complicated when written on one line. The <STRONG>-f</STRONG>
1519 option splits the string into lines with the parts
1522 Binary operations are in postfix form with the operands in
1523 the usual order. That is, to get x-5 one would use
1524 "%gx%{5}%-". <STRONG>%P</STRONG> and <STRONG>%g</STRONG> variables are persistent across
1525 escape-string evaluations.
1527 Consider the HP2645, which, to get to row 3 and column 12,
1528 needs to be sent \E&a12c03Y padded for 6 milliseconds.
1529 Note that the order of the rows and columns is inverted
1530 here, and that the row and column are printed as two dig-
1531 its. Thus its <STRONG>cup</STRONG> capability is "cup=6\E&%p2%2dc%p1%2dY".
1533 The Microterm ACT-IV needs the current row and column sent
1534 preceded by a <STRONG>^T</STRONG>, with the row and column simply encoded
1535 in binary, "cup=^T%p1%c%p2%c". Terminals which use "%c"
1536 need to be able to backspace the cursor (<STRONG>cub1</STRONG>), and to
1537 move the cursor up one line on the screen (<STRONG>cuu1</STRONG>). This is
1538 necessary because it is not always safe to transmit <STRONG>\n</STRONG> <STRONG>^D</STRONG>
1539 and <STRONG>\r</STRONG>, as the system may change or discard them. (The
1540 library routines dealing with terminfo set tty modes so
1541 that tabs are never expanded, so \t is safe to send. This
1542 turns out to be essential for the Ann Arbor 4080.)
1544 A final example is the LSI ADM-3a, which uses row and col-
1545 umn offset by a blank character, thus "cup=\E=%p1%'
1546 '%+%c%p2%' '%+%c". After sending "\E=", this pushes the
1547 first parameter, pushes the ASCII value for a space (32),
1548 adds them (pushing the sum on the stack in place of the
1549 two previous values) and outputs that value as a charac-
1550 ter. Then the same is done for the second parameter.
1551 More complex arithmetic is possible using the stack.
1554 </PRE><H3><a name="h3-Cursor-Motions">Cursor Motions</a></H3><PRE>
1555 If the terminal has a fast way to home the cursor (to very
1556 upper left corner of screen) then this can be given as
1557 <STRONG>home</STRONG>; similarly a fast way of getting to the lower left-
1558 hand corner can be given as <STRONG>ll</STRONG>; this may involve going up
1559 with <STRONG>cuu1</STRONG> from the home position, but a program should
1560 never do this itself (unless <STRONG>ll</STRONG> does) because it can make
1561 no assumption about the effect of moving up from the home
1562 position. Note that the home position is the same as
1563 addressing to (0,0): to the top left corner of the screen,
1564 not of memory. (Thus, the \EH sequence on HP terminals
1565 cannot be used for <STRONG>home</STRONG>.)
1567 If the terminal has row or column absolute cursor address-
1568 ing, these can be given as single parameter capabilities
1569 <STRONG>hpa</STRONG> (horizontal position absolute) and <STRONG>vpa</STRONG> (vertical posi-
1570 tion absolute). Sometimes these are shorter than the more
1571 general two parameter sequence (as with the hp2645) and
1572 can be used in preference to <STRONG>cup</STRONG>. If there are parameter-
1573 ized local motions (e.g., move <EM>n</EM> spaces to the right)
1574 these can be given as <STRONG>cud</STRONG>, <STRONG>cub</STRONG>, <STRONG>cuf</STRONG>, and <STRONG>cuu</STRONG> with a single
1575 parameter indicating how many spaces to move. These are
1576 primarily useful if the terminal does not have <STRONG>cup</STRONG>, such
1577 as the TEKTRONIX 4025.
1579 If the terminal needs to be in a special mode when running
1580 a program that uses these capabilities, the codes to enter
1581 and exit this mode can be given as <STRONG>smcup</STRONG> and <STRONG>rmcup</STRONG>. This
1582 arises, for example, from terminals like the Concept with
1583 more than one page of memory. If the terminal has only
1584 memory relative cursor addressing and not screen relative
1585 cursor addressing, a one screen-sized window must be fixed
1586 into the terminal for cursor addressing to work properly.
1587 This is also used for the TEKTRONIX 4025, where <STRONG>smcup</STRONG> sets
1588 the command character to be the one used by terminfo. If
1589 the <STRONG>smcup</STRONG> sequence will not restore the screen after an
1590 <STRONG>rmcup</STRONG> sequence is output (to the state prior to outputting
1591 <STRONG>rmcup</STRONG>), specify <STRONG>nrrmc</STRONG>.
1594 </PRE><H3><a name="h3-Area-Clears">Area Clears</a></H3><PRE>
1595 If the terminal can clear from the current position to the
1596 end of the line, leaving the cursor where it is, this
1597 should be given as <STRONG>el</STRONG>. If the terminal can clear from the
1598 beginning of the line to the current position inclusive,
1599 leaving the cursor where it is, this should be given as
1600 <STRONG>el1</STRONG>. If the terminal can clear from the current position
1601 to the end of the display, then this should be given as
1602 <STRONG>ed</STRONG>. <STRONG>Ed</STRONG> is only defined from the first column of a line.
1603 (Thus, it can be simulated by a request to delete a large
1604 number of lines, if a true <STRONG>ed</STRONG> is not available.)
1607 </PRE><H3><a name="h3-Insert_delete-line-and-vertical-motions">Insert/delete line and vertical motions</a></H3><PRE>
1608 If the terminal can open a new blank line before the line
1609 where the cursor is, this should be given as <STRONG>il1</STRONG>; this is
1610 done only from the first position of a line. The cursor
1611 must then appear on the newly blank line. If the terminal
1612 can delete the line which the cursor is on, then this
1613 should be given as <STRONG>dl1</STRONG>; this is done only from the first
1614 position on the line to be deleted. Versions of <STRONG>il1</STRONG> and
1615 <STRONG>dl1</STRONG> which take a single parameter and insert or delete
1616 that many lines can be given as <STRONG>il</STRONG> and <STRONG>dl</STRONG>.
1618 If the terminal has a settable scrolling region (like the
1619 vt100) the command to set this can be described with the
1620 <STRONG>csr</STRONG> capability, which takes two parameters: the top and
1621 bottom lines of the scrolling region. The cursor position
1622 is, alas, undefined after using this command.
1624 It is possible to get the effect of insert or delete line
1625 using <STRONG>csr</STRONG> on a properly chosen region; the <STRONG>sc</STRONG> and <STRONG>rc</STRONG> (save
1626 and restore cursor) commands may be useful for ensuring
1627 that your synthesized insert/delete string does not move
1628 the cursor. (Note that the <STRONG><A HREF="ncurses.3x.html">ncurses(3x)</A></STRONG> library does this
1629 synthesis automatically, so you need not compose
1630 insert/delete strings for an entry with <STRONG>csr</STRONG>).
1632 Yet another way to construct insert and delete might be to
1633 use a combination of index with the memory-lock feature
1634 found on some terminals (like the HP-700/90 series, which
1635 however also has insert/delete).
1637 Inserting lines at the top or bottom of the screen can
1638 also be done using <STRONG>ri</STRONG> or <STRONG>ind</STRONG> on many terminals without a
1639 true insert/delete line, and is often faster even on ter-
1640 minals with those features.
1642 The boolean <STRONG>non_dest_scroll_region</STRONG> should be set if each
1643 scrolling window is effectively a view port on a screen-
1644 sized canvas. To test for this capability, create a
1645 scrolling region in the middle of the screen, write some-
1646 thing to the bottom line, move the cursor to the top of
1647 the region, and do <STRONG>ri</STRONG> followed by <STRONG>dl1</STRONG> or <STRONG>ind</STRONG>. If the data
1648 scrolled off the bottom of the region by the <STRONG>ri</STRONG> re-
1649 appears, then scrolling is non-destructive. System V and
1650 XSI Curses expect that <STRONG>ind</STRONG>, <STRONG>ri</STRONG>, <STRONG>indn</STRONG>, and <STRONG>rin</STRONG> will simu-
1651 late destructive scrolling; their documentation cautions
1652 you not to define <STRONG>csr</STRONG> unless this is true. This <STRONG>curses</STRONG>
1653 implementation is more liberal and will do explicit erases
1654 after scrolling if <STRONG>ndsrc</STRONG> is defined.
1656 If the terminal has the ability to define a window as part
1657 of memory, which all commands affect, it should be given
1658 as the parameterized string <STRONG>wind</STRONG>. The four parameters are
1659 the starting and ending lines in memory and the starting
1660 and ending columns in memory, in that order.
1662 If the terminal can retain display memory above, then the
1663 <STRONG>da</STRONG> capability should be given; if display memory can be
1664 retained below, then <STRONG>db</STRONG> should be given. These indicate
1665 that deleting a line or scrolling may bring non-blank
1666 lines up from below or that scrolling back with <STRONG>ri</STRONG> may
1667 bring down non-blank lines.
1670 </PRE><H3><a name="h3-Insert_Delete-Character">Insert/Delete Character</a></H3><PRE>
1671 There are two basic kinds of intelligent terminals with
1672 respect to insert/delete character which can be described
1673 using <EM>terminfo.</EM> The most common insert/delete character
1674 operations affect only the characters on the current line
1675 and shift characters off the end of the line rigidly.
1676 Other terminals, such as the Concept 100 and the Perkin
1677 Elmer Owl, make a distinction between typed and untyped
1678 blanks on the screen, shifting upon an insert or delete
1679 only to an untyped blank on the screen which is either
1680 eliminated, or expanded to two untyped blanks.
1682 You can determine the kind of terminal you have by clear-
1683 ing the screen and then typing text separated by cursor
1684 motions. Type "abc def" using local cursor motions
1685 (not spaces) between the "abc" and the "def". Then posi-
1686 tion the cursor before the "abc" and put the terminal in
1687 insert mode. If typing characters causes the rest of the
1688 line to shift rigidly and characters to fall off the end,
1689 then your terminal does not distinguish between blanks and
1690 untyped positions. If the "abc" shifts over to the "def"
1691 which then move together around the end of the current
1692 line and onto the next as you insert, you have the second
1693 type of terminal, and should give the capability <STRONG>in</STRONG>, which
1694 stands for "insert null".
1696 While these are two logically separate attributes (one
1697 line versus multi-line insert mode, and special treatment
1698 of untyped spaces) we have seen no terminals whose insert
1699 mode cannot be described with the single attribute.
1701 Terminfo can describe both terminals which have an insert
1702 mode, and terminals which send a simple sequence to open a
1703 blank position on the current line. Give as <STRONG>smir</STRONG> the
1704 sequence to get into insert mode. Give as <STRONG>rmir</STRONG> the
1705 sequence to leave insert mode. Now give as <STRONG>ich1</STRONG> any
1706 sequence needed to be sent just before sending the charac-
1707 ter to be inserted. Most terminals with a true insert
1708 mode will not give <STRONG>ich1</STRONG>; terminals which send a sequence
1709 to open a screen position should give it here.
1711 If your terminal has both, insert mode is usually prefer-
1712 able to <STRONG>ich1</STRONG>. Technically, you should not give both
1713 unless the terminal actually requires both to be used in
1714 combination. Accordingly, some non-curses applications
1715 get confused if both are present; the symptom is doubled
1716 characters in an update using insert. This requirement is
1717 now rare; most <STRONG>ich</STRONG> sequences do not require previous smir,
1718 and most smir insert modes do not require <STRONG>ich1</STRONG> before each
1719 character. Therefore, the new <STRONG>curses</STRONG> actually assumes
1720 this is the case and uses either <STRONG>rmir</STRONG>/<STRONG>smir</STRONG> or <STRONG>ich</STRONG>/<STRONG>ich1</STRONG> as
1721 appropriate (but not both). If you have to write an entry
1722 to be used under new curses for a terminal old enough to
1723 need both, include the <STRONG>rmir</STRONG>/<STRONG>smir</STRONG> sequences in <STRONG>ich1</STRONG>.
1725 If post insert padding is needed, give this as a number of
1726 milliseconds in <STRONG>ip</STRONG> (a string option). Any other sequence
1727 which may need to be sent after an insert of a single
1728 character may also be given in <STRONG>ip</STRONG>. If your terminal needs
1729 both to be placed into an "insert mode" and a special code
1730 to precede each inserted character, then both <STRONG>smir</STRONG>/<STRONG>rmir</STRONG>
1731 and <STRONG>ich1</STRONG> can be given, and both will be used. The <STRONG>ich</STRONG>
1732 capability, with one parameter, <EM>n</EM>, will repeat the effects
1733 of <STRONG>ich1</STRONG> <EM>n</EM> times.
1735 If padding is necessary between characters typed while not
1736 in insert mode, give this as a number of milliseconds pad-
1737 ding in <STRONG>rmp</STRONG>.
1739 It is occasionally necessary to move around while in
1740 insert mode to delete characters on the same line (e.g.,
1741 if there is a tab after the insertion position). If your
1742 terminal allows motion while in insert mode you can give
1743 the capability <STRONG>mir</STRONG> to speed up inserting in this case.
1744 Omitting <STRONG>mir</STRONG> will affect only speed. Some terminals
1745 (notably Datamedia's) must not have <STRONG>mir</STRONG> because of the way
1746 their insert mode works.
1748 Finally, you can specify <STRONG>dch1</STRONG> to delete a single charac-
1749 ter, <STRONG>dch</STRONG> with one parameter, <EM>n</EM>, to delete <EM>n</EM> <EM>characters,</EM>
1750 and delete mode by giving <STRONG>smdc</STRONG> and <STRONG>rmdc</STRONG> to enter and exit
1751 delete mode (any mode the terminal needs to be placed in
1752 for <STRONG>dch1</STRONG> to work).
1754 A command to erase <EM>n</EM> characters (equivalent to outputting
1755 <EM>n</EM> blanks without moving the cursor) can be given as <STRONG>ech</STRONG>
1759 </PRE><H3><a name="h3-Highlighting_-Underlining_-and-Visible-Bells">Highlighting, Underlining, and Visible Bells</a></H3><PRE>
1760 If your terminal has one or more kinds of display
1761 attributes, these can be represented in a number of dif-
1762 ferent ways. You should choose one display form as <EM>stand-</EM>
1763 <EM>out</EM> <EM>mode</EM>, representing a good, high contrast, easy-on-the-
1764 eyes, format for highlighting error messages and other
1765 attention getters. (If you have a choice, reverse video
1766 plus half-bright is good, or reverse video alone.) The
1767 sequences to enter and exit standout mode are given as
1768 <STRONG>smso</STRONG> and <STRONG>rmso</STRONG>, respectively. If the code to change into
1769 or out of standout mode leaves one or even two blank spa-
1770 ces on the screen, as the TVI 912 and Teleray 1061 do,
1771 then <STRONG>xmc</STRONG> should be given to tell how many spaces are left.
1773 Codes to begin underlining and end underlining can be
1774 given as <STRONG>smul</STRONG> and <STRONG>rmul</STRONG> respectively. If the terminal has
1775 a code to underline the current character and move the
1776 cursor one space to the right, such as the Microterm Mime,
1777 this can be given as <STRONG>uc</STRONG>.
1779 Other capabilities to enter various highlighting modes
1780 include <STRONG>blink</STRONG> (blinking) <STRONG>bold</STRONG> (bold or extra bright) <STRONG>dim</STRONG>
1781 (dim or half-bright) <STRONG>invis</STRONG> (blanking or invisible text)
1782 <STRONG>prot</STRONG> (protected) <STRONG>rev</STRONG> (reverse video) <STRONG>sgr0</STRONG> (turn off <EM>all</EM>
1783 attribute modes) <STRONG>smacs</STRONG> (enter alternate character set
1784 mode) and <STRONG>rmacs</STRONG> (exit alternate character set mode).
1785 Turning on any of these modes singly may or may not turn
1788 If there is a sequence to set arbitrary combinations of
1789 modes, this should be given as <STRONG>sgr</STRONG> (set attributes), tak-
1790 ing 9 parameters. Each parameter is either 0 or nonzero,
1791 as the corresponding attribute is on or off. The 9 param-
1792 eters are, in order: standout, underline, reverse, blink,
1793 dim, bold, blank, protect, alternate character set. Not
1794 all modes need be supported by <STRONG>sgr</STRONG>, only those for which
1795 corresponding separate attribute commands exist.
1797 For example, the DEC vt220 supports most of the modes:
1799 <STRONG>tparm</STRONG> <STRONG>parameter</STRONG> <STRONG>attribute</STRONG> <STRONG>escape</STRONG> <STRONG>sequence</STRONG>
1802 p1 standout \E[0;1;7m
1803 p2 underline \E[0;4m
1806 p5 dim not available
1810 p9 altcharset ^O (off) ^N (on)
1812 We begin each escape sequence by turning off any existing
1813 modes, since there is no quick way to determine whether
1814 they are active. Standout is set up to be the combination
1815 of reverse and bold. The vt220 terminal has a protect
1816 mode, though it is not commonly used in sgr because it
1817 protects characters on the screen from the host's era-
1818 sures. The altcharset mode also is different in that it
1819 is either ^O or ^N, depending on whether it is off or on.
1820 If all modes are turned on, the resulting sequence is
1823 Some sequences are common to different modes. For exam-
1824 ple, ;7 is output when either p1 or p3 is true, that is,
1825 if either standout or reverse modes are turned on.
1827 Writing out the above sequences, along with their depen-
1830 <STRONG>sequence</STRONG> <STRONG>when</STRONG> <STRONG>to</STRONG> <STRONG>output</STRONG> <STRONG>terminfo</STRONG> <STRONG>translation</STRONG>
1833 ;1 if p1 or p6 %?%p1%p6%|%t;1%;
1834 ;4 if p2 %?%p2%|%t;4%;
1835 ;5 if p4 %?%p4%|%t;5%;
1836 ;7 if p1 or p3 %?%p1%p3%|%t;7%;
1837 ;8 if p7 %?%p7%|%t;8%;
1839 ^N or ^O if p9 ^N, else ^O %?%p9%t^N%e^O%;
1841 Putting this all together into the sgr sequence gives:
1843 sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%;
1844 %?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
1846 Remember that if you specify sgr, you must also specify
1847 sgr0. Also, some implementations rely on sgr being given
1848 if sgr0 is, Not all terminfo entries necessarily have an
1849 sgr string, however. Many terminfo entries are derived
1850 from termcap entries which have no sgr string. The only
1851 drawback to adding an sgr string is that termcap also
1852 assumes that sgr0 does not exit alternate character set
1855 Terminals with the "magic cookie" glitch (<STRONG>xmc</STRONG>) deposit
1856 special "cookies" when they receive mode-setting
1857 sequences, which affect the display algorithm rather than
1858 having extra bits for each character. Some terminals,
1859 such as the HP 2621, automatically leave standout mode
1860 when they move to a new line or the cursor is addressed.
1861 Programs using standout mode should exit standout mode
1862 before moving the cursor or sending a newline, unless the
1863 <STRONG>msgr</STRONG> capability, asserting that it is safe to move in
1864 standout mode, is present.
1866 If the terminal has a way of flashing the screen to indi-
1867 cate an error quietly (a bell replacement) then this can
1868 be given as <STRONG>flash</STRONG>; it must not move the cursor.
1870 If the cursor needs to be made more visible than normal
1871 when it is not on the bottom line (to make, for example, a
1872 non-blinking underline into an easier to find block or
1873 blinking underline) give this sequence as <STRONG>cvvis</STRONG>. If there
1874 is a way to make the cursor completely invisible, give
1875 that as <STRONG>civis</STRONG>. The capability <STRONG>cnorm</STRONG> should be given which
1876 undoes the effects of both of these modes.
1878 If your terminal correctly generates underlined characters
1879 (with no special codes needed) even though it does not
1880 overstrike, then you should give the capability <STRONG>ul</STRONG>. If a
1881 character overstriking another leaves both characters on
1882 the screen, specify the capability <STRONG>os</STRONG>. If overstrikes are
1883 erasable with a blank, then this should be indicated by
1884 giving <STRONG>eo</STRONG>.
1887 </PRE><H3><a name="h3-Keypad-and-Function-Keys">Keypad and Function Keys</a></H3><PRE>
1888 If the terminal has a keypad that transmits codes when the
1889 keys are pressed, this information can be given. Note
1890 that it is not possible to handle terminals where the key-
1891 pad only works in local (this applies, for example, to the
1892 unshifted HP 2621 keys). If the keypad can be set to
1893 transmit or not transmit, give these codes as <STRONG>smkx</STRONG> and
1894 <STRONG>rmkx</STRONG>. Otherwise the keypad is assumed to always transmit.
1896 The codes sent by the left arrow, right arrow, up arrow,
1897 down arrow, and home keys can be given as <STRONG>kcub1,</STRONG> <STRONG>kcuf1,</STRONG>
1898 <STRONG>kcuu1,</STRONG> <STRONG>kcud1,</STRONG> and <STRONG>khome</STRONG> respectively. If there are func-
1899 tion keys such as f0, f1, ..., f10, the codes they send
1900 can be given as <STRONG>kf0,</STRONG> <STRONG>kf1,</STRONG> <STRONG>...,</STRONG> <STRONG>kf10</STRONG>. If these keys have
1901 labels other than the default f0 through f10, the labels
1902 can be given as <STRONG>lf0,</STRONG> <STRONG>lf1,</STRONG> <STRONG>...,</STRONG> <STRONG>lf10</STRONG>.
1904 The codes transmitted by certain other special keys can be
1907 <STRONG>o</STRONG> <STRONG>kll</STRONG> (home down),
1909 <STRONG>o</STRONG> <STRONG>kbs</STRONG> (backspace),
1911 <STRONG>o</STRONG> <STRONG>ktbc</STRONG> (clear all tabs),
1913 <STRONG>o</STRONG> <STRONG>kctab</STRONG> (clear the tab stop in this column),
1915 <STRONG>o</STRONG> <STRONG>kclr</STRONG> (clear screen or erase key),
1917 <STRONG>o</STRONG> <STRONG>kdch1</STRONG> (delete character),
1919 <STRONG>o</STRONG> <STRONG>kdl1</STRONG> (delete line),
1921 <STRONG>o</STRONG> <STRONG>krmir</STRONG> (exit insert mode),
1923 <STRONG>o</STRONG> <STRONG>kel</STRONG> (clear to end of line),
1925 <STRONG>o</STRONG> <STRONG>ked</STRONG> (clear to end of screen),
1927 <STRONG>o</STRONG> <STRONG>kich1</STRONG> (insert character or enter insert mode),
1929 <STRONG>o</STRONG> <STRONG>kil1</STRONG> (insert line),
1931 <STRONG>o</STRONG> <STRONG>knp</STRONG> (next page),
1933 <STRONG>o</STRONG> <STRONG>kpp</STRONG> (previous page),
1935 <STRONG>o</STRONG> <STRONG>kind</STRONG> (scroll forward/down),
1937 <STRONG>o</STRONG> <STRONG>kri</STRONG> (scroll backward/up),
1939 <STRONG>o</STRONG> <STRONG>khts</STRONG> (set a tab stop in this column).
1941 In addition, if the keypad has a 3 by 3 array of keys
1942 including the four arrow keys, the other five keys can be
1943 given as <STRONG>ka1</STRONG>, <STRONG>ka3</STRONG>, <STRONG>kb2</STRONG>, <STRONG>kc1</STRONG>, and <STRONG>kc3</STRONG>. These keys are use-
1944 ful when the effects of a 3 by 3 directional pad are
1947 Strings to program function keys can be given as <STRONG>pfkey</STRONG>,
1948 <STRONG>pfloc</STRONG>, and <STRONG>pfx</STRONG>. A string to program screen labels should
1949 be specified as <STRONG>pln</STRONG>. Each of these strings takes two
1950 parameters: the function key number to program (from 0 to
1951 10) and the string to program it with. Function key num-
1952 bers out of this range may program undefined keys in a
1953 terminal dependent manner. The difference between the
1954 capabilities is that <STRONG>pfkey</STRONG> causes pressing the given key
1955 to be the same as the user typing the given string; <STRONG>pfloc</STRONG>
1956 causes the string to be executed by the terminal in local;
1957 and <STRONG>pfx</STRONG> causes the string to be transmitted to the com-
1960 The capabilities <STRONG>nlab</STRONG>, <STRONG>lw</STRONG> and <STRONG>lh</STRONG> define the number of pro-
1961 grammable screen labels and their width and height. If
1962 there are commands to turn the labels on and off, give
1963 them in <STRONG>smln</STRONG> and <STRONG>rmln</STRONG>. <STRONG>smln</STRONG> is normally output after one
1964 or more pln sequences to make sure that the change becomes
1968 </PRE><H3><a name="h3-Tabs-and-Initialization">Tabs and Initialization</a></H3><PRE>
1969 If the terminal has hardware tabs, the command to advance
1970 to the next tab stop can be given as <STRONG>ht</STRONG> (usually control
1971 I). A "back-tab" command which moves leftward to the pre-
1972 ceding tab stop can be given as <STRONG>cbt</STRONG>. By convention, if
1973 the teletype modes indicate that tabs are being expanded
1974 by the computer rather than being sent to the terminal,
1975 programs should not use <STRONG>ht</STRONG> or <STRONG>cbt</STRONG> even if they are
1976 present, since the user may not have the tab stops prop-
1977 erly set. If the terminal has hardware tabs which are
1978 initially set every <EM>n</EM> spaces when the terminal is powered
1979 up, the numeric parameter <STRONG>it</STRONG> is given, showing the number
1980 of spaces the tabs are set to. This is normally used by
1981 the <STRONG>tset</STRONG> command to determine whether to set the mode for
1982 hardware tab expansion, and whether to set the tab stops.
1983 If the terminal has tab stops that can be saved in non-
1984 volatile memory, the terminfo description can assume that
1985 they are properly set.
1987 Other capabilities include <STRONG>is1</STRONG>, <STRONG>is2</STRONG>, and <STRONG>is3</STRONG>, initializa-
1988 tion strings for the terminal, <STRONG>iprog</STRONG>, the path name of a
1989 program to be run to initialize the terminal, and <STRONG>if</STRONG>, the
1990 name of a file containing long initialization strings.
1991 These strings are expected to set the terminal into modes
1992 consistent with the rest of the terminfo description.
1993 They are normally sent to the terminal, by the <EM>init</EM> option
1994 of the <STRONG>tput</STRONG> program, each time the user logs in. They
1995 will be printed in the following order:
1998 <STRONG>iprog</STRONG>
2000 output <STRONG>is1</STRONG> <STRONG>is2</STRONG>
2002 set the margins using
2003 <STRONG>mgc</STRONG>, <STRONG>smgl</STRONG> and <STRONG>smgr</STRONG>
2006 <STRONG>tbc</STRONG> and <STRONG>hts</STRONG>
2012 output <STRONG>is3</STRONG>.
2014 Most initialization is done with <STRONG>is2</STRONG>. Special terminal
2015 modes can be set up without duplicating strings by putting
2016 the common sequences in <STRONG>is2</STRONG> and special cases in <STRONG>is1</STRONG> and
2017 <STRONG>is3</STRONG>.
2019 A set of sequences that does a harder reset from a totally
2020 unknown state can be given as <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rf</STRONG> and <STRONG>rs3</STRONG>, analo-
2021 gous to <STRONG>is1</STRONG> <STRONG>,</STRONG> <STRONG>is2</STRONG> <STRONG>,</STRONG> <STRONG>if</STRONG> and <STRONG>is3</STRONG> respectively. These
2022 strings are output by the <STRONG>reset</STRONG> program, which is used
2023 when the terminal gets into a wedged state. Commands are
2024 normally placed in <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG> <STRONG>rs3</STRONG> and <STRONG>rf</STRONG> only if they pro-
2025 duce annoying effects on the screen and are not necessary
2026 when logging in. For example, the command to set the
2027 vt100 into 80-column mode would normally be part of <STRONG>is2</STRONG>,
2028 but it causes an annoying glitch of the screen and is not
2029 normally needed since the terminal is usually already in
2032 The <STRONG>reset</STRONG> program writes strings including <STRONG>iprog</STRONG>, etc., in
2033 the same order as the <EM>init</EM> program, using <STRONG>rs1</STRONG>, etc.,
2034 instead of <STRONG>is1</STRONG>, etc. If any of <STRONG>rs1</STRONG>, <STRONG>rs2</STRONG>, <STRONG>rs3</STRONG>, or <STRONG>rf</STRONG> reset
2035 capability strings are missing, the <STRONG>reset</STRONG> program falls
2036 back upon the corresponding initialization capability
2039 If there are commands to set and clear tab stops, they can
2040 be given as <STRONG>tbc</STRONG> (clear all tab stops) and <STRONG>hts</STRONG> (set a tab
2041 stop in the current column of every row). If a more com-
2042 plex sequence is needed to set the tabs than can be
2043 described by this, the sequence can be placed in <STRONG>is2</STRONG> or
2044 <STRONG>if</STRONG>.
2047 </PRE><H3><a name="h3-Delays-and-Padding">Delays and Padding</a></H3><PRE>
2048 Many older and slower terminals do not support either
2049 XON/XOFF or DTR handshaking, including hard copy terminals
2050 and some very archaic CRTs (including, for example, DEC
2051 VT100s). These may require padding characters after cer-
2052 tain cursor motions and screen changes.
2054 If the terminal uses xon/xoff handshaking for flow control
2055 (that is, it automatically emits ^S back to the host when
2056 its input buffers are close to full), set <STRONG>xon</STRONG>. This capa-
2057 bility suppresses the emission of padding. You can also
2058 set it for memory-mapped console devices effectively that
2059 do not have a speed limit. Padding information should
2060 still be included so that routines can make better deci-
2061 sions about relative costs, but actual pad characters will
2064 If <STRONG>pb</STRONG> (padding baud rate) is given, padding is suppressed
2065 at baud rates below the value of <STRONG>pb</STRONG>. If the entry has no
2066 padding baud rate, then whether padding is emitted or not
2067 is completely controlled by <STRONG>xon</STRONG>.
2069 If the terminal requires other than a null (zero) charac-
2070 ter as a pad, then this can be given as <STRONG>pad</STRONG>. Only the
2071 first character of the <STRONG>pad</STRONG> string is used.
2074 </PRE><H3><a name="h3-Status-Lines">Status Lines</a></H3><PRE>
2075 Some terminals have an extra "status line" which is not
2076 normally used by software (and thus not counted in the
2077 terminal's <STRONG>lines</STRONG> capability).
2079 The simplest case is a status line which is cursor-
2080 addressable but not part of the main scrolling region on
2081 the screen; the Heathkit H19 has a status line of this
2082 kind, as would a 24-line VT100 with a 23-line scrolling
2083 region set up on initialization. This situation is indi-
2084 cated by the <STRONG>hs</STRONG> capability.
2086 Some terminals with status lines need special sequences to
2087 access the status line. These may be expressed as a
2088 string with single parameter <STRONG>tsl</STRONG> which takes the cursor to
2089 a given zero-origin column on the status line. The capa-
2090 bility <STRONG>fsl</STRONG> must return to the main-screen cursor positions
2091 before the last <STRONG>tsl</STRONG>. You may need to embed the string
2092 values of <STRONG>sc</STRONG> (save cursor) and <STRONG>rc</STRONG> (restore cursor) in <STRONG>tsl</STRONG>
2093 and <STRONG>fsl</STRONG> to accomplish this.
2095 The status line is normally assumed to be the same width
2096 as the width of the terminal. If this is untrue, you can
2097 specify it with the numeric capability <STRONG>wsl</STRONG>.
2099 A command to erase or blank the status line may be speci-
2100 fied as <STRONG>dsl</STRONG>.
2102 The boolean capability <STRONG>eslok</STRONG> specifies that escape
2103 sequences, tabs, etc., work ordinarily in the status line.
2105 The <STRONG>ncurses</STRONG> implementation does not yet use any of these
2106 capabilities. They are documented here in case they ever
2110 </PRE><H3><a name="h3-Line-Graphics">Line Graphics</a></H3><PRE>
2111 Many terminals have alternate character sets useful for
2112 forms-drawing. Terminfo and <STRONG>curses</STRONG> build in support for
2113 the drawing characters supported by the VT100, with some
2114 characters from the AT&T 4410v1 added. This alternate
2115 character set may be specified by the <STRONG>acsc</STRONG> capability.
2117 <STRONG>Glyph</STRONG> <STRONG>ACS</STRONG> <STRONG>Ascii</STRONG> <STRONG>VT100</STRONG>
2118 <STRONG>Name</STRONG> <STRONG>Name</STRONG> <STRONG>Default</STRONG> <STRONG>Name</STRONG>
2119 UK pound sign ACS_STERLING f }
2120 arrow pointing down ACS_DARROW v .
2121 arrow pointing left ACS_LARROW < ,
2122 arrow pointing right ACS_RARROW > +
2123 arrow pointing up ACS_UARROW ^ -
2124 board of squares ACS_BOARD # h
2125 bullet ACS_BULLET o ~
2126 checker board (stipple) ACS_CKBOARD : a
2127 degree symbol ACS_DEGREE \ f
2128 diamond ACS_DIAMOND + `
2129 greater-than-or-equal-to ACS_GEQUAL > z
2132 horizontal line ACS_HLINE - q
2133 lantern symbol ACS_LANTERN # i
2134 large plus or crossover ACS_PLUS + n
2135 less-than-or-equal-to ACS_LEQUAL < y
2136 lower left corner ACS_LLCORNER + m
2137 lower right corner ACS_LRCORNER + j
2138 not-equal ACS_NEQUAL ! |
2139 plus/minus ACS_PLMINUS # g
2140 scan line 1 ACS_S1 ~ o
2141 scan line 3 ACS_S3 - p
2142 scan line 7 ACS_S7 - r
2143 scan line 9 ACS_S9 _ s
2144 solid square block ACS_BLOCK # 0
2145 tee pointing down ACS_TTEE + w
2146 tee pointing left ACS_RTEE + u
2147 tee pointing right ACS_LTEE + t
2148 tee pointing up ACS_BTEE + v
2149 upper left corner ACS_ULCORNER + l
2150 upper right corner ACS_URCORNER + k
2151 vertical line ACS_VLINE | x
2153 The best way to define a new device's graphics set is to
2154 add a column to a copy of this table for your terminal,
2155 giving the character which (when emitted between
2156 <STRONG>smacs</STRONG>/<STRONG>rmacs</STRONG> switches) will be rendered as the correspond-
2157 ing graphic. Then read off the VT100/your terminal char-
2158 acter pairs right to left in sequence; these become the
2162 </PRE><H3><a name="h3-Color-Handling">Color Handling</a></H3><PRE>
2163 The curses library functions <STRONG>init_pair</STRONG> and <STRONG>init_color</STRONG>
2164 manipulate the <EM>color</EM> <EM>pairs</EM> and <EM>color</EM> <EM>values</EM> discussed in
2165 this section (see <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG> for details on these and
2168 Most color terminals are either "Tektronix-like" or "HP-
2171 <STRONG>o</STRONG> Tektronix-like terminals have a predefined set of <EM>N</EM>
2172 colors (where <EM>N</EM> is usually 8), and can set character-
2173 cell foreground and background characters indepen-
2174 dently, mixing them into <EM>N</EM> * <EM>N</EM> color-pairs.
2176 <STRONG>o</STRONG> On HP-like terminals, the user must set each color
2177 pair up separately (foreground and background are not
2178 independently settable). Up to <EM>M</EM> color-pairs may be
2179 set up from 2*<EM>M</EM> different colors. ANSI-compatible
2180 terminals are Tektronix-like.
2182 Some basic color capabilities are independent of the color
2183 method. The numeric capabilities <STRONG>colors</STRONG> and <STRONG>pairs</STRONG> specify
2184 the maximum numbers of colors and color-pairs that can be
2185 displayed simultaneously. The <STRONG>op</STRONG> (original pair) string
2186 resets foreground and background colors to their default
2187 values for the terminal. The <STRONG>oc</STRONG> string resets all colors
2188 or color-pairs to their default values for the terminal.
2189 Some terminals (including many PC terminal emulators)
2190 erase screen areas with the current background color
2191 rather than the power-up default background; these should
2192 have the boolean capability <STRONG>bce</STRONG>.
2194 While the curses library works with <EM>color</EM> <EM>pairs</EM> (reflect-
2195 ing the inability of some devices to set foreground and
2196 background colors independently), there are separate capa-
2197 bilities for setting these features:
2199 <STRONG>o</STRONG> To change the current foreground or background color
2200 on a Tektronix-type terminal, use <STRONG>setaf</STRONG> (set ANSI
2201 foreground) and <STRONG>setab</STRONG> (set ANSI background) or <STRONG>setf</STRONG>
2202 (set foreground) and <STRONG>setb</STRONG> (set background). These
2203 take one parameter, the color number. The SVr4 docu-
2204 mentation describes only <STRONG>setaf</STRONG>/<STRONG>setab</STRONG>; the XPG4 draft
2205 says that "If the terminal supports ANSI escape
2206 sequences to set background and foreground, they
2207 should be coded as <STRONG>setaf</STRONG> and <STRONG>setab</STRONG>, respectively.
2209 <STRONG>o</STRONG> If the terminal supports other escape sequences to set
2210 background and foreground, they should be coded as
2211 <STRONG>setf</STRONG> and <STRONG>setb</STRONG>, respectively. The <STRONG>vidputs</STRONG> and the
2212 <STRONG><A HREF="curs_refresh.3x.html">refresh(3x)</A></STRONG> functions use the <STRONG>setaf</STRONG> and <STRONG>setab</STRONG> capabil-
2213 ities if they are defined.
2215 The <STRONG>setaf</STRONG>/<STRONG>setab</STRONG> and <STRONG>setf</STRONG>/<STRONG>setb</STRONG> capabilities take a single
2216 numeric argument each. Argument values 0-7 of <STRONG>setaf</STRONG>/<STRONG>setab</STRONG>
2217 are portably defined as follows (the middle column is the
2218 symbolic #define available in the header for the <STRONG>curses</STRONG> or
2219 <STRONG>ncurses</STRONG> libraries). The terminal hardware is free to map
2220 these as it likes, but the RGB values indicate normal
2221 locations in color space.
2223 <STRONG>Color</STRONG> <STRONG>#define</STRONG> <STRONG>Value</STRONG> <STRONG>RGB</STRONG>
2224 black <STRONG>COLOR_BLACK</STRONG> 0 0, 0, 0
2225 red <STRONG>COLOR_RED</STRONG> 1 max,0,0
2226 green <STRONG>COLOR_GREEN</STRONG> 2 0,max,0
2227 yellow <STRONG>COLOR_YELLOW</STRONG> 3 max,max,0
2228 blue <STRONG>COLOR_BLUE</STRONG> 4 0,0,max
2229 magenta <STRONG>COLOR_MAGENTA</STRONG> 5 max,0,max
2230 cyan <STRONG>COLOR_CYAN</STRONG> 6 0,max,max
2231 white <STRONG>COLOR_WHITE</STRONG> 7 max,max,max
2233 The argument values of <STRONG>setf</STRONG>/<STRONG>setb</STRONG> historically correspond
2234 to a different mapping, i.e.,
2236 <STRONG>Color</STRONG> <STRONG>#define</STRONG> <STRONG>Value</STRONG> <STRONG>RGB</STRONG>
2237 black <STRONG>COLOR_BLACK</STRONG> 0 0, 0, 0
2238 blue <STRONG>COLOR_BLUE</STRONG> 1 0,0,max
2239 green <STRONG>COLOR_GREEN</STRONG> 2 0,max,0
2240 cyan <STRONG>COLOR_CYAN</STRONG> 3 0,max,max
2241 red <STRONG>COLOR_RED</STRONG> 4 max,0,0
2242 magenta <STRONG>COLOR_MAGENTA</STRONG> 5 max,0,max
2243 yellow <STRONG>COLOR_YELLOW</STRONG> 6 max,max,0
2244 white <STRONG>COLOR_WHITE</STRONG> 7 max,max,max
2246 It is important to not confuse the two sets of color capa-
2247 bilities; otherwise red/blue will be interchanged on the
2250 On an HP-like terminal, use <STRONG>scp</STRONG> with a color-pair number
2251 parameter to set which color pair is current.
2253 Some terminals allow the <EM>color</EM> <EM>values</EM> to be modified:
2255 <STRONG>o</STRONG> On a Tektronix-like terminal, the capability <STRONG>ccc</STRONG> may
2256 be present to indicate that colors can be modified.
2257 If so, the <STRONG>initc</STRONG> capability will take a color number
2258 (0 to <STRONG>colors</STRONG> - 1)and three more parameters which
2259 describe the color. These three parameters default to
2260 being interpreted as RGB (Red, Green, Blue) values.
2261 If the boolean capability <STRONG>hls</STRONG> is present, they are
2262 instead as HLS (Hue, Lightness, Saturation) indices.
2263 The ranges are terminal-dependent.
2265 <STRONG>o</STRONG> On an HP-like terminal, <STRONG>initp</STRONG> may give a capability
2266 for changing a color-pair value. It will take seven
2267 parameters; a color-pair number (0 to <STRONG>max_pairs</STRONG> - 1),
2268 and two triples describing first background and then
2269 foreground colors. These parameters must be (Red,
2270 Green, Blue) or (Hue, Lightness, Saturation) depending
2271 on <STRONG>hls</STRONG>.
2273 On some color terminals, colors collide with highlights.
2274 You can register these collisions with the <STRONG>ncv</STRONG> capability.
2275 This is a bit-mask of attributes not to be used when col-
2276 ors are enabled. The correspondence with the attributes
2277 understood by <STRONG>curses</STRONG> is as follows:
2279 <STRONG>Attribute</STRONG> <STRONG>Bit</STRONG> <STRONG>Decimal</STRONG> <STRONG>Set</STRONG> <STRONG>by</STRONG>
2288 A_ALTCHARSET 8 256 sgr
2289 A_HORIZONTAL 9 512 sgr1
2292 A_RIGHT 12 4096 sgr1
2294 A_VERTICAL 14 16384 sgr1
2295 A_ITALIC 15 32768 sitm
2297 For example, on many IBM PC consoles, the underline
2298 attribute collides with the foreground color blue and is
2299 not available in color mode. These should have an <STRONG>ncv</STRONG>
2302 SVr4 curses does nothing with <STRONG>ncv</STRONG>, ncurses recognizes it
2303 and optimizes the output in favor of colors.
2306 </PRE><H3><a name="h3-Miscellaneous">Miscellaneous</a></H3><PRE>
2307 If the terminal requires other than a null (zero) charac-
2308 ter as a pad, then this can be given as pad. Only the
2309 first character of the pad string is used. If the termi-
2310 nal does not have a pad character, specify npc. Note that
2311 ncurses implements the termcap-compatible <STRONG>PC</STRONG> variable;
2312 though the application may set this value to something
2313 other than a null, ncurses will test <STRONG>npc</STRONG> first and use
2314 napms if the terminal has no pad character.
2316 If the terminal can move up or down half a line, this can
2317 be indicated with <STRONG>hu</STRONG> (half-line up) and <STRONG>hd</STRONG> (half-line
2318 down). This is primarily useful for superscripts and sub-
2319 scripts on hard-copy terminals. If a hard-copy terminal
2320 can eject to the next page (form feed), give this as <STRONG>ff</STRONG>
2321 (usually control L).
2323 If there is a command to repeat a given character a given
2324 number of times (to save time transmitting a large number
2325 of identical characters) this can be indicated with the
2326 parameterized string <STRONG>rep</STRONG>. The first parameter is the
2327 character to be repeated and the second is the number of
2328 times to repeat it. Thus, tparm(repeat_char, 'x', 10) is
2329 the same as "xxxxxxxxxx".
2331 If the terminal has a settable command character, such as
2332 the TEKTRONIX 4025, this can be indicated with <STRONG>cmdch</STRONG>. A
2333 prototype command character is chosen which is used in all
2334 capabilities. This character is given in the <STRONG>cmdch</STRONG> capa-
2335 bility to identify it. The following convention is sup-
2336 ported on some UNIX systems: The environment is to be
2337 searched for a <STRONG>CC</STRONG> variable, and if found, all occurrences
2338 of the prototype character are replaced with the character
2339 in the environment variable.
2341 Terminal descriptions that do not represent a specific
2342 kind of known terminal, such as <EM>switch</EM>, <EM>dialup</EM>, <EM>patch</EM>, and
2343 <EM>network</EM>, should include the <STRONG>gn</STRONG> (generic) capability so
2344 that programs can complain that they do not know how to
2345 talk to the terminal. (This capability does not apply to
2346 <EM>virtual</EM> terminal descriptions for which the escape
2347 sequences are known.)
2349 If the terminal has a "meta key" which acts as a shift
2350 key, setting the 8th bit of any character transmitted,
2351 this fact can be indicated with <STRONG>km</STRONG>. Otherwise, software
2352 will assume that the 8th bit is parity and it will usually
2353 be cleared. If strings exist to turn this "meta mode" on
2354 and off, they can be given as <STRONG>smm</STRONG> and <STRONG>rmm</STRONG>.
2356 If the terminal has more lines of memory than will fit on
2357 the screen at once, the number of lines of memory can be
2358 indicated with <STRONG>lm</STRONG>. A value of <STRONG>lm</STRONG>#0 indicates that the
2359 number of lines is not fixed, but that there is still more
2360 memory than fits on the screen.
2362 If the terminal is one of those supported by the UNIX vir-
2363 tual terminal protocol, the terminal number can be given
2364 as <STRONG>vt</STRONG>.
2366 Media copy strings which control an auxiliary printer con-
2367 nected to the terminal can be given as <STRONG>mc0</STRONG>: print the con-
2368 tents of the screen, <STRONG>mc4</STRONG>: turn off the printer, and <STRONG>mc5</STRONG>:
2369 turn on the printer. When the printer is on, all text
2370 sent to the terminal will be sent to the printer. It is
2371 undefined whether the text is also displayed on the termi-
2372 nal screen when the printer is on. A variation <STRONG>mc5p</STRONG> takes
2373 one parameter, and leaves the printer on for as many char-
2374 acters as the value of the parameter, then turns the
2375 printer off. The parameter should not exceed 255. All
2376 text, including <STRONG>mc4</STRONG>, is transparently passed to the
2377 printer while an <STRONG>mc5p</STRONG> is in effect.
2380 </PRE><H3><a name="h3-Glitches-and-Braindamage">Glitches and Braindamage</a></H3><PRE>
2381 Hazeltine terminals, which do not allow "~" characters to
2382 be displayed should indicate <STRONG>hz</STRONG>.
2384 Terminals which ignore a line-feed immediately after an <STRONG>am</STRONG>
2385 wrap, such as the Concept and vt100, should indicate <STRONG>xenl</STRONG>.
2387 If <STRONG>el</STRONG> is required to get rid of standout (instead of
2388 merely writing normal text on top of it), <STRONG>xhp</STRONG> should be
2391 Teleray terminals, where tabs turn all characters moved
2392 over to blanks, should indicate <STRONG>xt</STRONG> (destructive tabs).
2393 Note: the variable indicating this is now
2394 "dest_tabs_magic_smso"; in older versions, it was tel-
2395 eray_glitch. This glitch is also taken to mean that it is
2396 not possible to position the cursor on top of a "magic
2397 cookie", that to erase standout mode it is instead neces-
2398 sary to use delete and insert line. The ncurses implemen-
2399 tation ignores this glitch.
2401 The Beehive Superbee, which is unable to correctly trans-
2402 mit the escape or control C characters, has <STRONG>xsb</STRONG>, indicat-
2403 ing that the f1 key is used for escape and f2 for control
2404 C. (Only certain Superbees have this problem, depending
2405 on the ROM.) Note that in older terminfo versions, this
2406 capability was called "beehive_glitch"; it is now
2409 Other specific terminal problems may be corrected by
2410 adding more capabilities of the form <STRONG>x</STRONG><EM>x</EM>.
2413 </PRE><H3><a name="h3-Pitfalls-of-Long-Entries">Pitfalls of Long Entries</a></H3><PRE>
2414 Long terminfo entries are unlikely to be a problem; to
2415 date, no entry has even approached terminfo's 4096-byte
2416 string-table maximum. Unfortunately, the termcap transla-
2417 tions are much more strictly limited (to 1023 bytes), thus
2418 termcap translations of long terminfo entries can cause
2421 The man pages for 4.3BSD and older versions of <STRONG>tgetent</STRONG>
2422 instruct the user to allocate a 1024-byte buffer for the
2423 termcap entry. The entry gets null-terminated by the
2424 termcap library, so that makes the maximum safe length for
2425 a termcap entry 1k-1 (1023) bytes. Depending on what the
2426 application and the termcap library being used does, and
2427 where in the termcap file the terminal type that <STRONG>tgetent</STRONG>
2428 is searching for is, several bad things can happen.
2430 Some termcap libraries print a warning message or exit if
2431 they find an entry that's longer than 1023 bytes; others
2432 do not; others truncate the entries to 1023 bytes. Some
2433 application programs allocate more than the recommended 1K
2434 for the termcap entry; others do not.
2436 Each termcap entry has two important sizes associated with
2437 it: before "tc" expansion, and after "tc" expansion. "tc"
2438 is the capability that tacks on another termcap entry to
2439 the end of the current one, to add on its capabilities.
2440 If a termcap entry does not use the "tc" capability, then
2441 of course the two lengths are the same.
2443 The "before tc expansion" length is the most important
2444 one, because it affects more than just users of that par-
2445 ticular terminal. This is the length of the entry as it
2446 exists in /etc/termcap, minus the backslash-newline pairs,
2447 which <STRONG>tgetent</STRONG> strips out while reading it. Some termcap
2448 libraries strip off the final newline, too (GNU termcap
2449 does not). Now suppose:
2451 <STRONG>o</STRONG> a termcap entry before expansion is more than 1023
2454 <STRONG>o</STRONG> and the application has only allocated a 1k buffer,
2456 <STRONG>o</STRONG> and the termcap library (like the one in BSD/OS 1.1
2457 and GNU) reads the whole entry into the buffer, no
2458 matter what its length, to see if it is the entry it
2461 <STRONG>o</STRONG> and <STRONG>tgetent</STRONG> is searching for a terminal type that
2462 either is the long entry, appears in the termcap file
2463 after the long entry, or does not appear in the file
2464 at all (so that <STRONG>tgetent</STRONG> has to search the whole term-
2467 Then <STRONG>tgetent</STRONG> will overwrite memory, perhaps its stack, and
2468 probably core dump the program. Programs like telnet are
2469 particularly vulnerable; modern telnets pass along values
2470 like the terminal type automatically. The results are
2471 almost as undesirable with a termcap library, like SunOS
2472 4.1.3 and Ultrix 4.4, that prints warning messages when it
2473 reads an overly long termcap entry. If a termcap library
2474 truncates long entries, like OSF/1 3.0, it is immune to
2475 dying here but will return incorrect data for the termi-
2478 The "after tc expansion" length will have a similar effect
2479 to the above, but only for people who actually set TERM to
2480 that terminal type, since <STRONG>tgetent</STRONG> only does "tc" expansion
2481 once it is found the terminal type it was looking for, not
2484 In summary, a termcap entry that is longer than 1023 bytes
2485 can cause, on various combinations of termcap libraries
2486 and applications, a core dump, warnings, or incorrect
2487 operation. If it is too long even before "tc" expansion,
2488 it will have this effect even for users of some other ter-
2489 minal types and users whose TERM variable does not have a
2492 When in -C (translate to termcap) mode, the <STRONG>ncurses</STRONG> imple-
2493 mentation of <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG> issues warning messages when the pre-
2494 tc length of a termcap translation is too long. The -c
2495 (check) option also checks resolved (after tc expansion)
2499 </PRE><H3><a name="h3-Binary-Compatibility">Binary Compatibility</a></H3><PRE>
2500 It is not wise to count on portability of binary terminfo
2501 entries between commercial UNIX versions. The problem is
2502 that there are at least two versions of terminfo (under
2503 HP-UX and AIX) which diverged from System V terminfo after
2504 SVr1, and have added extension capabilities to the string
2505 table that (in the binary format) collide with System V
2506 and XSI Curses extensions.
2509 </PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
2510 Searching for terminal descriptions in <STRONG>$HOME/.terminfo</STRONG> and
2511 TERMINFO_DIRS is not supported by older implementations.
2513 Some SVr4 <STRONG>curses</STRONG> implementations, and all previous to
2514 SVr4, do not interpret the %A and %O operators in parame-
2517 SVr4/XPG4 do not specify whether <STRONG>msgr</STRONG> licenses movement
2518 while in an alternate-character-set mode (such modes may,
2519 among other things, map CR and NL to characters that do
2520 not trigger local motions). The <STRONG>ncurses</STRONG> implementation
2521 ignores <STRONG>msgr</STRONG> in <STRONG>ALTCHARSET</STRONG> mode. This raises the possi-
2522 bility that an XPG4 implementation making the opposite
2523 interpretation may need terminfo entries made for <STRONG>ncurses</STRONG>
2524 to have <STRONG>msgr</STRONG> turned off.
2526 The <STRONG>ncurses</STRONG> library handles insert-character and insert-
2527 character modes in a slightly non-standard way to get bet-
2528 ter update efficiency. See the <STRONG>Insert/Delete</STRONG> <STRONG>Character</STRONG>
2531 The parameter substitutions for <STRONG>set_clock</STRONG> and <STRONG>dis-</STRONG>
2532 <STRONG>play_clock</STRONG> are not documented in SVr4 or the XSI Curses
2533 standard. They are deduced from the documentation for the
2534 AT&T 505 terminal.
2536 Be careful assigning the <STRONG>kmous</STRONG> capability. The <STRONG>ncurses</STRONG>
2537 library wants to interpret it as <STRONG>KEY_MOUSE</STRONG>, for use by
2538 terminals and emulators like xterm that can return mouse-
2539 tracking information in the keyboard-input stream.
2541 X/Open Curses does not mention italics. Portable applica-
2542 tions must assume that numeric capabilities are signed
2543 16-bit values. This includes the <EM>no</EM><STRONG>_</STRONG><EM>color</EM><STRONG>_</STRONG><EM>video</EM> (ncv)
2544 capability. The 32768 mask value used for italics with
2545 ncv can be confused with an absent or cancelled ncv. If
2546 italics should work with colors, then the ncv value must
2547 be specified, even if it is zero.
2549 Different commercial ports of terminfo and curses support
2550 different subsets of the XSI Curses standard and (in some
2551 cases) different extension sets. Here is a summary, accu-
2552 rate as of October 1995:
2554 <STRONG>o</STRONG> <STRONG>SVR4,</STRONG> <STRONG>Solaris,</STRONG> <STRONG>ncurses</STRONG> -- These support all SVr4 capa-
2557 <STRONG>o</STRONG> <STRONG>SGI</STRONG> -- Supports the SVr4 set, adds one undocumented
2558 extended string capability (<STRONG>set_pglen</STRONG>).
2560 <STRONG>o</STRONG> <STRONG>SVr1,</STRONG> <STRONG>Ultrix</STRONG> -- These support a restricted subset of
2561 terminfo capabilities. The booleans end with
2562 <STRONG>xon_xoff</STRONG>; the numerics with <STRONG>width_status_line</STRONG>; and the
2563 strings with <STRONG>prtr_non</STRONG>.
2565 <STRONG>o</STRONG> <STRONG>HP/UX</STRONG> -- Supports the SVr1 subset, plus the SVr[234]
2566 numerics <STRONG>num_labels</STRONG>, <STRONG>label_height</STRONG>, <STRONG>label_width</STRONG>, plus
2567 function keys 11 through 63, plus <STRONG>plab_norm</STRONG>, <STRONG>label_on</STRONG>,
2568 and <STRONG>label_off</STRONG>, plus some incompatible extensions in
2571 <STRONG>o</STRONG> <STRONG>AIX</STRONG> -- Supports the SVr1 subset, plus function keys 11
2572 through 63, plus a number of incompatible string table
2575 <STRONG>o</STRONG> <STRONG>OSF</STRONG> -- Supports both the SVr4 set and the AIX exten-
2579 </PRE><H2><a name="h2-FILES">FILES</a></H2><PRE>
2580 /usr/share/terminfo/?/* files containing terminal
2584 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
2585 <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>,
2586 <STRONG>printf(3)</STRONG>, <STRONG><A HREF="term.5.html">term(5)</A></STRONG>. <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>.
2589 </PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
2590 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
2591 Based on pcurses by Pavel Curtis.
2595 <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
2599 <li><a href="#h2-NAME">NAME</a></li>
2600 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
2601 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
2603 <li><a href="#h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></li>
2604 <li><a href="#h3-Terminfo-Capabilities-Syntax">Terminfo Capabilities Syntax</a></li>
2605 <li><a href="#h3-Similar-Terminals">Similar Terminals</a></li>
2606 <li><a href="#h3-Predefined-Capabilities">Predefined Capabilities</a></li>
2607 <li><a href="#h3-User-Defined-Capabilities">User-Defined Capabilities</a></li>
2608 <li><a href="#h3-A-Sample-Entry">A Sample Entry</a></li>
2609 <li><a href="#h3-Types-of-Capabilities">Types of Capabilities</a></li>
2610 <li><a href="#h3-Fetching-Compiled-Descriptions">Fetching Compiled Descriptions</a></li>
2611 <li><a href="#h3-Preparing-Descriptions">Preparing Descriptions</a></li>
2612 <li><a href="#h3-Basic-Capabilities">Basic Capabilities</a></li>
2613 <li><a href="#h3-Parameterized-Strings">Parameterized Strings</a></li>
2614 <li><a href="#h3-Cursor-Motions">Cursor Motions</a></li>
2615 <li><a href="#h3-Area-Clears">Area Clears</a></li>
2616 <li><a href="#h3-Insert_delete-line-and-vertical-motions">Insert/delete line and vertical motions</a></li>
2617 <li><a href="#h3-Insert_Delete-Character">Insert/Delete Character</a></li>
2618 <li><a href="#h3-Highlighting_-Underlining_-and-Visible-Bells">Highlighting, Underlining, and Visible Bells</a></li>
2619 <li><a href="#h3-Keypad-and-Function-Keys">Keypad and Function Keys</a></li>
2620 <li><a href="#h3-Tabs-and-Initialization">Tabs and Initialization</a></li>
2621 <li><a href="#h3-Delays-and-Padding">Delays and Padding</a></li>
2622 <li><a href="#h3-Status-Lines">Status Lines</a></li>
2623 <li><a href="#h3-Line-Graphics">Line Graphics</a></li>
2624 <li><a href="#h3-Color-Handling">Color Handling</a></li>
2625 <li><a href="#h3-Miscellaneous">Miscellaneous</a></li>
2626 <li><a href="#h3-Glitches-and-Braindamage">Glitches and Braindamage</a></li>
2627 <li><a href="#h3-Pitfalls-of-Long-Entries">Pitfalls of Long Entries</a></li>
2628 <li><a href="#h3-Binary-Compatibility">Binary Compatibility</a></li>
2631 <li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
2632 <li><a href="#h2-FILES">FILES</a></li>
2633 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
2634 <li><a href="#h2-AUTHORS">AUTHORS</a></li>