2 .\" DO NOT EDIT THIS FILE BY HAND!
3 .\" 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 .\"***************************************************************************
35 .\" $Id: terminfo.head,v 1.32 2017/04/22 13:52:49 tom Exp $
36 .TH terminfo 5 "" "" "File Formats"
38 .ds d /usr/local/share/terminfo
60 terminfo \- terminal capability data base
65 is a data base describing terminals, used by screen-oriented programs such as
71 describes terminals by giving a set of capabilities which they
72 have, by specifying how to perform screen operations, and by
73 specifying padding requirements and initialization sequences.
74 This describes \fBncurses\fR
75 version 6.0 (patch 20171007).
76 .SS Terminfo Entry Syntax
80 consist of a sequence of fields:
82 Each field ends with a comma \*(``,\*(''
83 (embedded commas may be
84 escaped with a backslash or written as \*(``\\054\*('').
86 White space between fields is ignored.
88 The first field in a \fIterminfo\fP entry begins in the first column.
90 Newlines and leading whitespace (spaces or tabs)
91 may be used for formatting entries for readability.
92 These are removed from parsed entries.
94 The \fBinfocmp\fP \fB\-f\fP and \fB\-W\fP options rely on this to
95 format if-then-else expressions,
96 or to enforce maximum line-width.
97 The resulting formatted terminal description can be read by \fBtic\fP.
99 The first field for each terminal gives the names which are known for the
100 terminal, separated by \*(``|\*('' characters.
102 The first name given is the most common abbreviation for the terminal
104 the last name given should be a long name fully identifying the terminal
105 (see \fBlongname\fP(3X)),
106 and all others are treated as synonyms (aliases) for the primary terminal name.
108 X/Open Curses advises that all names but the last should be in lower case
109 and contain no blanks;
110 the last name may well contain upper case and blanks for readability.
112 This implementation is not so strict;
113 it allows mixed case in the primary name and aliases.
114 If the last name has no embedded blanks,
115 it allows that to be both an alias and a verbose name
116 (but will warn about this ambiguity).
118 Lines beginning with a \*(``#\*('' in the first column are treated as comments.
120 While comment lines are legal at any point, the output of \fBcaptoinfo\fP
121 and \fBinfotocap\fP (aliases for \fBtic\fP)
122 will move comments so they occur only between entries.
124 Terminal names (except for the last, verbose entry) should
125 be chosen using the following conventions.
126 The particular piece of hardware making up the terminal should
127 have a root name, thus \*(``hp2621\*(''.
128 This name should not contain hyphens.
129 Modes that the hardware can be in, or user preferences, should
130 be indicated by appending a hyphen and a mode suffix.
131 Thus, a vt100 in 132 column mode would be vt100\-w.
132 The following suffixes should be used where possible:
138 \fBSuffix Meaning Example\fP
139 \-\fInn\fP Number of lines on the screen aaa\-60
140 \-\fIn\fPp Number of pages of memory c100\-4p
141 \-am With automargins (usually the default) vt100\-am
142 \-m Mono mode; suppress color ansi\-m
143 \-mc Magic cookie; spaces when highlighting wy30\-mc
144 \-na No arrow keys (leave them in local) c100\-na
145 \-nam Without automatic margins vt100\-nam
146 \-nl No status line att4415\-nl
147 \-ns No status line hp2626\-ns
148 \-rv Reverse video c100\-rv
149 \-s Enable status line vt100\-s
150 \-vb Use visible bell instead of beep wy370\-vb
151 \-w Wide mode (> 80 columns, usually 132) vt100\-w
154 For more on terminal naming conventions, see the \fBterm(7)\fR manual page.
155 .SS Terminfo Capabilities Syntax
157 The terminfo entry consists of several \fIcapabilities\fP,
158 i.e., features that the terminal has,
159 or methods for exercising the terminal's features.
161 After the first field (giving the name(s) of the terminal entry),
162 there should be one or more \fIcapability\fP fields.
163 These are boolean, numeric or string names with corresponding values:
165 Boolean capabilities are true when present, false when absent.
166 There is no explicit value for boolean capabilities.
168 Numeric capabilities have a \*(``#\*('' following the name,
169 then an unsigned decimal integer value.
171 String capabilities have a \*(``=\*('' following the name,
172 then an string of characters making up the capability value.
174 String capabilities can be split into multiple lines,
175 just as the fields comprising a terminal entry can be
176 split into multiple lines.
177 While blanks between fields are ignored,
178 blanks embedded within a string value are retained,
179 except for leading blanks on a line.
181 Any capability can be \fIcanceled\fP,
182 i.e., suppressed from the terminal entry,
183 by following its name with \*(``@\*(''
184 rather than a capability value.
185 .SS Similar Terminals
187 If there are two very similar terminals, one (the variant) can be defined as
188 being just like the other (the base) with certain exceptions.
190 definition of the variant, the string capability \fBuse\fR can be given with
191 the name of the base terminal:
193 The capabilities given before
195 override those in the base type named by
198 If there are multiple \fBuse\fR capabilities, they are merged in reverse order.
199 That is, the rightmost \fBuse\fR reference is processed first, then the one to
200 its left, and so forth.
202 Capabilities given explicitly in the entry override
203 those brought in by \fBuse\fR references.
205 A capability can be canceled by placing \fBxx@\fR to the left of the
206 use reference that imports it, where \fIxx\fP is the capability.
207 For example, the entry
210 2621\-nl, smkx@, rmkx@, use=2621,
213 defines a 2621\-nl that does not have the \fBsmkx\fR or \fBrmkx\fR capabilities,
214 and hence does not turn on the function key labels when in visual mode.
215 This is useful for different modes for a terminal, or for different
218 An entry included via \fBuse\fP can contain canceled capabilities,
219 which have the same effect as if those cancels were inline in the
220 using terminal entry.
221 .SS Predefined Capabilities
222 .\" Head of terminfo man page ends here
224 The following is a complete table of the capabilities included in a
225 terminfo description block and available to terminfo-using code. In each
228 The \fBvariable\fR is the name by which the programmer (at the terminfo level)
229 accesses the capability.
231 The \fBcapname\fR is the short name used in the text of the database,
232 and is used by a person updating the database.
233 Whenever possible, capnames are chosen to be the same as or similar to
234 the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses
235 identical or very similar names). Semantics are also intended to match
236 those of the specification.
238 The termcap code is the old
240 capability name (some capabilities are new, and have names which termcap
243 Capability names have no hard length limit, but an informal limit of 5
244 characters has been adopted to keep them short and to allow the tabs in
249 Finally, the description field attempts to convey the semantics of the
250 capability. You may find some codes in the description field:
253 indicates that padding may be specified
256 in the description field indicates that the string is passed through tparm with
257 parms as given (#\fIi\fP).
260 indicates that padding may vary in proportion to the number of
264 indicates the \fIi\fP\uth\d parameter.
267 These are the boolean capabilities:
275 \fBVariable Cap- TCap Description\fR
276 \fBBooleans name Code\fR
277 auto_left_margin bw bw T{
278 cub1 wraps from column 0 to last column
280 auto_right_margin am am T{
281 terminal has automatic margins
283 back_color_erase bce ut T{
284 screen erased with background color
287 terminal can re-define existing colors
289 ceol_standout_glitch xhp xs T{
290 standout not erased by overwriting (hp)
292 col_addr_glitch xhpa YA T{
293 only positive motion for hpa/mhpa caps
295 cpi_changes_res cpix YF T{
296 changing character pitch changes resolution
298 cr_cancels_micro_mode crxm YB T{
299 using cr turns off micro mode
301 dest_tabs_magic_smso xt xt T{
302 tabs destructive, magic so char (t1061)
304 eat_newline_glitch xenl xn T{
305 newline ignored after 80 cols (concept)
307 erase_overstrike eo eo T{
308 can erase overstrikes with a blank
310 generic_type gn gn T{
316 hard_cursor chts HC T{
317 cursor is hard to see
319 has_meta_key km km T{
320 Has a meta key (i.e., sets 8th-bit)
322 has_print_wheel daisy YC T{
323 printer needs operator to change character set
325 has_status_line hs hs T{
326 has extra status line
328 hue_lightness_saturation hls hl T{
329 terminal uses only HLS color notation (Tektronix)
331 insert_null_glitch in in T{
332 insert mode distinguishes nulls
334 lpi_changes_res lpix YG T{
335 changing line pitch changes resolution
337 memory_above da da T{
338 display may be retained above the screen
340 memory_below db db T{
341 display may be retained below the screen
343 move_insert_mode mir mi T{
344 safe to move while in insert mode
346 move_standout_mode msgr ms T{
347 safe to move while in standout mode
349 needs_xon_xoff nxon nx T{
350 padding will not work, xon/xoff required
352 no_esc_ctlc xsb xb T{
353 beehive (f1=escape, f2=ctrl C)
355 no_pad_char npc NP T{
356 pad character does not exist
358 non_dest_scroll_region ndscr ND T{
359 scrolling region is non-destructive
361 non_rev_rmcup nrrmc NR T{
362 smcup does not reverse rmcup
365 terminal can overstrike
367 prtr_silent mc5i 5i T{
368 printer will not echo on screen
370 row_addr_glitch xvpa YD T{
371 only positive motion for vpa/mvpa caps
373 semi_auto_right_margin sam YE T{
374 printing in last column causes cr
376 status_line_esc_ok eslok es T{
377 escape can be used on the status line
379 tilde_glitch hz hz T{
380 cannot print ~'s (Hazeltine)
382 transparent_underline ul ul T{
383 underline character overstrikes
386 terminal uses xon/xoff handshaking
391 These are the numeric capabilities:
399 \fBVariable Cap- TCap Description\fR
400 \fBNumeric name Code\fR
402 number of columns in a line
405 tabs initially every # spaces
407 label_height lh lh T{
411 columns in each label
414 number of lines on screen or page
416 lines_of_memory lm lm T{
417 lines of memory if > line. 0 means varies
419 magic_cookie_glitch xmc sg T{
420 number of blank characters left by smso or rmso
422 max_attributes ma ma T{
423 maximum combined attributes terminal can handle
425 max_colors colors Co T{
426 maximum number of colors on screen
428 max_pairs pairs pa T{
429 maximum number of color-pairs on the screen
431 maximum_windows wnum MW T{
432 maximum number of definable windows
434 no_color_video ncv NC T{
435 video attributes that cannot be used with colors
437 num_labels nlab Nl T{
438 number of labels on screen
440 padding_baud_rate pb pb T{
441 lowest baud rate where padding needed
443 virtual_terminal vt vt T{
444 virtual terminal number (CB/unix)
446 width_status_line wsl ws T{
447 number of columns in status line
452 The following numeric capabilities are present in the SVr4.0 term structure,
453 but are not yet documented in the man page. They came in with SVr4's
462 \fBVariable Cap- TCap Description\fR
463 \fBNumeric name Code\fR
464 bit_image_entwining bitwin Yo T{
465 number of passes for each bit-image row
467 bit_image_type bitype Yp T{
468 type of bit-image device
470 buffer_capacity bufsz Ya T{
471 numbers of bytes buffered before printing
474 number of buttons on mouse
476 dot_horz_spacing spinh Yc T{
477 spacing of dots horizontally in dots per inch
479 dot_vert_spacing spinv Yb T{
480 spacing of pins vertically in pins per inch
482 max_micro_address maddr Yd T{
483 maximum value in micro_..._address
485 max_micro_jump mjump Ye T{
486 maximum value in parm_..._micro
488 micro_col_size mcs Yf T{
489 character step size when in micro mode
491 micro_line_size mls Yg T{
492 line step size when in micro mode
494 number_of_pins npins Yh T{
495 numbers of pins in print-head
497 output_res_char orc Yi T{
498 horizontal resolution in units per line
500 output_res_horz_inch orhi Yk T{
501 horizontal resolution in units per inch
503 output_res_line orl Yj T{
504 vertical resolution in units per line
506 output_res_vert_inch orvi Yl T{
507 vertical resolution in units per inch
510 print rate in characters per second
512 wide_char_size widcs Yn T{
513 character step size when in double wide mode
518 These are the string capabilities:
526 \fBVariable Cap- TCap Description\fR
527 \fBString name Code\fR
529 graphics charset pairs, based on vt100
535 audible signal (bell) (P)
537 carriage_return cr cr T{
538 carriage return (P*) (P*)
540 change_char_pitch cpi ZA T{
541 Change number of characters per inch to #1
543 change_line_pitch lpi ZB T{
544 Change number of lines per inch to #1
546 change_res_horz chr ZC T{
547 Change horizontal resolution to #1
549 change_res_vert cvr ZD T{
550 Change vertical resolution to #1
552 change_scroll_region csr cs T{
553 change region to line #1 to line #2 (P)
555 char_padding rmp rP T{
556 like ip but when in insert mode
558 clear_all_tabs tbc ct T{
559 clear all tab stops (P)
561 clear_margins mgc MC T{
562 clear right and left soft margins
564 clear_screen clear cl T{
565 clear screen and home cursor (P*)
568 Clear to beginning of line
571 clear to end of line (P)
574 clear to end of screen (P*)
576 column_address hpa ch T{
577 horizontal position #1, absolute (P)
579 command_character cmdch CC T{
580 terminal settable cmd character in prototype !?
582 create_window cwin CW T{
583 define a window #1 from #2,#3 to #4,#5
585 cursor_address cup cm T{
586 move to row #1 columns #2
588 cursor_down cud1 do T{
591 cursor_home home ho T{
592 home cursor (if no cup)
594 cursor_invisible civis vi T{
595 make cursor invisible
597 cursor_left cub1 le T{
600 cursor_mem_address mrcup CM T{
601 memory relative cursor addressing, move to row #1 columns #2
603 cursor_normal cnorm ve T{
604 make cursor appear normal (undo civis/cvvis)
606 cursor_right cuf1 nd T{
607 non-destructive space (move right one space)
609 cursor_to_ll ll ll T{
610 last line, first column (if no cup)
615 cursor_visible cvvis vs T{
616 make cursor very visible
618 define_char defc ZE T{
619 Define a character #1, #2 dots wide, descender #3
621 delete_character dch1 dc T{
622 delete character (P*)
624 delete_line dl1 dl T{
627 dial_phone dial DI T{
630 dis_status_line dsl ds T{
633 display_clock dclk DK T{
636 down_half_line hd hd T{
640 enable alternate char set
642 enter_alt_charset_mode smacs as T{
643 start alternate character set (P)
645 enter_am_mode smam SA T{
646 turn on automatic margins
648 enter_blink_mode blink mb T{
651 enter_bold_mode bold md T{
652 turn on bold (extra bright) mode
654 enter_ca_mode smcup ti T{
655 string to start programs using cup
657 enter_delete_mode smdc dm T{
660 enter_dim_mode dim mh T{
661 turn on half-bright mode
663 enter_doublewide_mode swidm ZF T{
664 Enter double-wide mode
666 enter_draft_quality sdrfq ZG T{
667 Enter draft-quality mode
669 enter_insert_mode smir im T{
672 enter_italics_mode sitm ZH T{
675 enter_leftward_mode slm ZI T{
676 Start leftward carriage motion
678 enter_micro_mode smicm ZJ T{
679 Start micro-motion mode
681 enter_near_letter_quality snlq ZK T{
684 enter_normal_quality snrmq ZL T{
685 Enter normal-quality mode
687 enter_protected_mode prot mp T{
688 turn on protected mode
690 enter_reverse_mode rev mr T{
691 turn on reverse video mode
693 enter_secure_mode invis mk T{
694 turn on blank mode (characters invisible)
696 enter_shadow_mode sshm ZM T{
697 Enter shadow-print mode
699 enter_standout_mode smso so T{
702 enter_subscript_mode ssubm ZN T{
705 enter_superscript_mode ssupm ZO T{
706 Enter superscript mode
708 enter_underline_mode smul us T{
711 enter_upward_mode sum ZP T{
712 Start upward carriage motion
714 enter_xon_mode smxon SX T{
715 turn on xon/xoff handshaking
717 erase_chars ech ec T{
718 erase #1 characters (P)
720 exit_alt_charset_mode rmacs ae T{
721 end alternate character set (P)
723 exit_am_mode rmam RA T{
724 turn off automatic margins
726 exit_attribute_mode sgr0 me T{
727 turn off all attributes
729 exit_ca_mode rmcup te T{
730 strings to end programs using cup
732 exit_delete_mode rmdc ed T{
735 exit_doublewide_mode rwidm ZQ T{
738 exit_insert_mode rmir ei T{
741 exit_italics_mode ritm ZR T{
744 exit_leftward_mode rlm ZS T{
747 exit_micro_mode rmicm ZT T{
748 End micro-motion mode
750 exit_shadow_mode rshm ZU T{
751 End shadow-print mode
753 exit_standout_mode rmso se T{
756 exit_subscript_mode rsubm ZV T{
759 exit_superscript_mode rsupm ZW T{
762 exit_underline_mode rmul ue T{
765 exit_upward_mode rum ZX T{
766 End reverse character motion
768 exit_xon_mode rmxon RX T{
769 turn off xon/xoff handshaking
771 fixed_pause pause PA T{
772 pause for 2-3 seconds
774 flash_hook hook fh T{
777 flash_screen flash vb T{
778 visible bell (may not move cursor)
781 hardcopy terminal page eject (P*)
783 from_status_line fsl fs T{
784 return from status line
786 goto_window wingo WG T{
792 init_1string is1 i1 T{
793 initialization string
795 init_2string is2 is T{
796 initialization string
798 init_3string is3 i3 T{
799 initialization string
802 name of initialization file
804 init_prog iprog iP T{
805 path name of program for initialization
807 initialize_color initc Ic T{
808 initialize color #1 to (#2,#3,#4)
810 initialize_pair initp Ip T{
811 Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7)
813 insert_character ich1 ic T{
816 insert_line il1 al T{
819 insert_padding ip ip T{
820 insert padding after inserted character
826 upper right of keypad
831 key_backspace kbs kb T{
844 lower right of keypad
846 key_cancel kcan @2 T{
853 clear-screen or erase key
858 key_command kcmd @4 T{
864 key_create kcrt @6 T{
880 sent by rmir or smir in insert mode
889 clear-to-end-of-line key
892 clear-to-end-of-screen key
1095 key_home khome kh T{
1099 insert-character key
1104 key_left kcub1 kl T{
1108 lower-left key (home down)
1113 key_message kmsg %3 T{
1128 key_options kopt %7 T{
1134 key_previous kprv %8 T{
1137 key_print kprt %9 T{
1143 key_reference kref &1 T{
1146 key_refresh krfr &2 T{
1149 key_replace krpl &3 T{
1152 key_restart krst &4 T{
1155 key_resume kres &5 T{
1158 key_right kcuf1 kr T{
1167 key_scancel kCAN &0 T{
1170 key_scommand kCMD *1 T{
1173 key_scopy kCPY *2 T{
1176 key_screate kCRT *3 T{
1180 shifted delete-character key
1183 shifted delete-line key
1185 key_select kslt *6 T{
1192 shifted clear-to-end-of-line key
1194 key_sexit kEXT *9 T{
1200 key_sfind kFND *0 T{
1203 key_shelp kHLP #1 T{
1206 key_shome kHOM #2 T{
1210 shifted insert-character key
1212 key_sleft kLFT #4 T{
1213 shifted left-arrow key
1215 key_smessage kMSG %a T{
1218 key_smove kMOV %b T{
1221 key_snext kNXT %c T{
1224 key_soptions kOPT %d T{
1227 key_sprevious kPRV %e T{
1228 shifted previous key
1230 key_sprint kPRT %f T{
1236 key_sredo kRDO %g T{
1239 key_sreplace kRPL %h T{
1242 key_sright kRIT %i T{
1243 shifted right-arrow key
1245 key_srsume kRES %j T{
1248 key_ssave kSAV !1 T{
1251 key_ssuspend kSPD !2 T{
1257 key_sundo kUND !3 T{
1260 key_suspend kspd &7 T{
1269 keypad_local rmkx ke T{
1270 leave 'keyboard_transmit' mode
1272 keypad_xmit smkx ks T{
1273 enter 'keyboard_transmit' mode
1276 label on function key f0 if not f0
1279 label on function key f1 if not f1
1282 label on function key f10 if not f10
1285 label on function key f2 if not f2
1288 label on function key f3 if not f3
1291 label on function key f4 if not f4
1294 label on function key f5 if not f5
1297 label on function key f6 if not f6
1300 label on function key f7 if not f7
1303 label on function key f8 if not f8
1306 label on function key f9 if not f9
1308 label_format fln Lf T{
1311 label_off rmln LF T{
1312 turn off soft labels
1321 turn on meta mode (8th-bit on)
1323 micro_column_address mhpa ZY T{
1324 Like column_address in micro mode
1326 micro_down mcud1 ZZ T{
1327 Like cursor_down in micro mode
1329 micro_left mcub1 Za T{
1330 Like cursor_left in micro mode
1332 micro_right mcuf1 Zb T{
1333 Like cursor_right in micro mode
1335 micro_row_address mvpa Zc T{
1336 Like row_address #1 in micro mode
1338 micro_up mcuu1 Zd T{
1339 Like cursor_up in micro mode
1342 newline (behave like cr followed by lf)
1344 order_of_pins porder Ze T{
1345 Match software bits to print-head pins
1347 orig_colors oc oc T{
1348 Set all color pairs to the original ones
1351 Set default pair to its original value
1354 padding char (instead of null)
1357 delete #1 characters (P*)
1359 parm_delete_line dl DL T{
1360 delete #1 lines (P*)
1362 parm_down_cursor cud DO T{
1365 parm_down_micro mcud Zf T{
1366 Like parm_down_cursor in micro mode
1369 insert #1 characters (P*)
1371 parm_index indn SF T{
1372 scroll forward #1 lines (P)
1374 parm_insert_line il AL T{
1375 insert #1 lines (P*)
1377 parm_left_cursor cub LE T{
1378 move #1 characters to the left (P)
1380 parm_left_micro mcub Zg T{
1381 Like parm_left_cursor in micro mode
1383 parm_right_cursor cuf RI T{
1384 move #1 characters to the right (P*)
1386 parm_right_micro mcuf Zh T{
1387 Like parm_right_cursor in micro mode
1389 parm_rindex rin SR T{
1390 scroll back #1 lines (P)
1392 parm_up_cursor cuu UP T{
1395 parm_up_micro mcuu Zi T{
1396 Like parm_up_cursor in micro mode
1398 pkey_key pfkey pk T{
1399 program function key #1 to type string #2
1401 pkey_local pfloc pl T{
1402 program function key #1 to execute string #2
1405 program function key #1 to transmit string #2
1408 program label #1 to show string #2
1410 print_screen mc0 ps T{
1411 print contents of screen
1414 turn on printer for #1 bytes
1423 select pulse dialing
1425 quick_dial qdial QD T{
1426 dial number #1 without checking
1428 remove_clock rmclk RC T{
1431 repeat_char rep rp T{
1432 repeat char #1 #2 times (P*)
1434 req_for_input rfi RF T{
1435 send next input char (for ptys)
1437 reset_1string rs1 r1 T{
1440 reset_2string rs2 r2 T{
1443 reset_3string rs3 r3 T{
1449 restore_cursor rc rc T{
1450 restore cursor to position of last save_cursor
1452 row_address vpa cv T{
1453 vertical position #1 absolute (P)
1455 save_cursor sc sc T{
1456 save current cursor position (P)
1458 scroll_forward ind sf T{
1461 scroll_reverse ri sr T{
1462 scroll text down (P)
1464 select_char_set scs Zj T{
1465 Select character set, #1
1467 set_attributes sgr sa T{
1468 define video attributes #1-#9 (PG9)
1470 set_background setb Sb T{
1471 Set background color #1
1473 set_bottom_margin smgb Zk T{
1474 Set bottom margin at current line
1476 set_bottom_margin_parm smgbp Zl T{
1477 Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom
1479 set_clock sclk SC T{
1480 set clock, #1 hrs #2 mins #3 secs
1482 set_color_pair scp sp T{
1483 Set current color pair to #1
1485 set_foreground setf Sf T{
1486 Set foreground color #1
1488 set_left_margin smgl ML T{
1489 set left soft margin at current column. See smgl. (ML is not in BSD termcap).
1491 set_left_margin_parm smglp Zm T{
1492 Set left (right) margin at column #1
1494 set_right_margin smgr MR T{
1495 set right soft margin at current column
1497 set_right_margin_parm smgrp Zn T{
1498 Set right margin at column #1
1501 set a tab in every row, current columns
1503 set_top_margin smgt Zo T{
1504 Set top margin at current line
1506 set_top_margin_parm smgtp Zp T{
1507 Set top (bottom) margin at row #1
1509 set_window wind wi T{
1510 current window is lines #1-#2 cols #3-#4
1512 start_bit_image sbim Zq T{
1513 Start printing bit image graphics
1515 start_char_set_def scsd Zr T{
1516 Start character set definition #1, with #2 characters in the set
1518 stop_bit_image rbim Zs T{
1519 Stop printing bit image graphics
1521 stop_char_set_def rcsd Zt T{
1522 End definition of character set #1
1524 subscript_characters subcs Zu T{
1525 List of subscriptable characters
1527 superscript_characters supcs Zv T{
1528 List of superscriptable characters
1531 tab to next 8-space hardware tab stop
1533 these_cause_cr docr Zw T{
1534 Printing any of these characters causes CR
1536 to_status_line tsl ts T{
1537 move to status line, column #1
1540 select touch tone dialing
1542 underline_char uc uc T{
1543 underline char and move past it
1545 up_half_line hu hu T{
1578 wait_tone wait WA T{
1581 xoff_character xoffc XF T{
1584 xon_character xonc XN T{
1587 zero_motion zerom Zx T{
1588 No motion for subsequent character
1593 The following string capabilities are present in the SVr4.0 term structure,
1594 but were originally not documented in the man page.
1602 \fBVariable Cap- TCap Description\fR
1603 \fBString name Code\fR
1604 alt_scancode_esc scesa S8 T{
1605 Alternate escape for scancode emulation
1607 bit_image_carriage_return bicr Yv T{
1608 Move to beginning of same row
1610 bit_image_newline binel Zz T{
1611 Move to next row of the bit image
1613 bit_image_repeat birep Xy T{
1614 Repeat bit image cell #1 #2 times
1616 char_set_names csnm Zy T{
1617 Produce #1'th item from list of character set names
1619 code_set_init csin ci T{
1620 Init sequence for multiple codesets
1622 color_names colornm Yw T{
1623 Give name for color #1
1625 define_bit_image_region defbi Yx T{
1626 Define rectangular bit image region
1628 device_type devt dv T{
1629 Indicate language/codeset support
1631 display_pc_char dispc S1 T{
1632 Display PC character #1
1634 end_bit_image_region endbi Yy T{
1635 End a bit-image region
1637 enter_pc_charset_mode smpch S2 T{
1638 Enter PC character display mode
1640 enter_scancode_mode smsc S4 T{
1641 Enter PC scancode mode
1643 exit_pc_charset_mode rmpch S3 T{
1644 Exit PC character display mode
1646 exit_scancode_mode rmsc S5 T{
1647 Exit PC scancode mode
1649 get_mouse getm Gm T{
1650 Curses should get button events, parameter #1 not documented.
1652 key_mouse kmous Km T{
1653 Mouse event has occurred
1655 mouse_info minfo Mi T{
1656 Mouse status information
1658 pc_term_options pctrm S6 T{
1661 pkey_plab pfxl xl T{
1662 Program function key #1 to type string #2 and show string #3
1664 req_mouse_pos reqmp RQ T{
1665 Request mouse position
1667 scancode_escape scesc S7 T{
1668 Escape for scancode emulation
1670 set0_des_seq s0ds s0 T{
1671 Shift to codeset 0 (EUC set 0, ASCII)
1673 set1_des_seq s1ds s1 T{
1676 set2_des_seq s2ds s2 T{
1679 set3_des_seq s3ds s3 T{
1682 set_a_background setab AB T{
1683 Set background color to #1, using ANSI escape
1685 set_a_foreground setaf AF T{
1686 Set foreground color to #1, using ANSI escape
1688 set_color_band setcolor Yz T{
1689 Change to ribbon color #1
1691 set_lr_margin smglr ML T{
1692 Set both left and right margins to #1, #2. (ML is not in BSD termcap).
1694 set_page_length slines YZ T{
1695 Set page length to #1 lines
1697 set_tb_margin smgtb MT T{
1698 Sets both top and bottom margins to #1, #2
1704 The XSI Curses standard added these hardcopy capabilities.
1705 They were used in some post-4.1 versions of System V curses,
1706 e.g., Solaris 2.5 and IRIX 6.x.
1707 Except for \fBYI\fP, the \fBncurses\fR termcap names for them are invented.
1708 According to the XSI Curses standard, they have no termcap names.
1709 If your compiled terminfo entries use these,
1710 they may not be binary-compatible with System V terminfo
1711 entries after SVr4.1; beware!
1719 \fBVariable Cap- TCap Description\fR
1720 \fBString name Code\fR
1721 enter_horizontal_hl_mode ehhlm Xh T{
1722 Enter horizontal highlight mode
1724 enter_left_hl_mode elhlm Xl T{
1725 Enter left highlight mode
1727 enter_low_hl_mode elohlm Xo T{
1728 Enter low highlight mode
1730 enter_right_hl_mode erhlm Xr T{
1731 Enter right highlight mode
1733 enter_top_hl_mode ethlm Xt T{
1734 Enter top highlight mode
1736 enter_vertical_hl_mode evhlm Xv T{
1737 Enter vertical highlight mode
1739 set_a_attributes sgr1 sA T{
1740 Define second set of video attributes #1-#6
1742 set_pglen_inch slength YI T{
1743 Set page length to #1 hundredth of an inch (some implementations use sL for termcap).
1747 .\" $Id: terminfo.tail,v 1.88 2017/08/12 22:26:02 tom Exp $
1748 .\" Beginning of terminfo.tail file
1749 .\" This file is part of ncurses.
1750 .\" See "terminfo.head" for copyright.
1752 .SS User-Defined Capabilities
1754 The preceding section listed the \fIpredefined\fP capabilities.
1755 They deal with some special features for terminals no longer
1756 (or possibly never) produced.
1757 Occasionally there are special features of newer terminals which
1758 are awkward or impossible to represent by reusing the predefined
1761 \fBncurses\fP addresses this limitation by allowing user-defined capabilities.
1762 The \fBtic\fP and \fBinfocmp\fP programs provide
1763 the \fB\-x\fP option for this purpose.
1764 When \fB\-x\fP is set,
1765 \fBtic\fP treats unknown capabilities as user-defined.
1766 That is, if \fBtic\fP encounters a capability name
1767 which it does not recognize,
1768 it infers its type (boolean, number or string) from the syntax
1769 and makes an extended table entry for that capability.
1770 The \fBuse_extended_names\fP(3X) function makes this information
1771 conditionally available to applications.
1772 The ncurses library provides the data leaving most of the behavior
1775 User-defined capability strings whose name begins
1776 with \*(``k\*('' are treated as function keys.
1778 The types (boolean, number, string) determined by \fBtic\fP
1779 can be inferred by successful calls on \fBtigetflag\fP, etc.
1781 If the capability name happens to be two characters,
1782 the capability is also available through the termcap interface.
1784 While termcap is said to be extensible because it does not use a predefined set
1786 in practice it has been limited to the capabilities defined by
1787 terminfo implementations.
1789 user-defined capabilities intended for use by termcap applications should
1790 be limited to booleans and numbers to avoid running past the 1023 byte
1791 limit assumed by termcap implementations and their applications.
1792 In particular, providing extended sets of function keys (past the 60
1793 numbered keys and the handful of special named keys) is best done using
1794 the longer names available using terminfo.
1798 The following entry, describing an ANSI-standard terminal, is representative
1799 of what a \fBterminfo\fR entry for a modern terminal typically looks like.
1803 \s-2ansi|ansi/pc-term compatible with color,
1804 am, mc5i, mir, msgr,
1805 colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
1806 acsc=+\\020\\,\\021-\\030.^Y0\\333`\\004a\\261f\\370g\\361h\\260
1807 j\\331k\\277l\\332m\\300n\\305o~p\\304q\\304r\\304s_t\\303
1808 u\\264v\\301w\\302x\\263y\\363z\\362{\\343|\\330}\\234~\\376,
1809 bel=^G, blink=\\E[5m, bold=\\E[1m, cbt=\\E[Z, clear=\\E[H\\E[J,
1810 cr=^M, cub=\\E[%p1%dD, cub1=\\E[D, cud=\\E[%p1%dB, cud1=\\E[B,
1811 cuf=\\E[%p1%dC, cuf1=\\E[C, cup=\\E[%i%p1%d;%p2%dH,
1812 cuu=\\E[%p1%dA, cuu1=\\E[A, dch=\\E[%p1%dP, dch1=\\E[P,
1813 dl=\\E[%p1%dM, dl1=\\E[M, ech=\\E[%p1%dX, ed=\\E[J, el=\\E[K,
1814 el1=\\E[1K, home=\\E[H, hpa=\\E[%i%p1%dG, ht=\\E[I, hts=\\EH,
1815 ich=\\E[%p1%d@, il=\\E[%p1%dL, il1=\\E[L, ind=^J,
1816 indn=\\E[%p1%dS, invis=\\E[8m, kbs=^H, kcbt=\\E[Z, kcub1=\\E[D,
1817 kcud1=\\E[B, kcuf1=\\E[C, kcuu1=\\E[A, khome=\\E[H, kich1=\\E[L,
1818 mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S, op=\\E[39;49m,
1819 rep=%p1%c\\E[%p2%{1}%-%db, rev=\\E[7m, rin=\\E[%p1%dT,
1820 rmacs=\\E[10m, rmpch=\\E[10m, rmso=\\E[m, rmul=\\E[m,
1821 s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B, s3ds=\\E+B,
1822 setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,
1823 sgr=\\E[0;10%?%p1%t;7%;
1830 sgr0=\\E[0;10m, smacs=\\E[11m, smpch=\\E[11m, smso=\\E[7m,
1831 smul=\\E[4m, tbc=\\E[3g, u6=\\E[%i%d;%dR, u7=\\E[6n,
1832 u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%i%p1%dd,
1836 Entries may continue onto multiple lines by placing white space at
1837 the beginning of each line except the first.
1838 Comments may be included on lines beginning with \*(``#\*(''.
1843 Boolean capabilities which indicate that the terminal has
1844 some particular feature,
1846 numeric capabilities giving the size of the terminal
1847 or the size of particular delays, and
1850 capabilities, which give a sequence which can be used to perform particular
1851 terminal operations.
1853 .SS Types of Capabilities
1855 All capabilities have names.
1856 For instance, the fact that
1857 ANSI-standard terminals have
1858 .I "automatic margins"
1859 (i.e., an automatic return and line-feed
1860 when the end of a line is reached) is indicated by the capability \fBam\fR.
1861 Hence the description of ansi includes \fBam\fR.
1862 Numeric capabilities are followed by the character \*(``#\*('' and then a positive value.
1863 Thus \fBcols\fR, which indicates the number of columns the terminal has,
1864 gives the value \*(``80\*('' for ansi.
1865 Values for numeric capabilities may be specified in decimal, octal or hexadecimal,
1866 using the C programming language conventions (e.g., 255, 0377 and 0xff or 0xFF).
1868 Finally, string valued capabilities, such as \fBel\fR (clear to end of line
1869 sequence) are given by the two-character code, an \*(``=\*('', and then a string
1870 ending at the next following \*(``,\*(''.
1872 A number of escape sequences are provided in the string valued capabilities
1873 for easy encoding of characters there:
1875 Both \fB\eE\fR and \fB\ee\fR
1876 map to an \s-1ESCAPE\s0 character,
1878 \fB^x\fR maps to a control-x for any appropriate \fIx\fP, and
1883 \fB\en\fP, \fB\el\fP, \fB\er\fP, \fB\et\fP, \fB\eb\fP, \fB\ef\fP, and \fB\es\fR
1889 \fInewline\fP, \fIline-feed\fP, \fIreturn\fP, \fItab\fP, \fIbackspace\fP, \fIform-feed\fP, and \fIspace\fP,
1894 X/Open Curses does not say what \*(``appropriate \fIx\fP\*('' might be.
1895 In practice, that is a printable ASCII graphic character.
1896 The special case \*(``^?\*('' is interpreted as DEL (127).
1897 In all other cases, the character value is AND'd with 0x1f,
1898 mapping to ASCII control codes in the range 0 through 31.
1900 Other escapes include
1902 \fB\e^\fR for \fB^\fR,
1904 \fB\e\e\fR for \fB\e\fR,
1906 \fB\e\fR, for comma,
1908 \fB\e:\fR for \fB:\fR,
1910 and \fB\e0\fR for null.
1912 \fB\e0\fR will produce \e200, which does not terminate a string but behaves
1913 as a null character on most terminals, providing CS7 is specified.
1916 The reason for this quirk is to maintain binary compatibility of the
1917 compiled terminfo files with other implementations,
1918 e.g., the SVr4 systems, which document this.
1919 Compiled terminfo files use null-terminated strings, with no lengths.
1920 Modifying this would require a new binary format,
1921 which would not work with other implementations.
1923 Finally, characters may be given as three octal digits after a \fB\e\fR.
1925 A delay in milliseconds may appear anywhere in a string capability, enclosed in
1926 $<..> brackets, as in \fBel\fP=\eEK$<5>,
1927 and padding characters are supplied by \fBtputs\fP(3X)
1928 to provide this delay.
1930 The delay must be a number with at most one decimal
1931 place of precision; it may be followed by suffixes \*(``*\*('' or \*(``/\*('' or both.
1934 indicates that the padding required is proportional to the number of lines
1935 affected by the operation, and the amount given is the per-affected-unit
1937 (In the case of insert character, the factor is still the
1938 number of \fIlines\fP affected.)
1940 Normally, padding is advisory if the device has the \fBxon\fR
1941 capability; it is used for cost computation but does not trigger delays.
1944 suffix indicates that the padding is mandatory and forces a delay of the given
1945 number of milliseconds even on devices for which \fBxon\fR is present to
1946 indicate flow control.
1948 Sometimes individual capabilities must be commented out.
1949 To do this, put a period before the capability name.
1950 For example, see the second
1952 in the example above.
1956 .SS Fetching Compiled Descriptions
1958 The \fBncurses\fP library searches for terminal descriptions in several places.
1959 It uses only the first description found.
1960 The library has a compiled-in list of places to search
1961 which can be overridden by environment variables.
1962 Before starting to search,
1963 \fBncurses\fP eliminates duplicates in its search list.
1965 If the environment variable TERMINFO is set, it is interpreted as the pathname
1966 of a directory containing the compiled description you are working on.
1967 Only that directory is searched.
1969 If TERMINFO is not set,
1970 \fBncurses\fR will instead look in the directory \fB$HOME/.terminfo\fR
1971 for a compiled description.
1973 Next, if the environment variable TERMINFO_DIRS is set,
1974 \fBncurses\fR will interpret the contents of that variable
1975 as a list of colon-separated directories (or database files) to be searched.
1977 An empty directory name (i.e., if the variable begins or ends
1978 with a colon, or contains adjacent colons)
1979 is interpreted as the system location \fI\*d\fR.
1981 Finally, \fBncurses\fP searches these compiled-in locations:
1984 a list of directories (no default value), and
1986 the system terminfo directory, \fI\*d\fR (the compiled-in default).
1988 .SS Preparing Descriptions
1990 We now outline how to prepare descriptions of terminals.
1991 The most effective way to prepare a terminal description is by imitating
1992 the description of a similar terminal in
1994 and to build up a description gradually, using partial descriptions
1997 or some other screen-oriented program to check that they are correct.
1998 Be aware that a very unusual terminal may expose deficiencies in
2002 or bugs in the screen-handling code of the test program.
2004 To get the padding for insert line right (if the terminal manufacturer
2005 did not document it) a severe test is to edit a large file at 9600 baud,
2006 delete 16 or so lines from the middle of the screen, then hit the \*(``u\*(''
2007 key several times quickly.
2008 If the terminal messes up, more padding is usually needed.
2009 A similar test can be used for insert character.
2011 .SS Basic Capabilities
2013 The number of columns on each line for the terminal is given by the
2014 \fBcols\fR numeric capability.
2015 If the terminal is a \s-1CRT\s0, then the
2016 number of lines on the screen is given by the \fBlines\fR capability.
2017 If the terminal wraps around to the beginning of the next line when
2018 it reaches the right margin, then it should have the \fBam\fR capability.
2019 If the terminal can clear its screen, leaving the cursor in the home
2020 position, then this is given by the \fBclear\fR string capability.
2021 If the terminal overstrikes
2022 (rather than clearing a position when a character is struck over)
2023 then it should have the \fBos\fR capability.
2024 If the terminal is a printing terminal, with no soft copy unit,
2030 applies to storage scope terminals, such as \s-1TEKTRONIX\s+1 4010
2031 series, as well as hard copy and APL terminals.)
2032 If there is a code to move the cursor to the left edge of the current
2035 (Normally this will be carriage return, control M.)
2036 If there is a code to produce an audible signal (bell, beep, etc)
2040 If there is a code to move the cursor one position to the left
2041 (such as backspace) that capability should be given as
2043 Similarly, codes to move to the right, up, and down should be
2049 These local cursor motions should not alter the text they pass over,
2050 for example, you would not normally use \*(``\fBcuf1\fP=\ \*('' because the
2051 space would erase the character moved over.
2053 A very important point here is that the local cursor motions encoded
2056 are undefined at the left and top edges of a \s-1CRT\s0 terminal.
2057 Programs should never attempt to backspace around the left edge,
2061 and never attempt to go up locally off the top.
2062 In order to scroll text up, a program will go to the bottom left corner
2063 of the screen and send the
2067 To scroll text down, a program goes to the top left corner
2068 of the screen and sends the
2070 (reverse index) string.
2075 are undefined when not on their respective corners of the screen.
2077 Parameterized versions of the scrolling sequences are
2081 which have the same semantics as
2085 except that they take one parameter, and scroll that many lines.
2086 They are also undefined except at the appropriate edge of the screen.
2088 The \fBam\fR capability tells whether the cursor sticks at the right
2089 edge of the screen when text is output, but this does not necessarily
2092 from the last column.
2093 The only local motion which is defined from the left edge is if
2097 from the left edge will move to the right edge of the previous row.
2100 is not given, the effect is undefined.
2101 This is useful for drawing a box around the edge of the screen, for example.
2102 If the terminal has switch selectable automatic margins,
2105 file usually assumes that this is on; i.e., \fBam\fR.
2106 If the terminal has a command which moves to the first column of the next
2107 line, that command can be given as
2110 It does not matter if the command clears the remainder of the current line,
2111 so if the terminal has no
2115 it may still be possible to craft a working
2117 out of one or both of them.
2119 These capabilities suffice to describe hard-copy and \*(lqglass-tty\*(rq terminals.
2120 Thus the model 33 teletype is described as
2126 \s-133\||\|tty33\||\|tty\||\|model 33 teletype,
2127 bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1
2132 while the Lear Siegler \s-1ADM-3\s0 is described as
2138 \s-1adm3\||\|3\||\|lsi adm3,
2139 am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
2140 ind=^J, lines#24,\s+1
2145 .SS Parameterized Strings
2147 Cursor addressing and other strings requiring parameters
2148 in the terminal are described by a
2149 parameterized string capability,
2150 with \fIprintf\fP-like escapes such as \fI%x\fR in it.
2151 For example, to address the cursor, the
2153 capability is given, using two parameters:
2154 the row and column to address to.
2155 (Rows and columns are numbered from zero and refer to the
2156 physical screen visible to the user, not to any unseen memory.)
2157 If the terminal has memory relative cursor addressing,
2158 that can be indicated by
2161 The parameter mechanism uses a stack and special \fB%\fP codes
2163 Typically a sequence will push one of the
2164 parameters onto the stack and then print it in some format.
2165 Print (e.g., "%d") is a special case.
2166 Other operations, including "%t" pop their operand from the stack.
2167 It is noted that more complex operations are often necessary,
2168 e.g., in the \fBsgr\fP string.
2170 The \fB%\fR encodings have the following meanings:
2176 \fB%\fP\fI[[\fP:\fI]flags][width[.precision]][\fP\fBdoxXs\fP\fI]\fP
2177 as in \fBprintf\fP, flags are \fI[\-+#]\fP and \fIspace\fP.
2178 Use a \*(``:\*('' to allow the next character to be a \*(``\-\*('' flag,
2179 avoiding interpreting "%\-" as an operator.
2182 print \fIpop()\fP like %c in \fBprintf\fP
2185 print \fIpop()\fP like %s in \fBprintf\fP
2187 \fB%p\fP\fI[1\-9]\fP
2188 push \fIi\fP'th parameter
2190 \fB%P\fP\fI[a\-z]\fP
2191 set dynamic variable \fI[a\-z]\fP to \fIpop()\fP
2193 \fB%g\fP\fI[a\-z]/\fP
2194 get dynamic variable \fI[a\-z]\fP and push it
2196 \fB%P\fP\fI[A\-Z]\fP
2197 set static variable \fI[a\-z]\fP to \fIpop()\fP
2199 \fB%g\fP\fI[A\-Z]\fP
2200 get static variable \fI[a\-z]\fP and push it
2202 The terms "static" and "dynamic" are misleading.
2203 Historically, these are simply two different sets of variables,
2204 whose values are not reset between calls to \fBtparm\fP(3X).
2205 However, that fact is not documented in other implementations.
2206 Relying on it will adversely impact portability to other implementations.
2208 \fB%'\fP\fIc\fP\fB'\fP
2209 char constant \fIc\fP
2211 \fB%{\fP\fInn\fP\fB}\fP
2212 integer constant \fInn\fP
2217 \fB%+\fP, \fB%\-\fP, \fB%*\fP, \fB%/\fP, \fB%m\fP
2218 arithmetic (%m is \fImod\fP): \fIpush(pop() op pop())\fP
2220 \fB%&\fP, \fB%|\fP, \fB%^\fP
2221 bit operations (AND, OR and exclusive-OR): \fIpush(pop() op pop())\fP
2223 \fB%=\fP, \fB%>\fP, \fB%<\fP
2224 logical operations: \fIpush(pop() op pop())\fP
2227 logical AND and OR operations (for conditionals)
2230 unary operations (logical and bit complement): \fIpush(op pop())\fP
2233 add 1 to first two parameters (for ANSI terminals)
2235 \fB%?\fP \fIexpr\fP \fB%t\fP \fIthenpart\fP \fB%e\fP \fIelsepart\fP \fB%;\fP
2236 This forms an if-then-else.
2237 The \fB%e\fP \fIelsepart\fP is optional.
2238 Usually the \fB%?\fP \fIexpr\fP part pushes a value onto the stack,
2239 and \fB%t\fP pops it from the stack, testing if it is nonzero (true).
2240 If it is zero (false), control passes to the \fB%e\fP (else) part.
2242 It is possible to form else-if's a la Algol 68:
2244 \fB%?\fP c\d1\u \fB%t\fP b\d1\u \fB%e\fP c\d2\u \fB%t\fP b\d2\u \fB%e\fP c\d3\u \fB%t\fP b\d3\u \fB%e\fP c\d4\u \fB%t\fP b\d4\u \fB%e\fP \fB%;\fP
2247 where c\di\u are conditions, b\di\u are bodies.
2249 Use the \fB\-f\fP option of \fBtic\fP or \fBinfocmp\fP to see
2250 the structure of if-then-else's.
2251 Some strings, e.g., \fBsgr\fP can be very complicated when written
2253 The \fB\-f\fP option splits the string into lines with the parts indented.
2255 Binary operations are in postfix form with the operands in the usual order.
2256 That is, to get x\-5 one would use "%gx%{5}%-".
2257 \fB%P\fP and \fB%g\fP variables are
2258 persistent across escape-string evaluations.
2260 Consider the HP2645, which, to get to row 3 and column 12, needs
2261 to be sent \eE&a12c03Y padded for 6 milliseconds.
2263 of the rows and columns is inverted here, and that the row and column
2264 are printed as two digits.
2265 Thus its \fBcup\fR capability is \*(lqcup=6\eE&%p2%2dc%p1%2dY\*(rq.
2267 The Microterm \s-1ACT-IV\s0 needs the current row and column sent
2268 preceded by a \fB^T\fR, with the row and column simply encoded in binary,
2269 \*(lqcup=^T%p1%c%p2%c\*(rq.
2270 Terminals which use \*(lq%c\*(rq need to be able to
2271 backspace the cursor (\fBcub1\fR),
2272 and to move the cursor up one line on the screen (\fBcuu1\fR).
2273 This is necessary because it is not always safe to transmit \fB\en\fR
2274 \fB^D\fR and \fB\er\fR, as the system may change or discard them.
2275 (The library routines dealing with terminfo set tty modes so that
2276 tabs are never expanded, so \et is safe to send.
2277 This turns out to be essential for the Ann Arbor 4080.)
2279 A final example is the \s-1LSI ADM\s0-3a, which uses row and column
2280 offset by a blank character, thus \*(lqcup=\eE=%p1%' '%+%c%p2%' '%+%c\*(rq.
2281 After sending \*(``\eE=\*('', this pushes the first parameter, pushes the
2282 ASCII value for a space (32), adds them (pushing the sum on the stack
2283 in place of the two previous values) and outputs that value as a character.
2284 Then the same is done for the second parameter.
2285 More complex arithmetic is possible using the stack.
2289 If the terminal has a fast way to home the cursor
2290 (to very upper left corner of screen) then this can be given as
2291 \fBhome\fR; similarly a fast way of getting to the lower left-hand corner
2292 can be given as \fBll\fR; this may involve going up with \fBcuu1\fR
2293 from the home position,
2294 but a program should never do this itself (unless \fBll\fR does) because it
2295 can make no assumption about the effect of moving up from the home position.
2296 Note that the home position is the same as addressing to (0,0):
2297 to the top left corner of the screen, not of memory.
2298 (Thus, the \eEH sequence on HP terminals cannot be used for
2301 If the terminal has row or column absolute cursor addressing,
2302 these can be given as single parameter capabilities
2304 (horizontal position absolute)
2307 (vertical position absolute).
2308 Sometimes these are shorter than the more general two parameter
2309 sequence (as with the hp2645) and can be used in preference to
2311 If there are parameterized local motions (e.g., move
2313 spaces to the right) these can be given as
2319 with a single parameter indicating how many spaces to move.
2320 These are primarily useful if the terminal does not have
2322 such as the \s-1TEKTRONIX\s+1 4025.
2324 If the terminal needs to be in a special mode when running
2325 a program that uses these capabilities,
2326 the codes to enter and exit this mode can be given as \fBsmcup\fR and \fBrmcup\fR.
2327 This arises, for example, from terminals like the Concept with more than
2329 If the terminal has only memory relative cursor addressing and not screen
2330 relative cursor addressing, a one screen-sized window must be fixed into
2331 the terminal for cursor addressing to work properly.
2332 This is also used for the \s-1TEKTRONIX\s+1 4025,
2335 sets the command character to be the one used by terminfo.
2336 If the \fBsmcup\fP sequence will not restore the screen after an
2337 \fBrmcup\fP sequence is output (to the state prior to outputting
2338 \fBrmcup\fP), specify \fBnrrmc\fP.
2342 If the terminal can clear from the current position to the end of the
2343 line, leaving the cursor where it is, this should be given as \fBel\fR.
2344 If the terminal can clear from the beginning of the line to the current
2345 position inclusive, leaving
2346 the cursor where it is, this should be given as \fBel1\fP.
2347 If the terminal can clear from the current position to the end of the
2348 display, then this should be given as \fBed\fR.
2349 \fBEd\fR is only defined from the first column of a line.
2350 (Thus, it can be simulated by a request to delete a large number of lines,
2355 .SS Insert/delete line and vertical motions
2357 If the terminal can open a new blank line before the line where the cursor
2358 is, this should be given as \fBil1\fR; this is done only from the first
2360 The cursor must then appear on the newly blank line.
2361 If the terminal can delete the line which the cursor is on, then this
2362 should be given as \fBdl1\fR; this is done only from the first position on
2363 the line to be deleted.
2368 which take a single parameter and insert or delete that many lines can
2374 If the terminal has a settable scrolling region (like the vt100)
2375 the command to set this can be described with the
2377 capability, which takes two parameters:
2378 the top and bottom lines of the scrolling region.
2379 The cursor position is, alas, undefined after using this command.
2381 It is possible to get the effect of insert or delete line using
2383 on a properly chosen region; the
2387 (save and restore cursor) commands may be useful for ensuring that
2388 your synthesized insert/delete string does not move the cursor.
2389 (Note that the \fBncurses\fR(3X) library does this synthesis
2390 automatically, so you need not compose insert/delete strings for
2391 an entry with \fBcsr\fR).
2393 Yet another way to construct insert and delete might be to use a combination of
2394 index with the memory-lock feature found on some terminals (like the HP\-700/90
2395 series, which however also has insert/delete).
2397 Inserting lines at the top or bottom of the screen can also be
2402 on many terminals without a true insert/delete line,
2403 and is often faster even on terminals with those features.
2405 The boolean \fBnon_dest_scroll_region\fR should be set if each scrolling
2406 window is effectively a view port on a screen-sized canvas.
2408 this capability, create a scrolling region in the middle of the screen,
2409 write something to the bottom line, move the cursor to the top of the region,
2410 and do \fBri\fR followed by \fBdl1\fR or \fBind\fR.
2411 If the data scrolled
2412 off the bottom of the region by the \fBri\fR re-appears, then scrolling
2414 System V and XSI Curses expect that \fBind\fR, \fBri\fR,
2415 \fBindn\fR, and \fBrin\fR will simulate destructive scrolling; their
2416 documentation cautions you not to define \fBcsr\fR unless this is true.
2417 This \fBcurses\fR implementation is more liberal and will do explicit erases
2418 after scrolling if \fBndsrc\fR is defined.
2420 If the terminal has the ability to define a window as part of
2421 memory, which all commands affect,
2422 it should be given as the parameterized string
2424 The four parameters are the starting and ending lines in memory
2425 and the starting and ending columns in memory, in that order.
2427 If the terminal can retain display memory above, then the
2428 \fBda\fR capability should be given; if display memory can be retained
2429 below, then \fBdb\fR should be given.
2431 that deleting a line or scrolling may bring non-blank lines up from below
2432 or that scrolling back with \fBri\fR may bring down non-blank lines.
2434 .SS Insert/Delete Character
2436 There are two basic kinds of intelligent terminals with respect to
2437 insert/delete character which can be described using
2439 The most common insert/delete character operations affect only the characters
2440 on the current line and shift characters off the end of the line rigidly.
2441 Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make
2442 a distinction between typed and untyped blanks on the screen, shifting
2443 upon an insert or delete only to an untyped blank on the screen which is
2444 either eliminated, or expanded to two untyped blanks.
2446 You can determine the
2447 kind of terminal you have by clearing the screen and then typing
2448 text separated by cursor motions.
2449 Type \*(lqabc\ \ \ \ def\*(rq using local
2450 cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq.
2451 Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert
2453 If typing characters causes the rest of the line to shift
2454 rigidly and characters to fall off the end, then your terminal does
2455 not distinguish between blanks and untyped positions.
2456 If the \*(lqabc\*(rq
2457 shifts over to the \*(lqdef\*(rq which then move together around the end of the
2458 current line and onto the next as you insert, you have the second type of
2459 terminal, and should give the capability \fBin\fR, which stands for
2460 \*(lqinsert null\*(rq.
2462 While these are two logically separate attributes (one line versus multi-line
2463 insert mode, and special treatment of untyped spaces) we have seen no
2464 terminals whose insert mode cannot be described with the single attribute.
2466 Terminfo can describe both terminals which have an insert mode, and terminals
2467 which send a simple sequence to open a blank position on the current line.
2468 Give as \fBsmir\fR the sequence to get into insert mode.
2469 Give as \fBrmir\fR the sequence to leave insert mode.
2470 Now give as \fBich1\fR any sequence needed to be sent just before sending
2471 the character to be inserted.
2472 Most terminals with a true insert mode
2473 will not give \fBich1\fR; terminals which send a sequence to open a screen
2474 position should give it here.
2476 If your terminal has both, insert mode is usually preferable to \fBich1\fR.
2477 Technically, you should not give both unless the terminal actually requires
2478 both to be used in combination.
2479 Accordingly, some non-curses applications get
2480 confused if both are present; the symptom is doubled characters in an update
2482 This requirement is now rare; most \fBich\fR sequences do not
2483 require previous smir, and most smir insert modes do not require \fBich1\fR
2484 before each character.
2485 Therefore, the new \fBcurses\fR actually assumes this
2486 is the case and uses either \fBrmir\fR/\fBsmir\fR or \fBich\fR/\fBich1\fR as
2487 appropriate (but not both).
2488 If you have to write an entry to be used under
2489 new curses for a terminal old enough to need both, include the
2490 \fBrmir\fR/\fBsmir\fR sequences in \fBich1\fR.
2492 If post insert padding is needed, give this as a number of milliseconds
2493 in \fBip\fR (a string option).
2494 Any other sequence which may need to be
2495 sent after an insert of a single character may also be given in \fBip\fR.
2496 If your terminal needs both to be placed into an \*(``insert mode\*('' and
2497 a special code to precede each inserted character, then both
2501 can be given, and both will be used.
2504 capability, with one parameter,
2506 will repeat the effects of
2511 If padding is necessary between characters typed while not
2512 in insert mode, give this as a number of milliseconds padding in \fBrmp\fP.
2514 It is occasionally necessary to move around while in insert mode
2515 to delete characters on the same line (e.g., if there is a tab after
2516 the insertion position).
2517 If your terminal allows motion while in
2518 insert mode you can give the capability \fBmir\fR to speed up inserting
2520 Omitting \fBmir\fR will affect only speed.
2522 (notably Datamedia's) must not have \fBmir\fR because of the way their
2525 Finally, you can specify
2527 to delete a single character,
2533 and delete mode by giving \fBsmdc\fR and \fBrmdc\fR
2534 to enter and exit delete mode (any mode the terminal needs to be placed
2541 characters (equivalent to outputting
2543 blanks without moving the cursor)
2548 .SS "Highlighting, Underlining, and Visible Bells"
2550 If your terminal has one or more kinds of display attributes,
2551 these can be represented in a number of different ways.
2552 You should choose one display form as
2553 \f2standout mode\fR,
2554 representing a good, high contrast, easy-on-the-eyes,
2555 format for highlighting error messages and other attention getters.
2556 (If you have a choice, reverse video plus half-bright is good,
2557 or reverse video alone.)
2558 The sequences to enter and exit standout mode
2559 are given as \fBsmso\fR and \fBrmso\fR, respectively.
2560 If the code to change into or out of standout
2561 mode leaves one or even two blank spaces on the screen,
2562 as the TVI 912 and Teleray 1061 do,
2563 then \fBxmc\fR should be given to tell how many spaces are left.
2565 Codes to begin underlining and end underlining can be given as \fBsmul\fR
2566 and \fBrmul\fR respectively.
2567 If the terminal has a code to underline the current character and move
2568 the cursor one space to the right,
2569 such as the Microterm Mime,
2570 this can be given as \fBuc\fR.
2572 Other capabilities to enter various highlighting modes include
2576 (bold or extra bright)
2578 (dim or half-bright)
2580 (blanking or invisible text)
2590 (enter alternate character set mode)
2593 (exit alternate character set mode).
2594 Turning on any of these modes singly may or may not turn off other modes.
2596 If there is a sequence to set arbitrary combinations of modes,
2597 this should be given as
2600 taking 9 parameters.
2601 Each parameter is either 0 or nonzero, as the corresponding attribute is on or off.
2602 The 9 parameters are, in order:
2603 standout, underline, reverse, blink, dim, bold, blank, protect, alternate
2605 Not all modes need be supported by
2607 only those for which corresponding separate attribute commands exist.
2609 For example, the DEC vt220 supports most of the modes:
2616 \fBtparm parameter attribute escape sequence\fP
2619 p1 standout \\E[0;1;7m
2620 p2 underline \\E[0;4m
2623 p5 dim not available
2627 p9 altcharset ^O (off) ^N (on)
2630 We begin each escape sequence by turning off any existing modes, since
2631 there is no quick way to determine whether they are active.
2632 Standout is set up to be the combination of reverse and bold.
2633 The vt220 terminal has a protect mode,
2634 though it is not commonly used in sgr
2635 because it protects characters on the screen from the host's erasures.
2636 The altcharset mode also is different in that it is either ^O or ^N,
2637 depending on whether it is off or on.
2638 If all modes are turned on, the resulting sequence is \\E[0;1;4;5;7;8m^N.
2640 Some sequences are common to different modes.
2641 For example, ;7 is output when either p1 or p3 is true, that is, if
2642 either standout or reverse modes are turned on.
2644 Writing out the above sequences, along with their dependencies yields
2652 \fBsequence when to output terminfo translation\fP
2656 ;1 if p1 or p6 %?%p1%p6%|%t;1%;
2657 ;4 if p2 %?%p2%|%t;4%;
2658 ;5 if p4 %?%p4%|%t;5%;
2659 ;7 if p1 or p3 %?%p1%p3%|%t;7%;
2660 ;8 if p7 %?%p7%|%t;8%;
2662 ^N or ^O if p9 ^N, else ^O %?%p9%t^N%e^O%;
2666 Putting this all together into the sgr sequence gives:
2670 sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%;
2671 %?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;,
2675 Remember that if you specify sgr, you must also specify sgr0.
2676 Also, some implementations rely on sgr being given if sgr0 is,
2677 Not all terminfo entries necessarily have an sgr string, however.
2678 Many terminfo entries are derived from termcap entries
2679 which have no sgr string.
2680 The only drawback to adding an sgr string is that termcap also
2681 assumes that sgr0 does not exit alternate character set mode.
2683 Terminals with the \*(``magic cookie\*('' glitch
2685 deposit special \*(``cookies\*('' when they receive mode-setting sequences,
2686 which affect the display algorithm rather than having extra bits for
2688 Some terminals, such as the HP 2621, automatically leave standout
2689 mode when they move to a new line or the cursor is addressed.
2690 Programs using standout mode should exit standout mode before
2691 moving the cursor or sending a newline,
2694 capability, asserting that it is safe to move in standout mode, is present.
2697 a way of flashing the screen to indicate an error quietly (a bell replacement)
2698 then this can be given as \fBflash\fR; it must not move the cursor.
2700 If the cursor needs to be made more visible than normal when it is
2701 not on the bottom line (to make, for example, a non-blinking underline into an
2702 easier to find block or blinking underline)
2703 give this sequence as
2705 If there is a way to make the cursor completely invisible, give that as
2709 should be given which undoes the effects of both of these modes.
2711 If your terminal correctly generates underlined characters
2712 (with no special codes needed)
2713 even though it does not overstrike,
2714 then you should give the capability \fBul\fR.
2715 If a character overstriking another leaves both characters on the screen,
2716 specify the capability \fBos\fP.
2717 If overstrikes are erasable with a blank,
2718 then this should be indicated by giving \fBeo\fR.
2720 .SS Keypad and Function Keys
2722 If the terminal has a keypad that transmits codes when the keys are pressed,
2723 this information can be given.
2724 Note that it is not possible to handle
2725 terminals where the keypad only works in local (this applies, for example,
2726 to the unshifted HP 2621 keys).
2727 If the keypad can be set to transmit or not transmit,
2728 give these codes as \fBsmkx\fR and \fBrmkx\fR.
2729 Otherwise the keypad is assumed to always transmit.
2731 The codes sent by the left arrow, right arrow, up arrow, down arrow,
2732 and home keys can be given as
2733 \fBkcub1, kcuf1, kcuu1, kcud1, \fRand\fB khome\fR respectively.
2734 If there are function keys such as f0, f1, ..., f10, the codes they send
2735 can be given as \fBkf0, kf1, ..., kf10\fR.
2736 If these keys have labels other than the default f0 through f10, the labels
2737 can be given as \fBlf0, lf1, ..., lf10\fR.
2739 The codes transmitted by certain other special keys can be given:
2751 (clear the tab stop in this column),
2754 (clear screen or erase key),
2766 (clear to end of line),
2769 (clear to end of screen),
2772 (insert character or enter insert mode),
2784 (scroll forward/down),
2787 (scroll backward/up),
2790 (set a tab stop in this column).
2792 In addition, if the keypad has a 3 by 3 array of keys including the four
2793 arrow keys, the other five keys can be given as
2800 These keys are useful when the effects of a 3 by 3 directional pad are needed.
2802 Strings to program function keys can be given as
2807 A string to program screen labels should be specified as \fBpln\fP.
2808 Each of these strings takes two parameters: the function key number to
2809 program (from 0 to 10) and the string to program it with.
2810 Function key numbers out of this range may program undefined keys in
2811 a terminal dependent manner.
2812 The difference between the capabilities is that
2814 causes pressing the given key to be the same as the user typing the
2817 causes the string to be executed by the terminal in local; and
2819 causes the string to be transmitted to the computer.
2821 The capabilities \fBnlab\fP, \fBlw\fP and \fBlh\fP
2822 define the number of programmable
2823 screen labels and their width and height.
2824 If there are commands to turn the labels on and off,
2825 give them in \fBsmln\fP and \fBrmln\fP.
2826 \fBsmln\fP is normally output after one or more pln
2827 sequences to make sure that the change becomes visible.
2829 .SS Tabs and Initialization
2831 If the terminal has hardware tabs, the command to advance to the next
2832 tab stop can be given as
2834 (usually control I).
2835 A \*(``back-tab\*('' command which moves leftward to the preceding tab stop can
2838 By convention, if the teletype modes indicate that tabs are being
2839 expanded by the computer rather than being sent to the terminal,
2840 programs should not use
2844 even if they are present, since the user may not have the tab stops
2846 If the terminal has hardware tabs which are initially set every
2848 spaces when the terminal is powered up,
2849 the numeric parameter
2851 is given, showing the number of spaces the tabs are set to.
2852 This is normally used by the \fBtset\fP
2853 command to determine whether to set the mode for hardware tab expansion,
2854 and whether to set the tab stops.
2855 If the terminal has tab stops that can be saved in non-volatile memory,
2856 the terminfo description can assume that they are properly set.
2864 initialization strings for the terminal,
2866 the path name of a program to be run to initialize the terminal,
2867 and \fBif\fR, the name of a file containing long initialization strings.
2868 These strings are expected to set the terminal into modes consistent
2869 with the rest of the terminfo description.
2870 They are normally sent to the terminal, by the
2872 option of the \fBtput\fP program, each time the user logs in.
2873 They will be printed in the following order:
2883 set the margins using
2902 Most initialization is done with
2904 Special terminal modes can be set up without duplicating strings
2905 by putting the common sequences in
2907 and special cases in
2912 A set of sequences that does a harder reset from a totally unknown state
2926 These strings are output by the \fBreset\fP program,
2927 which is used when the terminal gets into a wedged state.
2928 Commands are normally placed in
2934 only if they produce annoying effects on the screen and are not
2935 necessary when logging in.
2936 For example, the command to set the vt100 into 80-column mode would
2939 but it causes an annoying glitch of the screen and is not normally
2940 needed since the terminal is usually already in 80 column mode.
2942 The \fBreset\fP program writes strings including
2944 etc., in the same order as the
2957 reset capability strings are missing, the \fBreset\fP
2958 program falls back upon the corresponding initialization capability string.
2960 If there are commands to set and clear tab stops, they can be given as
2962 (clear all tab stops)
2965 (set a tab stop in the current column of every row).
2966 If a more complex sequence is needed to set the tabs than can be
2967 described by this, the sequence can be placed in
2971 .SS Delays and Padding
2973 Many older and slower terminals do not support either XON/XOFF or DTR
2974 handshaking, including hard copy terminals and some very archaic CRTs
2975 (including, for example, DEC VT100s).
2976 These may require padding characters
2977 after certain cursor motions and screen changes.
2979 If the terminal uses xon/xoff handshaking for flow control (that is,
2980 it automatically emits ^S back to the host when its input buffers are
2983 This capability suppresses the emission of padding.
2985 for memory-mapped console devices effectively that do not have a speed limit.
2986 Padding information should still be included so that routines can
2987 make better decisions about relative costs, but actual pad characters will
2990 If \fBpb\fR (padding baud rate) is given, padding is suppressed at baud rates
2991 below the value of \fBpb\fR.
2992 If the entry has no padding baud rate, then
2993 whether padding is emitted or not is completely controlled by \fBxon\fR.
2995 If the terminal requires other than a null (zero) character as a pad,
2996 then this can be given as \fBpad\fR.
2997 Only the first character of the
3002 Some terminals have an extra \*(``status line\*('' which is not normally used by
3003 software (and thus not counted in the terminal's \fBlines\fR capability).
3005 The simplest case is a status line which is cursor-addressable but not
3006 part of the main scrolling region on the screen; the Heathkit H19 has
3007 a status line of this kind, as would a 24-line VT100 with a 23-line
3008 scrolling region set up on initialization.
3009 This situation is indicated
3010 by the \fBhs\fR capability.
3012 Some terminals with status lines need special sequences to access the
3014 These may be expressed as a string with single parameter
3015 \fBtsl\fR which takes the cursor to a given zero-origin column on the
3017 The capability \fBfsl\fR must return to the main-screen
3018 cursor positions before the last \fBtsl\fR.
3019 You may need to embed the
3020 string values of \fBsc\fR (save cursor) and \fBrc\fR (restore cursor)
3021 in \fBtsl\fR and \fBfsl\fR to accomplish this.
3023 The status line is normally assumed to be the same width as the width
3025 If this is untrue, you can specify it with the numeric
3026 capability \fBwsl\fR.
3028 A command to erase or blank the status line may be specified as \fBdsl\fR.
3030 The boolean capability \fBeslok\fR specifies that escape sequences, tabs,
3031 etc., work ordinarily in the status line.
3033 The \fBncurses\fR implementation does not yet use any of these capabilities.
3034 They are documented here in case they ever become important.
3038 Many terminals have alternate character sets useful for forms-drawing.
3039 Terminfo and \fBcurses\fR have built-in support
3040 for most of the drawing characters
3041 supported by the VT100, with some characters from the AT&T 4410v1 added.
3042 This alternate character set may be specified by the \fBacsc\fR capability.
3049 lw25 lw10 lw6 lw6 lw6.
3051 \fBGlyph ACS Ascii acsc acsc\fR
3052 \fBName Name Default Char Value\fR
3053 arrow pointing right ACS_RARROW > + 0x2b
3054 arrow pointing left ACS_LARROW < , 0x2c
3055 arrow pointing up ACS_UARROW ^ \- 0x2d
3056 arrow pointing down ACS_DARROW v . 0x2e
3057 solid square block ACS_BLOCK # 0 0x30
3058 diamond ACS_DIAMOND + ` 0x60
3059 checker board (stipple) ACS_CKBOARD : a 0x61
3060 degree symbol ACS_DEGREE \e f 0x66
3061 plus/minus ACS_PLMINUS # g 0x67
3062 board of squares ACS_BOARD # h 0x68
3063 lantern symbol ACS_LANTERN # i 0x69
3064 lower right corner ACS_LRCORNER + j 0x6a
3065 upper right corner ACS_URCORNER + k 0x6b
3066 upper left corner ACS_ULCORNER + l 0x6c
3067 lower left corner ACS_LLCORNER + m 0x6d
3068 large plus or crossover ACS_PLUS + n 0x6e
3069 scan line 1 ACS_S1 ~ o 0x6f
3070 scan line 3 ACS_S3 \- p 0x70
3071 horizontal line ACS_HLINE \- q 0x71
3072 scan line 7 ACS_S7 \- r 0x72
3073 scan line 9 ACS_S9 \&_ s 0x73
3074 tee pointing right ACS_LTEE + t 0x74
3075 tee pointing left ACS_RTEE + u 0x75
3076 tee pointing up ACS_BTEE + v 0x76
3077 tee pointing down ACS_TTEE + w 0x77
3078 vertical line ACS_VLINE | x 0x78
3079 less-than-or-equal-to ACS_LEQUAL < y 0x79
3080 greater-than-or-equal-to ACS_GEQUAL > z 0x7a
3081 greek pi ACS_PI * { 0x7b
3082 not-equal ACS_NEQUAL ! | 0x7c
3083 UK pound sign ACS_STERLING f } 0x7d
3084 bullet ACS_BULLET o ~ 0x7e
3087 A few notes apply to the table itself:
3089 X/Open Curses incorrectly states that the mapping for \fIlantern\fP is
3090 uppercase \*(``I\*('' although Unix implementations use the
3091 lowercase \*(``i\*('' mapping.
3093 The DEC VT100 implemented graphics using the alternate character set
3094 feature, temporarily switching \fImodes\fP and sending characters
3095 in the range 0x60 (96) to 0x7e (126)
3096 (the \fBacsc Value\fP column in the table).
3098 The AT&T terminal added graphics characters outside that range.
3100 Some of the characters within the range do not match the VT100;
3101 presumably they were used in the AT&T terminal:
3102 \fIboard of squares\fP replaces the VT100 \fInewline\fP symbol, while
3103 \fIlantern symbol\fP replaces the VT100 \fIvertical tab\fP symbol.
3104 The other VT100 symbols for control characters (\fIhorizontal tab\fP,
3105 \fIcarriage return\fP and \fIline-feed\fP) are not (re)used in curses.
3107 The best way to define a new device's graphics set is to add a column
3108 to a copy of this table for your terminal, giving the character which
3109 (when emitted between \fBsmacs\fR/\fBrmacs\fR switches) will be rendered
3110 as the corresponding graphic.
3111 Then read off the VT100/your terminal
3112 character pairs right to left in sequence; these become the ACSC string.
3116 The curses library functions \fBinit_pair\fP and \fBinit_color\fP
3117 manipulate the \fIcolor pairs\fP and \fIcolor values\fP discussed in this
3119 (see \fBcurs_color\fP(3X) for details on these and related functions).
3121 Most color terminals are either \*(``Tektronix-like\*('' or \*(``HP-like\*('':
3124 terminals have a predefined set of \fIN\fP colors
3125 (where \fIN\fP is usually 8),
3127 character-cell foreground and background characters independently, mixing them
3128 into \fIN\fP\ *\ \fIN\fP color-pairs.
3130 On HP-like terminals, the user must set each color
3131 pair up separately (foreground and background are not independently settable).
3132 Up to \fIM\fP color-pairs may be set up from 2*\fIM\fP different colors.
3133 ANSI-compatible terminals are Tektronix-like.
3135 Some basic color capabilities are independent of the color method.
3137 capabilities \fBcolors\fR and \fBpairs\fR specify the maximum numbers of colors
3138 and color-pairs that can be displayed simultaneously.
3139 The \fBop\fR (original
3140 pair) string resets foreground and background colors to their default values
3142 The \fBoc\fR string resets all colors or color-pairs to
3143 their default values for the terminal.
3144 Some terminals (including many PC
3145 terminal emulators) erase screen areas with the current background color rather
3146 than the power-up default background; these should have the boolean capability
3149 While the curses library works with \fIcolor pairs\fP
3150 (reflecting the inability of some devices to set foreground
3151 and background colors independently),
3152 there are separate capabilities for setting these features:
3154 To change the current foreground or background color on a Tektronix-type
3155 terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI
3156 background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background).
3157 These take one parameter, the color number.
3158 The SVr4 documentation describes
3159 only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal
3160 supports ANSI escape sequences to set background and foreground, they should
3161 be coded as \fBsetaf\fR and \fBsetab\fR, respectively.
3164 supports other escape sequences to set background and foreground, they should
3165 be coded as \fBsetf\fR and \fBsetb\fR, respectively.
3166 The \fBvidputs\fR and the \fBrefresh\fP(3X) functions
3167 use the \fBsetaf\fR and \fBsetab\fR capabilities if they are defined.
3169 The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a
3170 single numeric argument each.
3171 Argument values 0-7 of \fBsetaf\fR/\fBsetab\fR are portably defined as
3172 follows (the middle column is the symbolic #define available in the header for
3173 the \fBcurses\fR or \fBncurses\fR libraries).
3174 The terminal hardware is free to
3175 map these as it likes, but the RGB values indicate normal locations in color
3182 \fBColor #define Value RGB\fR
3183 black \fBCOLOR_BLACK\fR 0 0, 0, 0
3184 red \fBCOLOR_RED\ \fR 1 max,0,0
3185 green \fBCOLOR_GREEN\fR 2 0,max,0
3186 yellow \fBCOLOR_YELLOW\fR 3 max,max,0
3187 blue \fBCOLOR_BLUE\fR 4 0,0,max
3188 magenta \fBCOLOR_MAGENTA\fR 5 max,0,max
3189 cyan \fBCOLOR_CYAN\fR 6 0,max,max
3190 white \fBCOLOR_WHITE\fR 7 max,max,max
3193 The argument values of \fBsetf\fR/\fBsetb\fR historically correspond to
3194 a different mapping, i.e.,
3199 \fBColor #define Value RGB\fR
3200 black \fBCOLOR_BLACK\fR 0 0, 0, 0
3201 blue \fBCOLOR_BLUE\fR 1 0,0,max
3202 green \fBCOLOR_GREEN\fR 2 0,max,0
3203 cyan \fBCOLOR_CYAN\fR 3 0,max,max
3204 red \fBCOLOR_RED\ \fR 4 max,0,0
3205 magenta \fBCOLOR_MAGENTA\fR 5 max,0,max
3206 yellow \fBCOLOR_YELLOW\fR 6 max,max,0
3207 white \fBCOLOR_WHITE\fR 7 max,max,max
3210 It is important to not confuse the two sets of color capabilities;
3211 otherwise red/blue will be interchanged on the display.
3213 On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set
3214 which color pair is current.
3216 Some terminals allow the \fIcolor values\fP to be modified:
3218 On a Tektronix-like terminal, the capability \fBccc\fR may be present to
3219 indicate that colors can be modified.
3220 If so, the \fBinitc\fR capability will
3221 take a color number (0 to \fBcolors\fR \- 1)and three more parameters which
3223 These three parameters default to being interpreted as RGB
3224 (Red, Green, Blue) values.
3225 If the boolean capability \fBhls\fR is present,
3226 they are instead as HLS (Hue, Lightness, Saturation) indices.
3230 On an HP-like terminal, \fBinitp\fR may give a capability for changing a
3232 It will take seven parameters; a color-pair number (0 to
3233 \fBmax_pairs\fR \- 1), and two triples describing first background and then
3235 These parameters must be (Red, Green, Blue) or
3236 (Hue, Lightness, Saturation) depending on \fBhls\fR.
3238 On some color terminals, colors collide with highlights.
3240 these collisions with the \fBncv\fR capability.
3241 This is a bit-mask of
3242 attributes not to be used when colors are enabled.
3243 The correspondence with the
3244 attributes understood by \fBcurses\fR is as follows:
3250 \fBAttribute Bit Decimal Set by\fR
3259 A_ALTCHARSET 8 256 sgr
3260 A_HORIZONTAL 9 512 sgr1
3263 A_RIGHT 12 4096 sgr1
3265 A_VERTICAL 14 16384 sgr1
3266 A_ITALIC 15 32768 sitm
3269 For example, on many IBM PC consoles, the underline attribute collides with the
3270 foreground color blue and is not available in color mode.
3272 an \fBncv\fR capability of 2.
3274 SVr4 curses does nothing with \fBncv\fR, ncurses recognizes it and optimizes
3275 the output in favor of colors.
3278 If the terminal requires other than a null (zero) character as a pad, then this
3279 can be given as pad.
3280 Only the first character of the pad string is used.
3281 If the terminal does not have a pad character, specify npc.
3282 Note that ncurses implements the termcap-compatible \fBPC\fR variable;
3283 though the application may set this value to something other than
3284 a null, ncurses will test \fBnpc\fR first and use napms if the terminal
3285 has no pad character.
3287 If the terminal can move up or down half a line,
3288 this can be indicated with
3294 This is primarily useful for superscripts and subscripts on hard-copy terminals.
3295 If a hard-copy terminal can eject to the next page (form feed), give this as
3297 (usually control L).
3299 If there is a command to repeat a given character a given number of
3300 times (to save time transmitting a large number of identical characters)
3301 this can be indicated with the parameterized string
3303 The first parameter is the character to be repeated and the second
3304 is the number of times to repeat it.
3305 Thus, tparm(repeat_char, 'x', 10) is the same as \*(``xxxxxxxxxx\*(''.
3307 If the terminal has a settable command character, such as the \s-1TEKTRONIX\s+1 4025,
3308 this can be indicated with
3310 A prototype command character is chosen which is used in all capabilities.
3311 This character is given in the
3313 capability to identify it.
3314 The following convention is supported on some UNIX systems:
3315 The environment is to be searched for a
3317 variable, and if found, all
3318 occurrences of the prototype character are replaced with the character
3319 in the environment variable.
3321 Terminal descriptions that do not represent a specific kind of known
3330 (generic) capability so that programs can complain that they do not know
3331 how to talk to the terminal.
3332 (This capability does not apply to
3334 terminal descriptions for which the escape sequences are known.)
3336 If the terminal has a \*(``meta key\*('' which acts as a shift key,
3337 setting the 8th bit of any character transmitted, this fact can
3340 Otherwise, software will assume that the 8th bit is parity and it
3341 will usually be cleared.
3342 If strings exist to turn this \*(``meta mode\*('' on and off, they
3348 If the terminal has more lines of memory than will fit on the screen
3349 at once, the number of lines of memory can be indicated with
3353 indicates that the number of lines is not fixed,
3354 but that there is still more memory than fits on the screen.
3356 If the terminal is one of those supported by the \s-1UNIX\s+1 virtual
3357 terminal protocol, the terminal number can be given as
3361 strings which control an auxiliary printer connected to the terminal
3364 print the contents of the screen,
3366 turn off the printer, and
3368 turn on the printer.
3369 When the printer is on, all text sent to the terminal will be sent
3371 It is undefined whether the text is also displayed on the terminal screen
3372 when the printer is on.
3375 takes one parameter, and leaves the printer on for as many characters
3376 as the value of the parameter, then turns the printer off.
3377 The parameter should not exceed 255.
3380 is transparently passed to the printer while an
3384 .SS Glitches and Braindamage
3386 Hazeltine terminals, which do not allow \*(``~\*('' characters to be displayed should
3389 Terminals which ignore a line-feed immediately after an \fBam\fR wrap,
3390 such as the Concept and vt100,
3391 should indicate \fBxenl\fR.
3395 is required to get rid of standout
3396 (instead of merely writing normal text on top of it),
3397 \fBxhp\fP should be given.
3399 Teleray terminals, where tabs turn all characters moved over to blanks,
3400 should indicate \fBxt\fR (destructive tabs).
3401 Note: the variable indicating this is now \*(``dest_tabs_magic_smso\*(''; in
3402 older versions, it was teleray_glitch.
3403 This glitch is also taken to mean that it is not possible to position
3404 the cursor on top of a \*(``magic cookie\*('',
3405 that to erase standout mode it is instead necessary to use
3406 delete and insert line.
3407 The ncurses implementation ignores this glitch.
3409 The Beehive Superbee, which is unable to correctly transmit the escape
3410 or control C characters, has
3412 indicating that the f1 key is used for escape and f2 for control C.
3413 (Only certain Superbees have this problem, depending on the ROM.)
3414 Note that in older terminfo versions, this capability was called
3415 \*(``beehive_glitch\*(''; it is now \*(``no_esc_ctl_c\*(''.
3417 Other specific terminal problems may be corrected by adding more
3418 capabilities of the form \fBx\fR\fIx\fR.
3420 .SS Pitfalls of Long Entries
3422 Long terminfo entries are unlikely to be a problem; to date, no entry has even
3423 approached terminfo's 4096-byte string-table maximum.
3424 Unfortunately, the termcap
3425 translations are much more strictly limited (to 1023 bytes), thus termcap translations
3426 of long terminfo entries can cause problems.
3428 The man pages for 4.3BSD and older versions of \fBtgetent\fP instruct the user to
3429 allocate a 1024-byte buffer for the termcap entry.
3430 The entry gets null-terminated by
3431 the termcap library, so that makes the maximum safe length for a termcap entry
3433 Depending on what the application and the termcap library
3434 being used does, and where in the termcap file the terminal type that \fBtgetent\fP
3435 is searching for is, several bad things can happen.
3437 Some termcap libraries print a warning message or exit if they find an
3438 entry that's longer than 1023 bytes; others do not; others truncate the
3439 entries to 1023 bytes.
3440 Some application programs allocate more than
3441 the recommended 1K for the termcap entry; others do not.
3443 Each termcap entry has two important sizes associated with it: before
3444 "tc" expansion, and after "tc" expansion.
3445 "tc" is the capability that
3446 tacks on another termcap entry to the end of the current one, to add
3447 on its capabilities.
3448 If a termcap entry does not use the "tc"
3449 capability, then of course the two lengths are the same.
3451 The "before tc expansion" length is the most important one, because it
3452 affects more than just users of that particular terminal.
3454 length of the entry as it exists in /etc/termcap, minus the
3455 backslash-newline pairs, which \fBtgetent\fP strips out while reading it.
3456 Some termcap libraries strip off the final newline, too (GNU termcap does not).
3459 a termcap entry before expansion is more than 1023 bytes long,
3461 and the application has only allocated a 1k buffer,
3463 and the termcap library (like the one in BSD/OS 1.1 and GNU) reads
3464 the whole entry into the buffer, no matter what its length, to see
3465 if it is the entry it wants,
3467 and \fBtgetent\fP is searching for a terminal type that either is the
3468 long entry, appears in the termcap file after the long entry, or
3469 does not appear in the file at all (so that \fBtgetent\fP has to search
3470 the whole termcap file).
3472 Then \fBtgetent\fP will overwrite memory, perhaps its stack, and probably core dump
3474 Programs like telnet are particularly vulnerable; modern telnets
3475 pass along values like the terminal type automatically.
3476 The results are almost
3477 as undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, that
3478 prints warning messages when it reads an overly long termcap entry.
3480 termcap library truncates long entries, like OSF/1 3.0, it is immune to dying
3481 here but will return incorrect data for the terminal.
3483 The "after tc expansion" length will have a similar effect to the
3484 above, but only for people who actually set TERM to that terminal
3485 type, since \fBtgetent\fP only does "tc" expansion once it is found the
3486 terminal type it was looking for, not while searching.
3488 In summary, a termcap entry that is longer than 1023 bytes can cause,
3489 on various combinations of termcap libraries and applications, a core
3490 dump, warnings, or incorrect operation.
3491 If it is too long even before
3492 "tc" expansion, it will have this effect even for users of some other
3493 terminal types and users whose TERM variable does not have a termcap
3496 When in \-C (translate to termcap) mode, the \fBncurses\fR implementation of
3497 \fBtic\fR(1M) issues warning messages when the pre-tc length of a termcap
3498 translation is too long.
3499 The \-c (check) option also checks resolved (after tc
3501 .SS Binary Compatibility
3502 It is not wise to count on portability of binary terminfo entries between
3503 commercial UNIX versions.
3504 The problem is that there are at least two versions
3505 of terminfo (under HP\-UX and AIX) which diverged from System V terminfo after
3506 SVr1, and have added extension capabilities to the string table that (in the
3507 binary format) collide with System V and XSI Curses extensions.
3510 Searching for terminal descriptions in
3511 \fB$HOME/.terminfo\fR and TERMINFO_DIRS
3512 is not supported by older implementations.
3514 Some SVr4 \fBcurses\fR implementations, and all previous to SVr4, do not
3515 interpret the %A and %O operators in parameter strings.
3517 SVr4/XPG4 do not specify whether \fBmsgr\fR licenses movement while in
3518 an alternate-character-set mode (such modes may, among other things, map
3519 CR and NL to characters that do not trigger local motions).
3520 The \fBncurses\fR implementation ignores \fBmsgr\fR in \fBALTCHARSET\fR
3522 This raises the possibility that an XPG4
3523 implementation making the opposite interpretation may need terminfo
3524 entries made for \fBncurses\fR to have \fBmsgr\fR turned off.
3526 The \fBncurses\fR library handles insert-character and insert-character modes
3527 in a slightly non-standard way to get better update efficiency.
3529 the \fBInsert/Delete Character\fR subsection above.
3531 The parameter substitutions for \fBset_clock\fR and \fBdisplay_clock\fR are
3532 not documented in SVr4 or the XSI Curses standard.
3533 They are deduced from the
3534 documentation for the AT&T 505 terminal.
3536 Be careful assigning the \fBkmous\fR capability.
3537 The \fBncurses\fR library wants to interpret it as \fBKEY_MOUSE\fR,
3538 for use by terminals and emulators like xterm
3539 that can return mouse-tracking information in the keyboard-input stream.
3541 X/Open Curses does not mention italics.
3542 Portable applications must assume that numeric capabilities are
3543 signed 16-bit values.
3544 This includes the \fIno_color_video\fP (ncv) capability.
3545 The 32768 mask value used for italics with ncv can be confused with
3546 an absent or cancelled ncv.
3547 If italics should work with colors,
3548 then the ncv value must be specified, even if it is zero.
3550 Different commercial ports of terminfo and curses support different subsets of
3551 the XSI Curses standard and (in some cases) different extension sets.
3553 is a summary, accurate as of October 1995:
3555 \fBSVR4, Solaris, ncurses\fR \-\-
3556 These support all SVr4 capabilities.
3559 Supports the SVr4 set, adds one undocumented extended string
3560 capability (\fBset_pglen\fR).
3562 \fBSVr1, Ultrix\fR \-\-
3563 These support a restricted subset of terminfo capabilities.
3564 The booleans end with \fBxon_xoff\fR;
3565 the numerics with \fBwidth_status_line\fR;
3566 and the strings with \fBprtr_non\fR.
3569 Supports the SVr1 subset, plus the SVr[234] numerics \fBnum_labels\fR,
3570 \fBlabel_height\fR, \fBlabel_width\fR, plus function keys 11 through 63, plus
3571 \fBplab_norm\fR, \fBlabel_on\fR, and \fBlabel_off\fR, plus some incompatible
3572 extensions in the string table.
3575 Supports the SVr1 subset, plus function keys 11 through 63, plus a number
3576 of incompatible string table extensions.
3579 Supports both the SVr4 set and the AIX extensions.
3583 files containing terminal descriptions
3588 \fBcurs_color\fR(3X),
3591 \fBterm_variables\fR(3X).
3594 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
3595 Based on pcurses by Pavel Curtis.