1terminfo(5) File Formats terminfo(5)
2
3
4
6 terminfo - terminal capability data base
7
9 /usr/share/terminfo/*/*
10
12 Terminfo is a data base describing terminals, used by screen-oriented
13 programs such as nvi(1), rogue(1) and libraries such as curses(3X).
14 Terminfo describes terminals by giving a set of capabilities which they
15 have, by specifying how to perform screen operations, and by specifying
16 padding requirements and initialization sequences. This describes
17 ncurses version 5.6 (patch 20070812).
18
19 Entries in terminfo consist of a sequence of `,' separated fields
20 (embedded commas may be escaped with a backslash or notated as \054).
21 White space after the `,' separator is ignored. The first entry for
22 each terminal gives the names which are known for the terminal, sepa‐
23 rated by `|' characters. The first name given is the most common
24 abbreviation for the terminal, the last name given should be a long
25 name fully identifying the terminal, and all others are understood as
26 synonyms for the terminal name. All names but the last should be in
27 lower case and contain no blanks; the last name may well contain upper
28 case and blanks for readability.
29
30 Lines beginning with a `#' in the first column are treated as comments.
31 While comment lines are legal at any point, the output of captoinfo and
32 infotocap (aliases for tic) will move comments so they occur only
33 between entries.
34
35 Newlines and leading tabs may be used for formatting entries for read‐
36 ability. These are removed from parsed entries. The infocmp -f option
37 relies on this to format if-then-else expressions: the result can be
38 read by tic.
39
40 Terminal names (except for the last, verbose entry) should be chosen
41 using the following conventions. The particular piece of hardware mak‐
42 ing up the terminal should have a root name, thus ``hp2621''. This
43 name should not contain hyphens. Modes that the hardware can be in, or
44 user preferences, should be indicated by appending a hyphen and a mode
45 suffix. Thus, a vt100 in 132 column mode would be vt100-w. The fol‐
46 lowing suffixes should be used where possible:
47
48 Suffix Meaning Example
49 -nn Number of lines on the screen aaa-60
50 -np Number of pages of memory c100-4p
51 -am With automargins (usually the default) vt100-am
52 -m Mono mode; suppress color ansi-m
53 -mc Magic cookie; spaces when highlighting wy30-mc
54 -na No arrow keys (leave them in local) c100-na
55 -nam Without automatic margins vt100-nam
56 -nl No status line att4415-nl
57 -ns No status line hp2626-ns
58 -rv Reverse video c100-rv
59 -s Enable status line vt100-s
60 -vb Use visible bell instead of beep wy370-vb
61 -w Wide mode (> 80 columns, usually 132) vt100-w
62
63 For more on terminal naming conventions, see the term(7) manual page.
64
65 Capabilities
66 The following is a complete table of the capabilities included in a
67 terminfo description block and available to terminfo-using code. In
68 each line of the table,
69
70 The variable is the name by which the programmer (at the terminfo
71 level) accesses the capability.
72
73 The capname is the short name used in the text of the database, and is
74 used by a person updating the database. Whenever possible, capnames
75 are chosen to be the same as or similar to the ANSI X3.64-1979 standard
76 (now superseded by ECMA-48, which uses identical or very similar
77 names). Semantics are also intended to match those of the specifica‐
78 tion.
79
80 The termcap code is the old termcap capability name (some capabilities
81 are new, and have names which termcap did not originate).
82
83 Capability names have no hard length limit, but an informal limit of 5
84 characters has been adopted to keep them short and to allow the tabs in
85 the source file Caps to line up nicely.
86
87 Finally, the description field attempts to convey the semantics of the
88 capability. You may find some codes in the description field:
89
90 (P) indicates that padding may be specified
91
92 #[1-9] in the description field indicates that the string is passed
93 through tparm with parms as given (#i).
94
95 (P*) indicates that padding may vary in proportion to the number of
96 lines affected
97
98 (#i) indicates the ith parameter.
99
100
101 These are the boolean capabilities:
102
103
104 Variable Cap- TCap Description
105 Booleans name Code
106 auto_left_margin bw bw cub1 wraps from col‐
107 umn 0 to last column
108 auto_right_margin am am terminal has auto‐
109 matic margins
110 back_color_erase bce ut screen erased with
111 background color
112 can_change ccc cc terminal can re-
113 define existing col‐
114 ors
115 ceol_standout_glitch xhp xs standout not erased
116 by overwriting (hp)
117 col_addr_glitch xhpa YA only positive motion
118 for hpa/mhpa caps
119 cpi_changes_res cpix YF changing character
120 pitch changes reso‐
121 lution
122 cr_cancels_micro_mode crxm YB using cr turns off
123 micro mode
124 dest_tabs_magic_smso xt xt tabs destructive,
125 magic so char
126 (t1061)
127 eat_newline_glitch xenl xn newline ignored
128 after 80 cols (con‐
129 cept)
130 erase_overstrike eo eo can erase over‐
131 strikes with a blank
132 generic_type gn gn generic line type
133 hard_copy hc hc hardcopy terminal
134
135 hard_cursor chts HC cursor is hard to
136 see
137 has_meta_key km km Has a meta key
138 (i.e., sets 8th-bit)
139 has_print_wheel daisy YC printer needs opera‐
140 tor to change char‐
141 acter set
142 has_status_line hs hs has extra status
143 line
144 hue_lightness_saturation hls hl terminal uses only
145 HLS color notation
146 (Tektronix)
147 insert_null_glitch in in insert mode distin‐
148 guishes nulls
149 lpi_changes_res lpix YG changing line pitch
150 changes resolution
151 memory_above da da display may be
152 retained above the
153 screen
154 memory_below db db display may be
155 retained below the
156 screen
157 move_insert_mode mir mi safe to move while
158 in insert mode
159 move_standout_mode msgr ms safe to move while
160 in standout mode
161 needs_xon_xoff nxon nx padding will not
162 work, xon/xoff
163 required
164 no_esc_ctlc xsb xb beehive (f1=escape,
165 f2=ctrl C)
166 no_pad_char npc NP pad character does
167 not exist
168 non_dest_scroll_region ndscr ND scrolling region is
169 non-destructive
170 non_rev_rmcup nrrmc NR smcup does not
171 reverse rmcup
172 over_strike os os terminal can over‐
173 strike
174 prtr_silent mc5i 5i printer will not
175 echo on screen
176 row_addr_glitch xvpa YD only positive motion
177 for vpa/mvpa caps
178 semi_auto_right_margin sam YE printing in last
179 column causes cr
180 status_line_esc_ok eslok es escape can be used
181 on the status line
182 tilde_glitch hz hz cannot print ~'s
183 (hazeltine)
184 transparent_underline ul ul underline character
185 overstrikes
186 xon_xoff xon xo terminal uses
187 xon/xoff handshaking
188
189 These are the numeric capabilities:
190
191
192 Variable Cap- TCap Description
193 Numeric name Code
194 columns cols co number of columns in
195 a line
196 init_tabs it it tabs initially every
197 # spaces
198 label_height lh lh rows in each label
199 label_width lw lw columns in each
200 label
201
202 lines lines li number of lines on
203 screen or page
204 lines_of_memory lm lm lines of memory if >
205 line. 0 means varies
206 magic_cookie_glitch xmc sg number of blank
207 characters left by
208 smso or rmso
209 max_attributes ma ma maximum combined
210 attributes terminal
211 can handle
212 max_colors colors Co maximum number of
213 colors on screen
214 max_pairs pairs pa maximum number of
215 color-pairs on the
216 screen
217 maximum_windows wnum MW maximum number of
218 defineable windows
219 no_color_video ncv NC video attributes
220 that cannot be used
221 with colors
222 num_labels nlab Nl number of labels on
223 screen
224 padding_baud_rate pb pb lowest baud rate
225 where padding needed
226 virtual_terminal vt vt virtual terminal
227 number (CB/unix)
228 width_status_line wsl ws number of columns in
229 status line
230
231 The following numeric capabilities are present in the SVr4.0 term
232 structure, but are not yet documented in the man page. They came in
233 with SVr4's printer support.
234
235
236 Variable Cap- TCap Description
237 Numeric name Code
238 bit_image_entwining bitwin Yo number of passes for
239 each bit-image row
240 bit_image_type bitype Yp type of bit-image
241 device
242 buffer_capacity bufsz Ya numbers of bytes
243 buffered before
244 printing
245 buttons btns BT number of buttons on
246 mouse
247 dot_horz_spacing spinh Yc spacing of dots hor‐
248 izontally in dots
249 per inch
250 dot_vert_spacing spinv Yb spacing of pins ver‐
251 tically in pins per
252 inch
253 max_micro_address maddr Yd maximum value in
254 micro_..._address
255 max_micro_jump mjump Ye maximum value in
256 parm_..._micro
257 micro_col_size mcs Yf character step size
258 when in micro mode
259 micro_line_size mls Yg line step size when
260 in micro mode
261 number_of_pins npins Yh numbers of pins in
262 print-head
263 output_res_char orc Yi horizontal resolu‐
264 tion in units per
265 line
266
267
268
269 output_res_horz_inch orhi Yk horizontal resolu‐
270 tion in units per
271 inch
272 output_res_line orl Yj vertical resolution
273 in units per line
274 output_res_vert_inch orvi Yl vertical resolution
275 in units per inch
276 print_rate cps Ym print rate in char‐
277 acters per second
278 wide_char_size widcs Yn character step size
279 when in double wide
280 mode
281
282 These are the string capabilities:
283
284
285 Variable Cap- TCap Description
286 String name Code
287 acs_chars acsc ac graphics charset
288 pairs, based on
289 vt100
290 back_tab cbt bt back tab (P)
291 bell bel bl audible signal
292 (bell) (P)
293 carriage_return cr cr carriage return (P*)
294 (P*)
295 change_char_pitch cpi ZA Change number of
296 characters per inch
297 to #1
298 change_line_pitch lpi ZB Change number of
299 lines per inch to #1
300 change_res_horz chr ZC Change horizontal
301 resolution to #1
302 change_res_vert cvr ZD Change vertical res‐
303 olution to #1
304 change_scroll_region csr cs change region to
305 line #1 to line #2
306 (P)
307 char_padding rmp rP like ip but when in
308 insert mode
309 clear_all_tabs tbc ct clear all tab stops
310 (P)
311 clear_margins mgc MC clear right and left
312 soft margins
313 clear_screen clear cl clear screen and
314 home cursor (P*)
315 clr_bol el1 cb Clear to beginning
316 of line
317 clr_eol el ce clear to end of line
318 (P)
319 clr_eos ed cd clear to end of
320 screen (P*)
321 column_address hpa ch horizontal position
322 #1, absolute (P)
323 command_character cmdch CC terminal settable
324 cmd character in
325 prototype !?
326 create_window cwin CW define a window #1
327 from #2,#3 to #4,#5
328 cursor_address cup cm move to row #1 col‐
329 umns #2
330 cursor_down cud1 do down one line
331 cursor_home home ho home cursor (if no
332 cup)
333 cursor_invisible civis vi make cursor invisi‐
334 ble
335
336 cursor_left cub1 le move left one space
337 cursor_mem_address mrcup CM memory relative cur‐
338 sor addressing, move
339 to row #1 columns #2
340 cursor_normal cnorm ve make cursor appear
341 normal (undo
342 civis/cvvis)
343 cursor_right cuf1 nd non-destructive
344 space (move right
345 one space)
346 cursor_to_ll ll ll last line, first
347 column (if no cup)
348 cursor_up cuu1 up up one line
349 cursor_visible cvvis vs make cursor very
350 visible
351 define_char defc ZE Define a character
352 #1, #2 dots wide,
353 descender #3
354 delete_character dch1 dc delete character
355 (P*)
356 delete_line dl1 dl delete line (P*)
357 dial_phone dial DI dial number #1
358 dis_status_line dsl ds disable status line
359 display_clock dclk DK display clock
360 down_half_line hd hd half a line down
361 ena_acs enacs eA enable alternate
362 char set
363 enter_alt_charset_mode smacs as start alternate
364 character set (P)
365 enter_am_mode smam SA turn on automatic
366 margins
367 enter_blink_mode blink mb turn on blinking
368 enter_bold_mode bold md turn on bold (extra
369 bright) mode
370 enter_ca_mode smcup ti string to start pro‐
371 grams using cup
372 enter_delete_mode smdc dm enter delete mode
373 enter_dim_mode dim mh turn on half-bright
374 mode
375 enter_doublewide_mode swidm ZF Enter double-wide
376 mode
377 enter_draft_quality sdrfq ZG Enter draft-quality
378 mode
379 enter_insert_mode smir im enter insert mode
380 enter_italics_mode sitm ZH Enter italic mode
381 enter_leftward_mode slm ZI Start leftward car‐
382 riage motion
383 enter_micro_mode smicm ZJ Start micro-motion
384 mode
385 enter_near_letter_quality snlq ZK Enter NLQ mode
386 enter_normal_quality snrmq ZL Enter normal-quality
387 mode
388 enter_protected_mode prot mp turn on protected
389 mode
390 enter_reverse_mode rev mr turn on reverse
391 video mode
392 enter_secure_mode invis mk turn on blank mode
393 (characters invisi‐
394 ble)
395 enter_shadow_mode sshm ZM Enter shadow-print
396 mode
397 enter_standout_mode smso so begin standout mode
398 enter_subscript_mode ssubm ZN Enter subscript mode
399 enter_superscript_mode ssupm ZO Enter superscript
400 mode
401 enter_underline_mode smul us begin underline mode
402
403 enter_upward_mode sum ZP Start upward car‐
404 riage motion
405 enter_xon_mode smxon SX turn on xon/xoff
406 handshaking
407 erase_chars ech ec erase #1 characters
408 (P)
409 exit_alt_charset_mode rmacs ae end alternate char‐
410 acter set (P)
411 exit_am_mode rmam RA turn off automatic
412 margins
413 exit_attribute_mode sgr0 me turn off all
414 attributes
415 exit_ca_mode rmcup te strings to end pro‐
416 grams using cup
417 exit_delete_mode rmdc ed end delete mode
418 exit_doublewide_mode rwidm ZQ End double-wide mode
419 exit_insert_mode rmir ei exit insert mode
420 exit_italics_mode ritm ZR End italic mode
421 exit_leftward_mode rlm ZS End left-motion mode
422 exit_micro_mode rmicm ZT End micro-motion
423 mode
424 exit_shadow_mode rshm ZU End shadow-print
425 mode
426 exit_standout_mode rmso se exit standout mode
427 exit_subscript_mode rsubm ZV End subscript mode
428 exit_superscript_mode rsupm ZW End superscript mode
429 exit_underline_mode rmul ue exit underline mode
430 exit_upward_mode rum ZX End reverse charac‐
431 ter motion
432 exit_xon_mode rmxon RX turn off xon/xoff
433 handshaking
434 fixed_pause pause PA pause for 2-3 sec‐
435 onds
436 flash_hook hook fh flash switch hook
437 flash_screen flash vb visible bell (may
438 not move cursor)
439 form_feed ff ff hardcopy terminal
440 page eject (P*)
441 from_status_line fsl fs return from status
442 line
443 goto_window wingo WG go to window #1
444 hangup hup HU hang-up phone
445 init_1string is1 i1 initialization
446 string
447 init_2string is2 is initialization
448 string
449 init_3string is3 i3 initialization
450 string
451 init_file if if name of initializa‐
452 tion file
453 init_prog iprog iP path name of program
454 for initialization
455 initialize_color initc Ic initialize color #1
456 to (#2,#3,#4)
457 initialize_pair initp Ip Initialize color
458 pair #1 to
459 fg=(#2,#3,#4),
460 bg=(#5,#6,#7)
461 insert_character ich1 ic insert character (P)
462 insert_line il1 al insert line (P*)
463 insert_padding ip ip insert padding after
464 inserted character
465 key_a1 ka1 K1 upper left of keypad
466 key_a3 ka3 K3 upper right of key‐
467 pad
468 key_b2 kb2 K2 center of keypad
469
470 key_backspace kbs kb backspace key
471 key_beg kbeg @1 begin key
472 key_btab kcbt kB back-tab key
473 key_c1 kc1 K4 lower left of keypad
474 key_c3 kc3 K5 lower right of key‐
475 pad
476 key_cancel kcan @2 cancel key
477 key_catab ktbc ka clear-all-tabs key
478 key_clear kclr kC clear-screen or
479 erase key
480 key_close kclo @3 close key
481 key_command kcmd @4 command key
482 key_copy kcpy @5 copy key
483 key_create kcrt @6 create key
484 key_ctab kctab kt clear-tab key
485 key_dc kdch1 kD delete-character key
486 key_dl kdl1 kL delete-line key
487 key_down kcud1 kd down-arrow key
488 key_eic krmir kM sent by rmir or smir
489 in insert mode
490 key_end kend @7 end key
491 key_enter kent @8 enter/send key
492 key_eol kel kE clear-to-end-of-line
493 key
494 key_eos ked kS clear-to-end-of-
495 screen key
496 key_exit kext @9 exit key
497 key_f0 kf0 k0 F0 function key
498 key_f1 kf1 k1 F1 function key
499 key_f10 kf10 k; F10 function key
500 key_f11 kf11 F1 F11 function key
501 key_f12 kf12 F2 F12 function key
502 key_f13 kf13 F3 F13 function key
503 key_f14 kf14 F4 F14 function key
504 key_f15 kf15 F5 F15 function key
505 key_f16 kf16 F6 F16 function key
506 key_f17 kf17 F7 F17 function key
507 key_f18 kf18 F8 F18 function key
508 key_f19 kf19 F9 F19 function key
509 key_f2 kf2 k2 F2 function key
510 key_f20 kf20 FA F20 function key
511 key_f21 kf21 FB F21 function key
512 key_f22 kf22 FC F22 function key
513 key_f23 kf23 FD F23 function key
514 key_f24 kf24 FE F24 function key
515 key_f25 kf25 FF F25 function key
516 key_f26 kf26 FG F26 function key
517 key_f27 kf27 FH F27 function key
518 key_f28 kf28 FI F28 function key
519 key_f29 kf29 FJ F29 function key
520 key_f3 kf3 k3 F3 function key
521 key_f30 kf30 FK F30 function key
522 key_f31 kf31 FL F31 function key
523 key_f32 kf32 FM F32 function key
524 key_f33 kf33 FN F33 function key
525 key_f34 kf34 FO F34 function key
526 key_f35 kf35 FP F35 function key
527 key_f36 kf36 FQ F36 function key
528 key_f37 kf37 FR F37 function key
529 key_f38 kf38 FS F38 function key
530 key_f39 kf39 FT F39 function key
531 key_f4 kf4 k4 F4 function key
532 key_f40 kf40 FU F40 function key
533 key_f41 kf41 FV F41 function key
534 key_f42 kf42 FW F42 function key
535 key_f43 kf43 FX F43 function key
536
537 key_f44 kf44 FY F44 function key
538 key_f45 kf45 FZ F45 function key
539 key_f46 kf46 Fa F46 function key
540 key_f47 kf47 Fb F47 function key
541 key_f48 kf48 Fc F48 function key
542 key_f49 kf49 Fd F49 function key
543 key_f5 kf5 k5 F5 function key
544 key_f50 kf50 Fe F50 function key
545 key_f51 kf51 Ff F51 function key
546 key_f52 kf52 Fg F52 function key
547 key_f53 kf53 Fh F53 function key
548 key_f54 kf54 Fi F54 function key
549 key_f55 kf55 Fj F55 function key
550 key_f56 kf56 Fk F56 function key
551 key_f57 kf57 Fl F57 function key
552 key_f58 kf58 Fm F58 function key
553 key_f59 kf59 Fn F59 function key
554 key_f6 kf6 k6 F6 function key
555 key_f60 kf60 Fo F60 function key
556 key_f61 kf61 Fp F61 function key
557 key_f62 kf62 Fq F62 function key
558 key_f63 kf63 Fr F63 function key
559 key_f7 kf7 k7 F7 function key
560 key_f8 kf8 k8 F8 function key
561 key_f9 kf9 k9 F9 function key
562 key_find kfnd @0 find key
563 key_help khlp %1 help key
564 key_home khome kh home key
565 key_ic kich1 kI insert-character key
566 key_il kil1 kA insert-line key
567 key_left kcub1 kl left-arrow key
568 key_ll kll kH lower-left key (home
569 down)
570 key_mark kmrk %2 mark key
571 key_message kmsg %3 message key
572 key_move kmov %4 move key
573 key_next knxt %5 next key
574 key_npage knp kN next-page key
575 key_open kopn %6 open key
576 key_options kopt %7 options key
577 key_ppage kpp kP previous-page key
578 key_previous kprv %8 previous key
579 key_print kprt %9 print key
580 key_redo krdo %0 redo key
581 key_reference kref &1 reference key
582 key_refresh krfr &2 refresh key
583 key_replace krpl &3 replace key
584 key_restart krst &4 restart key
585 key_resume kres &5 resume key
586 key_right kcuf1 kr right-arrow key
587 key_save ksav &6 save key
588 key_sbeg kBEG &9 shifted begin key
589 key_scancel kCAN &0 shifted cancel key
590 key_scommand kCMD *1 shifted command key
591 key_scopy kCPY *2 shifted copy key
592 key_screate kCRT *3 shifted create key
593 key_sdc kDC *4 shifted delete-char‐
594 acter key
595 key_sdl kDL *5 shifted delete-line
596 key
597 key_select kslt *6 select key
598 key_send kEND *7 shifted end key
599 key_seol kEOL *8 shifted clear-to-
600 end-of-line key
601 key_sexit kEXT *9 shifted exit key
602 key_sf kind kF scroll-forward key
603
604 key_sfind kFND *0 shifted find key
605 key_shelp kHLP #1 shifted help key
606 key_shome kHOM #2 shifted home key
607 key_sic kIC #3 shifted insert-char‐
608 acter key
609 key_sleft kLFT #4 shifted left-arrow
610 key
611 key_smessage kMSG %a shifted message key
612 key_smove kMOV %b shifted move key
613 key_snext kNXT %c shifted next key
614 key_soptions kOPT %d shifted options key
615 key_sprevious kPRV %e shifted previous key
616 key_sprint kPRT %f shifted print key
617 key_sr kri kR scroll-backward key
618 key_sredo kRDO %g shifted redo key
619 key_sreplace kRPL %h shifted replace key
620 key_sright kRIT %i shifted right-arrow
621 key
622 key_srsume kRES %j shifted resume key
623 key_ssave kSAV !1 shifted save key
624 key_ssuspend kSPD !2 shifted suspend key
625 key_stab khts kT set-tab key
626 key_sundo kUND !3 shifted undo key
627 key_suspend kspd &7 suspend key
628 key_undo kund &8 undo key
629 key_up kcuu1 ku up-arrow key
630 keypad_local rmkx ke leave 'key‐
631 board_transmit' mode
632 keypad_xmit smkx ks enter 'key‐
633 board_transmit' mode
634 lab_f0 lf0 l0 label on function
635 key f0 if not f0
636 lab_f1 lf1 l1 label on function
637 key f1 if not f1
638 lab_f10 lf10 la label on function
639 key f10 if not f10
640 lab_f2 lf2 l2 label on function
641 key f2 if not f2
642 lab_f3 lf3 l3 label on function
643 key f3 if not f3
644 lab_f4 lf4 l4 label on function
645 key f4 if not f4
646 lab_f5 lf5 l5 label on function
647 key f5 if not f5
648 lab_f6 lf6 l6 label on function
649 key f6 if not f6
650 lab_f7 lf7 l7 label on function
651 key f7 if not f7
652 lab_f8 lf8 l8 label on function
653 key f8 if not f8
654 lab_f9 lf9 l9 label on function
655 key f9 if not f9
656 label_format fln Lf label format
657 label_off rmln LF turn off soft labels
658 label_on smln LO turn on soft labels
659 meta_off rmm mo turn off meta mode
660 meta_on smm mm turn on meta mode
661 (8th-bit on)
662 micro_column_address mhpa ZY Like column_address
663 in micro mode
664 micro_down mcud1 ZZ Like cursor_down in
665 micro mode
666 micro_left mcub1 Za Like cursor_left in
667 micro mode
668 micro_right mcuf1 Zb Like cursor_right in
669 micro mode
670
671 micro_row_address mvpa Zc Like row_address #1
672 in micro mode
673 micro_up mcuu1 Zd Like cursor_up in
674 micro mode
675 newline nel nw newline (behave like
676 cr followed by lf)
677 order_of_pins porder Ze Match software bits
678 to print-head pins
679 orig_colors oc oc Set all color pairs
680 to the original ones
681 orig_pair op op Set default pair to
682 its original value
683 pad_char pad pc padding char
684 (instead of null)
685 parm_dch dch DC delete #1 characters
686 (P*)
687 parm_delete_line dl DL delete #1 lines (P*)
688 parm_down_cursor cud DO down #1 lines (P*)
689 parm_down_micro mcud Zf Like parm_down_cur‐
690 sor in micro mode
691 parm_ich ich IC insert #1 characters
692 (P*)
693 parm_index indn SF scroll forward #1
694 lines (P)
695 parm_insert_line il AL insert #1 lines (P*)
696 parm_left_cursor cub LE move #1 characters
697 to the left (P)
698 parm_left_micro mcub Zg Like parm_left_cur‐
699 sor in micro mode
700 parm_right_cursor cuf RI move #1 characters
701 to the right (P*)
702 parm_right_micro mcuf Zh Like parm_right_cur‐
703 sor in micro mode
704 parm_rindex rin SR scroll back #1 lines
705 (P)
706 parm_up_cursor cuu UP up #1 lines (P*)
707 parm_up_micro mcuu Zi Like parm_up_cursor
708 in micro mode
709 pkey_key pfkey pk program function key
710 #1 to type string #2
711 pkey_local pfloc pl program function key
712 #1 to execute string
713 #2
714 pkey_xmit pfx px program function key
715 #1 to transmit
716 string #2
717 plab_norm pln pn program label #1 to
718 show string #2
719 print_screen mc0 ps print contents of
720 screen
721 prtr_non mc5p pO turn on printer for
722 #1 bytes
723 prtr_off mc4 pf turn off printer
724 prtr_on mc5 po turn on printer
725 pulse pulse PU select pulse dialing
726 quick_dial qdial QD dial number #1 with‐
727 out checking
728 remove_clock rmclk RC remove clock
729 repeat_char rep rp repeat char #1 #2
730 times (P*)
731 req_for_input rfi RF send next input char
732 (for ptys)
733 reset_1string rs1 r1 reset string
734 reset_2string rs2 r2 reset string
735 reset_3string rs3 r3 reset string
736 reset_file rf rf name of reset file
737
738 restore_cursor rc rc restore cursor to
739 position of last
740 save_cursor
741 row_address vpa cv vertical position #1
742 absolute (P)
743 save_cursor sc sc save current cursor
744 position (P)
745 scroll_forward ind sf scroll text up (P)
746 scroll_reverse ri sr scroll text down (P)
747 select_char_set scs Zj Select character
748 set, #1
749 set_attributes sgr sa define video
750 attributes #1-#9
751 (PG9)
752 set_background setb Sb Set background color
753 #1
754 set_bottom_margin smgb Zk Set bottom margin at
755 current line
756 set_bottom_margin_parm smgbp Zl Set bottom margin at
757 line #1 or (if smgtp
758 is not given) #2
759 lines from bottom
760 set_clock sclk SC set clock, #1 hrs #2
761 mins #3 secs
762 set_color_pair scp sp Set current color
763 pair to #1
764 set_foreground setf Sf Set foreground color
765 #1
766 set_left_margin smgl ML set left soft margin
767 at current col‐
768 umn. See
769 smgl. (ML is not in
770 BSD termcap).
771 set_left_margin_parm smglp Zm Set left (right)
772 margin at column #1
773 set_right_margin smgr MR set right soft mar‐
774 gin at current col‐
775 umn
776 set_right_margin_parm smgrp Zn Set right margin at
777 column #1
778 set_tab hts st set a tab in every
779 row, current columns
780 set_top_margin smgt Zo Set top margin at
781 current line
782 set_top_margin_parm smgtp Zp Set top (bottom)
783 margin at row #1
784 set_window wind wi current window is
785 lines #1-#2 cols
786 #3-#4
787 start_bit_image sbim Zq Start printing bit
788 image graphics
789 start_char_set_def scsd Zr Start character set
790 definition #1, with
791 #2 characters in the
792 set
793 stop_bit_image rbim Zs Stop printing bit
794 image graphics
795 stop_char_set_def rcsd Zt End definition of
796 character set #1
797 subscript_characters subcs Zu List of subscript‐
798 able characters
799 superscript_characters supcs Zv List of superscript‐
800 able characters
801 tab ht ta tab to next 8-space
802 hardware tab stop
803
804
805 these_cause_cr docr Zw Printing any of
806 these characters
807 causes CR
808 to_status_line tsl ts move to status line,
809 column #1
810 tone tone TO select touch tone
811 dialing
812 underline_char uc uc underline char and
813 move past it
814 up_half_line hu hu half a line up
815 user0 u0 u0 User string #0
816 user1 u1 u1 User string #1
817 user2 u2 u2 User string #2
818 user3 u3 u3 User string #3
819 user4 u4 u4 User string #4
820 user5 u5 u5 User string #5
821 user6 u6 u6 User string #6
822 user7 u7 u7 User string #7
823 user8 u8 u8 User string #8
824 user9 u9 u9 User string #9
825 wait_tone wait WA wait for dial-tone
826 xoff_character xoffc XF XOFF character
827 xon_character xonc XN XON character
828 zero_motion zerom Zx No motion for subse‐
829 quent character
830
831 The following string capabilities are present in the SVr4.0 term struc‐
832 ture, but were originally not documented in the man page.
833
834
835 Variable Cap- TCap Description
836 String name Code
837 alt_scancode_esc scesa S8 Alternate escape
838 for scancode emu‐
839 lation
840 bit_image_carriage_return bicr Yv Move to beginning
841 of same row
842 bit_image_newline binel Zz Move to next row
843 of the bit image
844 bit_image_repeat birep Xy Repeat bit image
845 cell #1 #2 times
846 char_set_names csnm Zy Produce #1'th item
847 from list of char‐
848 acter set names
849 code_set_init csin ci Init sequence for
850 multiple codesets
851 color_names colornm Yw Give name for
852 color #1
853 define_bit_image_region defbi Yx Define rectan‐
854 gualar bit image
855 region
856 device_type devt dv Indicate lan‐
857 guage/codeset sup‐
858 port
859 display_pc_char dispc S1 Display PC charac‐
860 ter #1
861 end_bit_image_region endbi Yy End a bit-image
862 region
863 enter_pc_charset_mode smpch S2 Enter PC character
864 display mode
865 enter_scancode_mode smsc S4 Enter PC scancode
866 mode
867 exit_pc_charset_mode rmpch S3 Exit PC character
868 display mode
869 exit_scancode_mode rmsc S5 Exit PC scancode
870 mode
871
872 get_mouse getm Gm Curses should get
873 button events,
874 parameter #1 not
875 documented.
876 key_mouse kmous Km Mouse event has
877 occurred
878 mouse_info minfo Mi Mouse status
879 information
880 pc_term_options pctrm S6 PC terminal
881 options
882 pkey_plab pfxl xl Program function
883 key #1 to type
884 string #2 and show
885 string #3
886 req_mouse_pos reqmp RQ Request mouse
887 position
888 scancode_escape scesc S7 Escape for scan‐
889 code emulation
890 set0_des_seq s0ds s0 Shift to codeset 0
891 (EUC set 0, ASCII)
892 set1_des_seq s1ds s1 Shift to codeset 1
893 set2_des_seq s2ds s2 Shift to codeset 2
894 set3_des_seq s3ds s3 Shift to codeset 3
895 set_a_background setab AB Set background
896 color to #1, using
897 ANSI escape
898 set_a_foreground setaf AF Set foreground
899 color to #1, using
900 ANSI escape
901 set_color_band setcolor Yz Change to ribbon
902 color #1
903 set_lr_margin smglr ML Set both left and
904 right margins to
905 #1, #2. (ML is
906 not in BSD term‐
907 cap).
908 set_page_length slines YZ Set page length to
909 #1 lines
910 set_tb_margin smgtb MT Sets both top and
911 bottom margins to
912 #1, #2
913
914 The XSI Curses standard added these. They are some post-4.1 versions
915 of System V curses, e.g., Solaris 2.5 and IRIX 6.x. The ncurses term‐
916 cap names for them are invented; according to the XSI Curses standard,
917 they have no termcap names. If your compiled terminfo entries use
918 these, they may not be binary-compatible with System V terminfo
919 entries after SVr4.1; beware!
920
921
922 Variable Cap- TCap Description
923 String name Code
924 enter_horizontal_hl_mode ehhlm Xh Enter horizontal
925 highlight mode
926 enter_left_hl_mode elhlm Xl Enter left highlight
927 mode
928 enter_low_hl_mode elohlm Xo Enter low highlight
929 mode
930 enter_right_hl_mode erhlm Xr Enter right high‐
931 light mode
932 enter_top_hl_mode ethlm Xt Enter top highlight
933 mode
934 enter_vertical_hl_mode evhlm Xv Enter vertical high‐
935 light mode
936
937
938
939 set_a_attributes sgr1 sA Define second set of
940 video attributes
941 #1-#6
942 set_pglen_inch slength sL YI Set page length
943 to #1 hundredth of
944 an inch
945
946 A Sample Entry
947 The following entry, describing an ANSI-standard terminal, is represen‐
948 tative of what a terminfo entry for a modern terminal typically looks
949 like.
950
951 ansi|ansi/pc-term compatible with color,
952 mc5i,
953 colors#8, ncv#3, pairs#64,
954 cub=\E[%p1%dD, cud=\E[%p1%dB, cuf=\E[%p1%dC,
955 cuu=\E[%p1%dA, dch=\E[%p1%dP, dl=\E[%p1%dM,
956 ech=\E[%p1%dX, el1=\E[1K, hpa=\E[%p1%dG, ht=\E[I,
957 ich=\E[%p1%d@, il=\E[%p1%dL, indn=\E[%p1%dS, .indn=\E[%p1%dT,
958 kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B,
959 kcuf1=\E[C, kcuu1=\E[A, kf1=\E[M, kf10=\E[V,
960 kf11=\E[W, kf12=\E[X, kf2=\E[N, kf3=\E[O, kf4=\E[P,
961 kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U,
962 kich1=\E[L, mc4=\E[4i, mc5=\E[5i, nel=\r\E[S,
963 op=\E[37;40m, rep=%p1%c\E[%p2%{1}%-%db,
964 rin=\E[%p1%dT, s0ds=\E(B, s1ds=\E)B, s2ds=\E*B,
965 s3ds=\E+B, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
966 setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
967 setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
968 sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m,
969 sgr0=\E[0;10m, tbc=\E[2g, u6=\E[%d;%dR, u7=\E[6n,
970 u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%p1%dd,
971
972 Entries may continue onto multiple lines by placing white space at the
973 beginning of each line except the first. Comments may be included on
974 lines beginning with ``#''. Capabilities in terminfo are of three
975 types: Boolean capabilities which indicate that the terminal has some
976 particular feature, numeric capabilities giving the size of the termi‐
977 nal or the size of particular delays, and string capabilities, which
978 give a sequence which can be used to perform particular terminal opera‐
979 tions.
980
981 Types of Capabilities
982 All capabilities have names. For instance, the fact that ANSI-standard
983 terminals have automatic margins (i.e., an automatic return and line-
984 feed when the end of a line is reached) is indicated by the capability
985 am. Hence the description of ansi includes am. Numeric capabilities
986 are followed by the character `#' and then a positive value. Thus
987 cols, which indicates the number of columns the terminal has, gives the
988 value `80' for ansi. Values for numeric capabilities may be specified
989 in decimal, octal or hexadecimal, using the C programming language con‐
990 ventions (e.g., 255, 0377 and 0xff or 0xFF).
991
992 Finally, string valued capabilities, such as el (clear to end of line
993 sequence) are given by the two-character code, an `=', and then a
994 string ending at the next following `,'.
995
996 A number of escape sequences are provided in the string valued capabil‐
997 ities for easy encoding of characters there. Both \E and \e map to an
998 ESCAPE character, ^x maps to a control-x for any appropriate x, and the
999 sequences \n \l \r \t \b \f \s give a newline, line-feed, return, tab,
1000 backspace, form-feed, and space. Other escapes include \^ for ^, \\
1001 for \, \, for comma, \: for :, and \0 for null. (\0 will produce \200,
1002 which does not terminate a string but behaves as a null character on
1003 most terminals, providing CS7 is specified. See stty(1).) Finally,
1004 characters may be given as three octal digits after a \.
1005
1006 A delay in milliseconds may appear anywhere in a string capability,
1007 enclosed in $<..> brackets, as in el=\EK$<5>, and padding characters
1008 are supplied by tputs to provide this delay. The delay must be a num‐
1009 ber with at most one decimal place of precision; it may be followed by
1010 suffixes `*' or '/' or both. A `*' indicates that the padding required
1011 is proportional to the number of lines affected by the operation, and
1012 the amount given is the per-affected-unit padding required. (In the
1013 case of insert character, the factor is still the number of lines
1014 affected.) Normally, padding is advisory if the device has the xon
1015 capability; it is used for cost computation but does not trigger
1016 delays. A `/' suffix indicates that the padding is mandatory and
1017 forces a delay of the given number of milliseconds even on devices for
1018 which xon is present to indicate flow control.
1019
1020 Sometimes individual capabilities must be commented out. To do this,
1021 put a period before the capability name. For example, see the second
1022 ind in the example above.
1023
1024 Fetching Compiled Descriptions
1025 If the environment variable TERMINFO is set, it is interpreted as the
1026 pathname of a directory containing the compiled description you are
1027 working on. Only that directory is searched.
1028
1029 If TERMINFO is not set, the ncurses version of the terminfo reader code
1030 will instead look in the directory $HOME/.terminfo for a compiled
1031 description. If it fails to find one there, and the environment vari‐
1032 able TERMINFO_DIRS is set, it will interpret the contents of that vari‐
1033 able as a list of colon- separated directories to be searched (an empty
1034 entry is interpreted as a command to search /usr/share/terminfo). If
1035 no description is found in any of the TERMINFO_DIRS directories, the
1036 fetch fails.
1037
1038 If neither TERMINFO nor TERMINFO_DIRS is set, the last place tried will
1039 be the system terminfo directory, /usr/share/terminfo.
1040
1041 (Neither the $HOME/.terminfo lookups nor TERMINFO_DIRS extensions are
1042 supported under stock System V terminfo/curses.)
1043
1044 Preparing Descriptions
1045 We now outline how to prepare descriptions of terminals. The most
1046 effective way to prepare a terminal description is by imitating the
1047 description of a similar terminal in terminfo and to build up a
1048 description gradually, using partial descriptions with vi or some other
1049 screen-oriented program to check that they are correct. Be aware that
1050 a very unusual terminal may expose deficiencies in the ability of the
1051 terminfo file to describe it or bugs in the screen-handling code of the
1052 test program.
1053
1054 To get the padding for insert line right (if the terminal manufacturer
1055 did not document it) a severe test is to edit a large file at 9600
1056 baud, delete 16 or so lines from the middle of the screen, then hit the
1057 `u' key several times quickly. If the terminal messes up, more padding
1058 is usually needed. A similar test can be used for insert character.
1059
1060 Basic Capabilities
1061 The number of columns on each line for the terminal is given by the
1062 cols numeric capability. If the terminal is a CRT, then the number of
1063 lines on the screen is given by the lines capability. If the terminal
1064 wraps around to the beginning of the next line when it reaches the
1065 right margin, then it should have the am capability. If the terminal
1066 can clear its screen, leaving the cursor in the home position, then
1067 this is given by the clear string capability. If the terminal over‐
1068 strikes (rather than clearing a position when a character is struck
1069 over) then it should have the os capability. If the terminal is a
1070 printing terminal, with no soft copy unit, give it both hc and os. (os
1071 applies to storage scope terminals, such as TEKTRONIX 4010 series, as
1072 well as hard copy and APL terminals.) If there is a code to move the
1073 cursor to the left edge of the current row, give this as cr. (Normally
1074 this will be carriage return, control M.) If there is a code to pro‐
1075 duce an audible signal (bell, beep, etc) give this as bel.
1076
1077 If there is a code to move the cursor one position to the left (such as
1078 backspace) that capability should be given as cub1. Similarly, codes
1079 to move to the right, up, and down should be given as cuf1, cuu1, and
1080 cud1. These local cursor motions should not alter the text they pass
1081 over, for example, you would not normally use `cuf1= ' because the
1082 space would erase the character moved over.
1083
1084 A very important point here is that the local cursor motions encoded in
1085 terminfo are undefined at the left and top edges of a CRT terminal.
1086 Programs should never attempt to backspace around the left edge, unless
1087 bw is given, and never attempt to go up locally off the top. In order
1088 to scroll text up, a program will go to the bottom left corner of the
1089 screen and send the ind (index) string.
1090
1091 To scroll text down, a program goes to the top left corner of the
1092 screen and sends the ri (reverse index) string. The strings ind and ri
1093 are undefined when not on their respective corners of the screen.
1094
1095 Parameterized versions of the scrolling sequences are indn and rin
1096 which have the same semantics as ind and ri except that they take one
1097 parameter, and scroll that many lines. They are also undefined except
1098 at the appropriate edge of the screen.
1099
1100 The am capability tells whether the cursor sticks at the right edge of
1101 the screen when text is output, but this does not necessarily apply to
1102 a cuf1 from the last column. The only local motion which is defined
1103 from the left edge is if bw is given, then a cub1 from the left edge
1104 will move to the right edge of the previous row. If bw is not given,
1105 the effect is undefined. This is useful for drawing a box around the
1106 edge of the screen, for example. If the terminal has switch selectable
1107 automatic margins, the terminfo file usually assumes that this is on;
1108 i.e., am. If the terminal has a command which moves to the first col‐
1109 umn of the next line, that command can be given as nel (newline). It
1110 does not matter if the command clears the remainder of the current
1111 line, so if the terminal has no cr and lf it may still be possible to
1112 craft a working nel out of one or both of them.
1113
1114 These capabilities suffice to describe hard-copy and “glass-tty” termi‐
1115 nals. Thus the model 33 teletype is described as
1116
1117 33|tty33|tty|model 33 teletype,
1118 bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,
1119
1120 while the Lear Siegler ADM-3 is described as
1121
1122 adm3|3|lsi adm3,
1123 am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
1124 ind=^J, lines#24,
1125
1126 Parameterized Strings
1127 Cursor addressing and other strings requiring parameters in the termi‐
1128 nal are described by a parameterized string capability, with printf(3)
1129 like escapes %x in it. For example, to address the cursor, the cup
1130 capability is given, using two parameters: the row and column to
1131 address to. (Rows and columns are numbered from zero and refer to the
1132 physical screen visible to the user, not to any unseen memory.) If the
1133 terminal has memory relative cursor addressing, that can be indicated
1134 by mrcup.
1135
1136 The parameter mechanism uses a stack and special % codes to manipulate
1137 it. Typically a sequence will push one of the parameters onto the
1138 stack and then print it in some format. Print (e.g., "%d") is a spe‐
1139 cial case. Other operations, including "%t" pop their operand from the
1140 stack. It is noted that more complex operations are often necessary,
1141 e.g., in the sgr string.
1142
1143 The % encodings have the following meanings:
1144
1145 %% outputs `%'
1146
1147 %[[:]flags][width[.precision]][doxXs]
1148 as in printf, flags are [-+#] and space
1149
1150 %c print pop() like %c in printf
1151
1152 %s print pop() like %s in printf
1153
1154 %p[1-9]
1155 push i'th parameter
1156
1157 %P[a-z]
1158 set dynamic variable [a-z] to pop()
1159
1160 %g[a-z]
1161 get dynamic variable [a-z] and push it
1162
1163 %P[A-Z]
1164 set static variable [a-z] to pop()
1165
1166 %g[A-Z]
1167 get static variable [a-z] and push it
1168
1169 The terms "static" and "dynamic" are misleading. Historically,
1170 these are simply two different sets of variables, whose values are
1171 not reset between calls to tparm. However, that fact is not docu‐
1172 mented in other implementations. Relying on it will adversely
1173 impact portability to other implementations.
1174
1175 %'c' char constant c
1176
1177 %{nn}
1178 integer constant nn
1179
1180 %l push strlen(pop)
1181
1182 %+ %- %* %/ %m
1183 arithmetic (%m is mod): push(pop() op pop())
1184
1185 %& %| %^
1186 bit operations (AND, OR and exclusive-OR): push(pop() op pop())
1187
1188 %= %> %<
1189 logical operations: push(pop() op pop())
1190
1191 %A, %O
1192 logical AND and OR operations (for conditionals)
1193
1194 %! %~
1195 unary operations (logical and bit complement): push(op pop())
1196
1197 %i add 1 to first two parameters (for ANSI terminals)
1198
1199 %? expr %t thenpart %e elsepart %;
1200 This forms an if-then-else. The %e elsepart is optional. Usually
1201 the %? expr part pushes a value onto the stack, and %t pops it
1202 from the stack, testing if it is nonzero (true). If it is zero
1203 (false), control passes to the %e (else) part.
1204
1205 It is possible to form else-if's a la Algol 68:
1206 %? c1 %t b1 %e c2 %t b2 %e c3 %t b3 %e c4 %t b4 %e %;
1207
1208 where ci are conditions, bi are bodies.
1209
1210 Use the -f option of tic or infocmp to see the structure of if-
1211 the-else's. Some strings, e.g., sgr can be very complicated when
1212 written on one line. The -f option splits the string into lines
1213 with the parts indented.
1214
1215 Binary operations are in postfix form with the operands in the usual
1216 order. That is, to get x-5 one would use "%gx%{5}%-". %P and %g vari‐
1217 ables are persistent across escape-string evaluations.
1218
1219 Consider the HP2645, which, to get to row 3 and column 12, needs to be
1220 sent \E&a12c03Y padded for 6 milliseconds. Note that the order of the
1221 rows and columns is inverted here, and that the row and column are
1222 printed as two digits. Thus its cup capability is
1223 “cup=6\E&%p2%2dc%p1%2dY”.
1224
1225 The Microterm ACT-IV needs the current row and column sent preceded by
1226 a ^T, with the row and column simply encoded in binary,
1227 “cup=^T%p1%c%p2%c”. Terminals which use “%c” need to be able to
1228 backspace the cursor (cub1), and to move the cursor up one line on the
1229 screen (cuu1). This is necessary because it is not always safe to
1230 transmit \n ^D and \r, as the system may change or discard them. (The
1231 library routines dealing with terminfo set tty modes so that tabs are
1232 never expanded, so \t is safe to send. This turns out to be essential
1233 for the Ann Arbor 4080.)
1234
1235 A final example is the LSI ADM-3a, which uses row and column offset by
1236 a blank character, thus “cup=\E=%p1%' '%+%c%p2%' '%+%c”. After sending
1237 `\E=', this pushes the first parameter, pushes the ASCII value for a
1238 space (32), adds them (pushing the sum on the stack in place of the two
1239 previous values) and outputs that value as a character. Then the same
1240 is done for the second parameter. More complex arithmetic is possible
1241 using the stack.
1242
1243 Cursor Motions
1244 If the terminal has a fast way to home the cursor (to very upper left
1245 corner of screen) then this can be given as home; similarly a fast way
1246 of getting to the lower left-hand corner can be given as ll; this may
1247 involve going up with cuu1 from the home position, but a program should
1248 never do this itself (unless ll does) because it can make no assumption
1249 about the effect of moving up from the home position. Note that the
1250 home position is the same as addressing to (0,0): to the top left cor‐
1251 ner of the screen, not of memory. (Thus, the \EH sequence on HP termi‐
1252 nals cannot be used for home.)
1253
1254 If the terminal has row or column absolute cursor addressing, these can
1255 be given as single parameter capabilities hpa (horizontal position
1256 absolute) and vpa (vertical position absolute). Sometimes these are
1257 shorter than the more general two parameter sequence (as with the
1258 hp2645) and can be used in preference to cup. If there are parameter‐
1259 ized local motions (e.g., move n spaces to the right) these can be
1260 given as cud, cub, cuf, and cuu with a single parameter indicating how
1261 many spaces to move. These are primarily useful if the terminal does
1262 not have cup, such as the TEKTRONIX 4025.
1263
1264 If the terminal needs to be in a special mode when running a program
1265 that uses these capabilities, the codes to enter and exit this mode can
1266 be given as smcup and rmcup. This arises, for example, from terminals
1267 like the Concept with more than one page of memory. If the terminal
1268 has only memory relative cursor addressing and not screen relative cur‐
1269 sor addressing, a one screen-sized window must be fixed into the termi‐
1270 nal for cursor addressing to work properly. This is also used for the
1271 TEKTRONIX 4025, where smcup sets the command character to be the one
1272 used by terminfo. If the smcup sequence will not restore the screen
1273 after an rmcup sequence is output (to the state prior to outputting
1274 rmcup), specify nrrmc.
1275
1276 Area Clears
1277 If the terminal can clear from the current position to the end of the
1278 line, leaving the cursor where it is, this should be given as el. If
1279 the terminal can clear from the beginning of the line to the current
1280 position inclusive, leaving the cursor where it is, this should be
1281 given as el1. If the terminal can clear from the current position to
1282 the end of the display, then this should be given as ed. Ed is only
1283 defined from the first column of a line. (Thus, it can be simulated by
1284 a request to delete a large number of lines, if a true ed is not avail‐
1285 able.)
1286
1287 Insert/delete line and vertical motions
1288 If the terminal can open a new blank line before the line where the
1289 cursor is, this should be given as il1; this is done only from the
1290 first position of a line. The cursor must then appear on the newly
1291 blank line. If the terminal can delete the line which the cursor is
1292 on, then this should be given as dl1; this is done only from the first
1293 position on the line to be deleted. Versions of il1 and dl1 which take
1294 a single parameter and insert or delete that many lines can be given as
1295 il and dl.
1296
1297 If the terminal has a settable scrolling region (like the vt100) the
1298 command to set this can be described with the csr capability, which
1299 takes two parameters: the top and bottom lines of the scrolling region.
1300 The cursor position is, alas, undefined after using this command.
1301
1302 It is possible to get the effect of insert or delete line using csr on
1303 a properly chosen region; the sc and rc (save and restore cursor) com‐
1304 mands may be useful for ensuring that your synthesized insert/delete
1305 string does not move the cursor. (Note that the ncurses(3X) library
1306 does this synthesis automatically, so you need not compose
1307 insert/delete strings for an entry with csr).
1308
1309 Yet another way to construct insert and delete might be to use a combi‐
1310 nation of index with the memory-lock feature found on some terminals
1311 (like the HP-700/90 series, which however also has insert/delete).
1312
1313 Inserting lines at the top or bottom of the screen can also be done
1314 using ri or ind on many terminals without a true insert/delete line,
1315 and is often faster even on terminals with those features.
1316
1317 The boolean non_dest_scroll_region should be set if each scrolling win‐
1318 dow is effectively a view port on a screen-sized canvas. To test for
1319 this capability, create a scrolling region in the middle of the screen,
1320 write something to the bottom line, move the cursor to the top of the
1321 region, and do ri followed by dl1 or ind. If the data scrolled off the
1322 bottom of the region by the ri re-appears, then scrolling is non-
1323 destructive. System V and XSI Curses expect that ind, ri, indn, and
1324 rin will simulate destructive scrolling; their documentation cautions
1325 you not to define csr unless this is true. This curses implementation
1326 is more liberal and will do explicit erases after scrolling if ndstr is
1327 defined.
1328
1329 If the terminal has the ability to define a window as part of memory,
1330 which all commands affect, it should be given as the parameterized
1331 string wind. The four parameters are the starting and ending lines in
1332 memory and the starting and ending columns in memory, in that order.
1333
1334 If the terminal can retain display memory above, then the da capability
1335 should be given; if display memory can be retained below, then db
1336 should be given. These indicate that deleting a line or scrolling may
1337 bring non-blank lines up from below or that scrolling back with ri may
1338 bring down non-blank lines.
1339
1340 Insert/Delete Character
1341 There are two basic kinds of intelligent terminals with respect to
1342 insert/delete character which can be described using terminfo. The
1343 most common insert/delete character operations affect only the charac‐
1344 ters on the current line and shift characters off the end of the line
1345 rigidly. Other terminals, such as the Concept 100 and the Perkin Elmer
1346 Owl, make a distinction between typed and untyped blanks on the screen,
1347 shifting upon an insert or delete only to an untyped blank on the
1348 screen which is either eliminated, or expanded to two untyped blanks.
1349 You can determine the kind of terminal you have by clearing the screen
1350 and then typing text separated by cursor motions. Type “abc def”
1351 using local cursor motions (not spaces) between the “abc” and the
1352 “def”. Then position the cursor before the “abc” and put the terminal
1353 in insert mode. If typing characters causes the rest of the line to
1354 shift rigidly and characters to fall off the end, then your terminal
1355 does not distinguish between blanks and untyped positions. If the
1356 “abc” shifts over to the “def” which then move together around the end
1357 of the current line and onto the next as you insert, you have the sec‐
1358 ond type of terminal, and should give the capability in, which stands
1359 for “insert null”. While these are two logically separate attributes
1360 (one line versus multi-line insert mode, and special treatment of
1361 untyped spaces) we have seen no terminals whose insert mode cannot be
1362 described with the single attribute.
1363
1364 Terminfo can describe both terminals which have an insert mode, and
1365 terminals which send a simple sequence to open a blank position on the
1366 current line. Give as smir the sequence to get into insert mode. Give
1367 as rmir the sequence to leave insert mode. Now give as ich1 any
1368 sequence needed to be sent just before sending the character to be
1369 inserted. Most terminals with a true insert mode will not give ich1;
1370 terminals which send a sequence to open a screen position should give
1371 it here.
1372
1373 If your terminal has both, insert mode is usually preferable to ich1.
1374 Technically, you should not give both unless the terminal actually
1375 requires both to be used in combination. Accordingly, some non-curses
1376 applications get confused if both are present; the symptom is doubled
1377 characters in an update using insert. This requirement is now rare;
1378 most ich sequences do not require previous smir, and most smir insert
1379 modes do not require ich1 before each character. Therefore, the new
1380 curses actually assumes this is the case and uses either rmir/smir or
1381 ich/ich1 as appropriate (but not both). If you have to write an entry
1382 to be used under new curses for a terminal old enough to need both,
1383 include the rmir/smir sequences in ich1.
1384
1385 If post insert padding is needed, give this as a number of milliseconds
1386 in ip (a string option). Any other sequence which may need to be sent
1387 after an insert of a single character may also be given in ip. If your
1388 terminal needs both to be placed into an `insert mode' and a special
1389 code to precede each inserted character, then both smir/rmir and ich1
1390 can be given, and both will be used. The ich capability, with one
1391 parameter, n, will repeat the effects of ich1 n times.
1392
1393 If padding is necessary between characters typed while not in insert
1394 mode, give this as a number of milliseconds padding in rmp.
1395
1396 It is occasionally necessary to move around while in insert mode to
1397 delete characters on the same line (e.g., if there is a tab after the
1398 insertion position). If your terminal allows motion while in insert
1399 mode you can give the capability mir to speed up inserting in this
1400 case. Omitting mir will affect only speed. Some terminals (notably
1401 Datamedia's) must not have mir because of the way their insert mode
1402 works.
1403
1404 Finally, you can specify dch1 to delete a single character, dch with
1405 one parameter, n, to delete n characters, and delete mode by giving
1406 smdc and rmdc to enter and exit delete mode (any mode the terminal
1407 needs to be placed in for dch1 to work).
1408
1409 A command to erase n characters (equivalent to outputting n blanks
1410 without moving the cursor) can be given as ech with one parameter.
1411
1412 Highlighting, Underlining, and Visible Bells
1413 If your terminal has one or more kinds of display attributes, these can
1414 be represented in a number of different ways. You should choose one
1415 display form as standout mode, representing a good, high contrast,
1416 easy-on-the-eyes, format for highlighting error messages and other
1417 attention getters. (If you have a choice, reverse video plus half-
1418 bright is good, or reverse video alone.) The sequences to enter and
1419 exit standout mode are given as smso and rmso, respectively. If the
1420 code to change into or out of standout mode leaves one or even two
1421 blank spaces on the screen, as the TVI 912 and Teleray 1061 do, then
1422 xmc should be given to tell how many spaces are left.
1423
1424 Codes to begin underlining and end underlining can be given as smul and
1425 rmul respectively. If the terminal has a code to underline the current
1426 character and move the cursor one space to the right, such as the
1427 Microterm Mime, this can be given as uc.
1428
1429 Other capabilities to enter various highlighting modes include blink
1430 (blinking) bold (bold or extra bright) dim (dim or half-bright) invis
1431 (blanking or invisible text) prot (protected) rev (reverse video) sgr0
1432 (turn off all attribute modes) smacs (enter alternate character set
1433 mode) and rmacs (exit alternate character set mode). Turning on any of
1434 these modes singly may or may not turn off other modes.
1435
1436 If there is a sequence to set arbitrary combinations of modes, this
1437 should be given as sgr (set attributes), taking 9 parameters. Each
1438 parameter is either 0 or nonzero, as the corresponding attribute is on
1439 or off. The 9 parameters are, in order: standout, underline, reverse,
1440 blink, dim, bold, blank, protect, alternate character set. Not all
1441 modes need be supported by sgr, only those for which corresponding sep‐
1442 arate attribute commands exist.
1443
1444 For example, the DEC vt220 supports most of the modes:
1445
1446 tparm parameter attribute escape sequence
1447
1448 none none \E[0m
1449 p1 standout \E[0;1;7m
1450 p2 underline \E[0;4m
1451 p3 reverse \E[0;7m
1452 p4 blink \E[0;5m
1453 p5 dim not available
1454 p6 bold \E[0;1m
1455 p7 invis \E[0;8m
1456 p8 protect not used
1457 p9 altcharset ^O (off) ^N (on)
1458
1459 We begin each escape sequence by turning off any existing modes, since
1460 there is no quick way to determine whether they are active. Standout
1461 is set up to be the combination of reverse and bold. The vt220 termi‐
1462 nal has a protect mode, though it is not commonly used in sgr because
1463 it protects characters on the screen from the host's erasures. The
1464 altcharset mode also is different in that it is either ^O or ^N,
1465 depending on whether it is off or on. If all modes are turned on, the
1466 resulting sequence is \E[0;1;4;5;7;8m^N.
1467
1468 Some sequences are common to different modes. For example, ;7 is out‐
1469 put when either p1 or p3 is true, that is, if either standout or
1470 reverse modes are turned on.
1471
1472 Writing out the above sequences, along with their dependencies yields
1473
1475
1476\E[0 always \E[0
1477;1 if p1 or p6 %?%p1%p6%|%t;1%;
1478;4 if p2 %?%p2%|%t;4%;
1479;5 if p4 %?%p4%|%t;5%;
1480
1481;7 if p1 or p3 %?%p1%p3%|%t;7%;
1482;8 if p7 %?%p7%|%t;8%;
1483m always m
1484^N or ^O if p9 ^N, else ^O %?%p9%t^N%e^O%;
1485
1486 Putting this all together into the sgr sequence gives:
1487
1488 sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;
1489 %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
1490
1491 Remember that if you specify sgr, you must also specify sgr0. Also,
1492 some implementations rely on sgr being given if sgr0 is, Not all ter‐
1493 minfo entries necessarily have an sgr string, however. Many terminfo
1494 entries are derived from termcap entries which have no sgr string. The
1495 only drawback to adding an sgr string is that termcap also assumes that
1496 sgr0 does not exit alternate character set mode.
1497
1498 Terminals with the ``magic cookie'' glitch (xmc) deposit special
1499 ``cookies'' when they receive mode-setting sequences, which affect the
1500 display algorithm rather than having extra bits for each character.
1501 Some terminals, such as the HP 2621, automatically leave standout mode
1502 when they move to a new line or the cursor is addressed. Programs
1503 using standout mode should exit standout mode before moving the cursor
1504 or sending a newline, unless the msgr capability, asserting that it is
1505 safe to move in standout mode, is present.
1506
1507 If the terminal has a way of flashing the screen to indicate an error
1508 quietly (a bell replacement) then this can be given as flash; it must
1509 not move the cursor.
1510
1511 If the cursor needs to be made more visible than normal when it is not
1512 on the bottom line (to make, for example, a non-blinking underline into
1513 an easier to find block or blinking underline) give this sequence as
1514 cvvis. If there is a way to make the cursor completely invisible, give
1515 that as civis. The capability cnorm should be given which undoes the
1516 effects of both of these modes.
1517
1518 If your terminal correctly generates underlined characters (with no
1519 special codes needed) even though it does not overstrike, then you
1520 should give the capability ul. If a character overstriking another
1521 leaves both characters on the screen, specify the capability os. If
1522 overstrikes are erasable with a blank, then this should be indicated by
1523 giving eo.
1524
1525 Keypad and Function Keys
1526 If the terminal has a keypad that transmits codes when the keys are
1527 pressed, this information can be given. Note that it is not possible
1528 to handle terminals where the keypad only works in local (this applies,
1529 for example, to the unshifted HP 2621 keys). If the keypad can be set
1530 to transmit or not transmit, give these codes as smkx and rmkx. Other‐
1531 wise the keypad is assumed to always transmit. The codes sent by the
1532 left arrow, right arrow, up arrow, down arrow, and home keys can be
1533 given as kcub1, kcuf1, kcuu1, kcud1, and khome respectively. If there
1534 are function keys such as f0, f1, ..., f10, the codes they send can be
1535 given as kf0, kf1, ..., kf10. If these keys have labels other than the
1536 default f0 through f10, the labels can be given as lf0, lf1, ..., lf10.
1537 The codes transmitted by certain other special keys can be given: kll
1538 (home down), kbs (backspace), ktbc (clear all tabs), kctab (clear the
1539 tab stop in this column), kclr (clear screen or erase key), kdch1
1540 (delete character), kdl1 (delete line), krmir (exit insert mode), kel
1541 (clear to end of line), ked (clear to end of screen), kich1 (insert
1542 character or enter insert mode), kil1 (insert line), knp (next page),
1543 kpp (previous page), kind (scroll forward/down), kri (scroll back‐
1544 ward/up), khts (set a tab stop in this column). In addition, if the
1545 keypad has a 3 by 3 array of keys including the four arrow keys, the
1546 other five keys can be given as ka1, ka3, kb2, kc1, and kc3. These
1547 keys are useful when the effects of a 3 by 3 directional pad are
1548 needed.
1549
1550 Strings to program function keys can be given as pfkey, pfloc, and pfx.
1551 A string to program screen labels should be specified as pln. Each of
1552 these strings takes two parameters: the function key number to program
1553 (from 0 to 10) and the string to program it with. Function key numbers
1554 out of this range may program undefined keys in a terminal dependent
1555 manner. The difference between the capabilities is that pfkey causes
1556 pressing the given key to be the same as the user typing the given
1557 string; pfloc causes the string to be executed by the terminal in
1558 local; and pfx causes the string to be transmitted to the computer.
1559
1560 The capabilities nlab, lw and lh define the number of programmable
1561 screen labels and their width and height. If there are commands to
1562 turn the labels on and off, give them in smln and rmln. smln is nor‐
1563 mally output after one or more pln sequences to make sure that the
1564 change becomes visible.
1565
1566 Tabs and Initialization
1567 If the terminal has hardware tabs, the command to advance to the next
1568 tab stop can be given as ht (usually control I). A ``back-tab'' com‐
1569 mand which moves leftward to the preceding tab stop can be given as
1570 cbt. By convention, if the teletype modes indicate that tabs are being
1571 expanded by the computer rather than being sent to the terminal, pro‐
1572 grams should not use ht or cbt even if they are present, since the user
1573 may not have the tab stops properly set. If the terminal has hardware
1574 tabs which are initially set every n spaces when the terminal is pow‐
1575 ered up, the numeric parameter it is given, showing the number of spa‐
1576 ces the tabs are set to. This is normally used by the tset command to
1577 determine whether to set the mode for hardware tab expansion, and
1578 whether to set the tab stops. If the terminal has tab stops that can
1579 be saved in non-volatile memory, the terminfo description can assume
1580 that they are properly set.
1581
1582 Other capabilities include is1, is2, and is3, initialization strings
1583 for the terminal, iprog, the path name of a program to be run to ini‐
1584 tialize the terminal, and if, the name of a file containing long ini‐
1585 tialization strings. These strings are expected to set the terminal
1586 into modes consistent with the rest of the terminfo description. They
1587 are normally sent to the terminal, by the init option of the tput pro‐
1588 gram, each time the user logs in. They will be printed in the follow‐
1589 ing order:
1590
1591 run the program
1592 iprog
1593
1594 output is1 is2
1595
1596 set the margins using
1597 mgc, smgl and smgr
1598
1599 set tabs using
1600 tbc and hts
1601
1602 print the file
1603 if
1604
1605 and finally
1606 output is3.
1607
1608 Most initialization is done with is2. Special terminal modes can be
1609 set up without duplicating strings by putting the common sequences in
1610 is2 and special cases in is1 and is3.
1611
1612 A set of sequences that does a harder reset from a totally unknown
1613 state can be given as rs1, rs2, rf and rs3, analogous to is1 , is2 , if
1614 and is3 respectively. These strings are output by the reset program,
1615 which is used when the terminal gets into a wedged state. Commands are
1616 normally placed in rs1, rs2 rs3 and rf only if they produce annoying
1617 effects on the screen and are not necessary when logging in. For exam‐
1618 ple, the command to set the vt100 into 80-column mode would normally be
1619 part of is2, but it causes an annoying glitch of the screen and is not
1620 normally needed since the terminal is usually already in 80 column
1621 mode.
1622
1623 The reset program writes strings including iprog, etc., in the same
1624 order as the init program, using rs1, etc., instead of is1, etc. If
1625 any of rs1, rs2, rs3, or rf reset capability strings are missing, the
1626 reset program falls back upon the corresponding initialization capabil‐
1627 ity string.
1628
1629 If there are commands to set and clear tab stops, they can be given as
1630 tbc (clear all tab stops) and hts (set a tab stop in the current column
1631 of every row). If a more complex sequence is needed to set the tabs
1632 than can be described by this, the sequence can be placed in is2 or if.
1633
1634 Delays and Padding
1635 Many older and slower terminals do not support either XON/XOFF or DTR
1636 handshaking, including hard copy terminals and some very archaic CRTs
1637 (including, for example, DEC VT100s). These may require padding char‐
1638 acters after certain cursor motions and screen changes.
1639
1640 If the terminal uses xon/xoff handshaking for flow control (that is, it
1641 automatically emits ^S back to the host when its input buffers are
1642 close to full), set xon. This capability suppresses the emission of
1643 padding. You can also set it for memory-mapped console devices effec‐
1644 tively that do not have a speed limit. Padding information should
1645 still be included so that routines can make better decisions about rel‐
1646 ative costs, but actual pad characters will not be transmitted.
1647
1648 If pb (padding baud rate) is given, padding is suppressed at baud rates
1649 below the value of pb. If the entry has no padding baud rate, then
1650 whether padding is emitted or not is completely controlled by xon.
1651
1652 If the terminal requires other than a null (zero) character as a pad,
1653 then this can be given as pad. Only the first character of the pad
1654 string is used.
1655
1656 Status Lines
1657 Some terminals have an extra `status line' which is not normally used
1658 by software (and thus not counted in the terminal's lines capability).
1659
1660 The simplest case is a status line which is cursor-addressable but not
1661 part of the main scrolling region on the screen; the Heathkit H19 has a
1662 status line of this kind, as would a 24-line VT100 with a 23-line
1663 scrolling region set up on initialization. This situation is indicated
1664 by the hs capability.
1665
1666 Some terminals with status lines need special sequences to access the
1667 status line. These may be expressed as a string with single parameter
1668 tsl which takes the cursor to a given zero-origin column on the status
1669 line. The capability fsl must return to the main-screen cursor posi‐
1670 tions before the last tsl. You may need to embed the string values of
1671 sc (save cursor) and rc (restore cursor) in tsl and fsl to accomplish
1672 this.
1673
1674 The status line is normally assumed to be the same width as the width
1675 of the terminal. If this is untrue, you can specify it with the
1676 numeric capability wsl.
1677
1678 A command to erase or blank the status line may be specified as dsl.
1679
1680 The boolean capability eslok specifies that escape sequences, tabs,
1681 etc., work ordinarily in the status line.
1682
1683 The ncurses implementation does not yet use any of these capabilities.
1684 They are documented here in case they ever become important.
1685
1686 Line Graphics
1687 Many terminals have alternate character sets useful for forms-drawing.
1688 Terminfo and curses build in support for the drawing characters sup‐
1689 ported by the VT100, with some characters from the AT&T 4410v1 added.
1690 This alternate character set may be specified by the acsc capability.
1691
1692 Glyph ACS Ascii VT100
1693 Name Name Default Name
1694 UK pound sign ACS_STERLING f }
1695 arrow pointing down ACS_DARROW v .
1696 arrow pointing left ACS_LARROW < ,
1697 arrow pointing right ACS_RARROW > +
1698 arrow pointing up ACS_UARROW ^ -
1699 board of squares ACS_BOARD # h
1700 bullet ACS_BULLET o ~
1701 checker board (stipple) ACS_CKBOARD : a
1702 degree symbol ACS_DEGREE \ f
1703 diamond ACS_DIAMOND + `
1704 greater-than-or-equal-to ACS_GEQUAL > z
1705 greek pi ACS_PI * {
1706 horizontal line ACS_HLINE - q
1707 lantern symbol ACS_LANTERN # i
1708 large plus or crossover ACS_PLUS + n
1709 less-than-or-equal-to ACS_LEQUAL < y
1710 lower left corner ACS_LLCORNER + m
1711 lower right corner ACS_LRCORNER + j
1712 not-equal ACS_NEQUAL ! |
1713 plus/minus ACS_PLMINUS # g
1714 scan line 1 ACS_S1 ~ o
1715 scan line 3 ACS_S3 - p
1716 scan line 7 ACS_S7 - r
1717 scan line 9 ACS_S9 _ s
1718 solid square block ACS_BLOCK # 0
1719 tee pointing down ACS_TTEE + w
1720 tee pointing left ACS_RTEE + u
1721 tee pointing right ACS_LTEE + t
1722 tee pointing up ACS_BTEE + v
1723 upper left corner ACS_ULCORNER + l
1724 upper right corner ACS_URCORNER + k
1725 vertical line ACS_VLINE | x
1726
1727 The best way to define a new device's graphics set is to add a column
1728 to a copy of this table for your terminal, giving the character which
1729 (when emitted between smacs/rmacs switches) will be rendered as the
1730 corresponding graphic. Then read off the VT100/your terminal character
1731 pairs right to left in sequence; these become the ACSC string.
1732
1733 Color Handling
1734 Most color terminals are either `Tektronix-like' or `HP-like'. Tek‐
1735 tronix-like terminals have a predefined set of N colors (where N usu‐
1736 ally 8), and can set character-cell foreground and background charac‐
1737 ters independently, mixing them into N * N color-pairs. On HP-like
1738 terminals, the use must set each color pair up separately (foreground
1739 and background are not independently settable). Up to M color-pairs
1740 may be set up from 2*M different colors. ANSI-compatible terminals are
1741 Tektronix-like.
1742
1743 Some basic color capabilities are independent of the color method. The
1744 numeric capabilities colors and pairs specify the maximum numbers of
1745 colors and color-pairs that can be displayed simultaneously. The op
1746 (original pair) string resets foreground and background colors to their
1747 default values for the terminal. The oc string resets all colors or
1748 color-pairs to their default values for the terminal. Some terminals
1749 (including many PC terminal emulators) erase screen areas with the cur‐
1750 rent background color rather than the power-up default background;
1751 these should have the boolean capability bce.
1752
1753 To change the current foreground or background color on a Tektronix-
1754 type terminal, use setaf (set ANSI foreground) and setab (set ANSI
1755 background) or setf (set foreground) and setb (set background). These
1756 take one parameter, the color number. The SVr4 documentation describes
1757 only setaf/setab; the XPG4 draft says that "If the terminal supports
1758 ANSI escape sequences to set background and foreground, they should be
1759 coded as setaf and setab, respectively. If the terminal supports other
1760 escape sequences to set background and foreground, they should be coded
1761 as setf and setb, respectively. The vidputs() function and the refresh
1762 functions use setaf and setab if they are defined."
1763
1764 The setaf/setab and setf/setb capabilities take a single numeric argu‐
1765 ment each. Argument values 0-7 of setaf/setab are portably defined as
1766 follows (the middle column is the symbolic #define available in the
1767 header for the curses or ncurses libraries). The terminal hardware is
1768 free to map these as it likes, but the RGB values indicate normal loca‐
1769 tions in color space.
1770
1771 Color #define Value RGB
1772 black COLOR_BLACK 0 0, 0, 0
1773 red COLOR_RED 1 max,0,0
1774 green COLOR_GREEN 2 0,max,0
1775 yellow COLOR_YELLOW 3 max,max,0
1776 blue COLOR_BLUE 4 0,0,max
1777 magenta COLOR_MAGENTA 5 max,0,max
1778 cyan COLOR_CYAN 6 0,max,max
1779 white COLOR_WHITE 7 max,max,max
1780
1781 The argument values of setf/setb historically correspond to a different
1782 mapping, i.e.,
1783
1784 Color #define Value RGB
1785 black COLOR_BLACK 0 0, 0, 0
1786 blue COLOR_BLUE 1 0,0,max
1787 green COLOR_GREEN 2 0,max,0
1788 cyan COLOR_CYAN 3 0,max,max
1789 red COLOR_RED 4 max,0,0
1790 magenta COLOR_MAGENTA 5 max,0,max
1791 yellow COLOR_YELLOW 6 max,max,0
1792 white COLOR_WHITE 7 max,max,max
1793 It is important to not confuse the two sets of color capabilities; oth‐
1794 erwise red/blue will be interchanged on the display.
1795
1796 On an HP-like terminal, use scp with a color-pair number parameter to
1797 set which color pair is current.
1798
1799 On a Tektronix-like terminal, the capability ccc may be present to
1800 indicate that colors can be modified. If so, the initc capability will
1801 take a color number (0 to colors - 1)and three more parameters which
1802 describe the color. These three parameters default to being inter‐
1803 preted as RGB (Red, Green, Blue) values. If the boolean capability hls
1804 is present, they are instead as HLS (Hue, Lightness, Saturation)
1805 indices. The ranges are terminal-dependent.
1806
1807 On an HP-like terminal, initp may give a capability for changing a
1808 color-pair value. It will take seven parameters; a color-pair number
1809 (0 to max_pairs - 1), and two triples describing first background and
1810 then foreground colors. These parameters must be (Red, Green, Blue) or
1811 (Hue, Lightness, Saturation) depending on hls.
1812
1813 On some color terminals, colors collide with highlights. You can reg‐
1814 ister these collisions with the ncv capability. This is a bit-mask of
1815 attributes not to be used when colors are enabled. The correspondence
1816 with the attributes understood by curses is as follows:
1817
1818 Attribute Bit Decimal
1819 A_STANDOUT 0 1
1820 A_UNDERLINE 1 2
1821 A_REVERSE 2 4
1822 A_BLINK 3 8
1823 A_DIM 4 16
1824 A_BOLD 5 32
1825 A_INVIS 6 64
1826 A_PROTECT 7 128
1827 A_ALTCHARSET 8 256
1828
1829 For example, on many IBM PC consoles, the underline attribute collides
1830 with the foreground color blue and is not available in color mode.
1831 These should have an ncv capability of 2.
1832
1833 SVr4 curses does nothing with ncv, ncurses recognizes it and optimizes
1834 the output in favor of colors.
1835
1836 Miscellaneous
1837 If the terminal requires other than a null (zero) character as a pad,
1838 then this can be given as pad. Only the first character of the pad
1839 string is used. If the terminal does not have a pad character, specify
1840 npc. Note that ncurses implements the termcap-compatible PC variable;
1841 though the application may set this value to something other than a
1842 null, ncurses will test npc first and use napms if the terminal has no
1843 pad character.
1844
1845 If the terminal can move up or down half a line, this can be indicated
1846 with hu (half-line up) and hd (half-line down). This is primarily use‐
1847 ful for superscripts and subscripts on hard-copy terminals. If a hard-
1848 copy terminal can eject to the next page (form feed), give this as ff
1849 (usually control L).
1850
1851 If there is a command to repeat a given character a given number of
1852 times (to save time transmitting a large number of identical charac‐
1853 ters) this can be indicated with the parameterized string rep. The
1854 first parameter is the character to be repeated and the second is the
1855 number of times to repeat it. Thus, tparm(repeat_char, 'x', 10) is the
1856 same as `xxxxxxxxxx'.
1857
1858 If the terminal has a settable command character, such as the TEKTRONIX
1859 4025, this can be indicated with cmdch. A prototype command character
1860 is chosen which is used in all capabilities. This character is given
1861 in the cmdch capability to identify it. The following convention is
1862 supported on some UNIX systems: The environment is to be searched for a
1863 CC variable, and if found, all occurrences of the prototype character
1864 are replaced with the character in the environment variable.
1865
1866 Terminal descriptions that do not represent a specific kind of known
1867 terminal, such as switch, dialup, patch, and network, should include
1868 the gn (generic) capability so that programs can complain that they do
1869 not know how to talk to the terminal. (This capability does not apply
1870 to virtual terminal descriptions for which the escape sequences are
1871 known.)
1872
1873 If the terminal has a ``meta key'' which acts as a shift key, setting
1874 the 8th bit of any character transmitted, this fact can be indicated
1875 with km. Otherwise, software will assume that the 8th bit is parity
1876 and it will usually be cleared. If strings exist to turn this ``meta
1877 mode'' on and off, they can be given as smm and rmm.
1878
1879 If the terminal has more lines of memory than will fit on the screen at
1880 once, the number of lines of memory can be indicated with lm. A value
1881 of lm#0 indicates that the number of lines is not fixed, but that there
1882 is still more memory than fits on the screen.
1883
1884 If the terminal is one of those supported by the UNIX virtual terminal
1885 protocol, the terminal number can be given as vt.
1886
1887 Media copy strings which control an auxiliary printer connected to the
1888 terminal can be given as mc0: print the contents of the screen, mc4:
1889 turn off the printer, and mc5: turn on the printer. When the printer
1890 is on, all text sent to the terminal will be sent to the printer. It
1891 is undefined whether the text is also displayed on the terminal screen
1892 when the printer is on. A variation mc5p takes one parameter, and
1893 leaves the printer on for as many characters as the value of the param‐
1894 eter, then turns the printer off. The parameter should not exceed 255.
1895 All text, including mc4, is transparently passed to the printer while
1896 an mc5p is in effect.
1897
1898 Glitches and Braindamage
1899 Hazeltine terminals, which do not allow `~' characters to be displayed
1900 should indicate hz.
1901
1902 Terminals which ignore a line-feed immediately after an am wrap, such
1903 as the Concept and vt100, should indicate xenl.
1904
1905 If el is required to get rid of standout (instead of merely writing
1906 normal text on top of it), xhp should be given.
1907
1908 Teleray terminals, where tabs turn all characters moved over to blanks,
1909 should indicate xt (destructive tabs). Note: the variable indicating
1910 this is now `dest_tabs_magic_smso'; in older versions, it was tel‐
1911 eray_glitch. This glitch is also taken to mean that it is not possible
1912 to position the cursor on top of a ``magic cookie'', that to erase
1913 standout mode it is instead necessary to use delete and insert line.
1914 The ncurses implementation ignores this glitch.
1915
1916 The Beehive Superbee, which is unable to correctly transmit the escape
1917 or control C characters, has xsb, indicating that the f1 key is used
1918 for escape and f2 for control C. (Only certain Superbees have this
1919 problem, depending on the ROM.) Note that in older terminfo versions,
1920 this capability was called `beehive_glitch'; it is now `no_esc_ctl_c'.
1921
1922 Other specific terminal problems may be corrected by adding more capa‐
1923 bilities of the form xx.
1924
1925 Similar Terminals
1926 If there are two very similar terminals, one (the variant) can be
1927 defined as being just like the other (the base) with certain excep‐
1928 tions. In the definition of the variant, the string capability use can
1929 be given with the name of the base terminal. The capabilities given
1930 before use override those in the base type named by use. If there are
1931 multiple use capabilities, they are merged in reverse order. That is,
1932 the rightmost use reference is processed first, then the one to its
1933 left, and so forth. Capabilities given explicitly in the entry over‐
1934 ride those brought in by use references.
1935
1936 A capability can be canceled by placing xx@ to the left of the use ref‐
1937 erence that imports it, where xx is the capability. For example, the
1938 entry
1939
1940 2621-nl, smkx@, rmkx@, use=2621,
1941
1942 defines a 2621-nl that does not have the smkx or rmkx capabilities, and
1943 hence does not turn on the function key labels when in visual mode.
1944 This is useful for different modes for a terminal, or for different
1945 user preferences.
1946
1947 Pitfalls of Long Entries
1948 Long terminfo entries are unlikely to be a problem; to date, no entry
1949 has even approached terminfo's 4096-byte string-table maximum. Unfor‐
1950 tunately, the termcap translations are much more strictly limited (to
1951 1023 bytes), thus termcap translations of long terminfo entries can
1952 cause problems.
1953
1954 The man pages for 4.3BSD and older versions of tgetent() instruct the
1955 user to allocate a 1024-byte buffer for the termcap entry. The entry
1956 gets null-terminated by the termcap library, so that makes the maximum
1957 safe length for a termcap entry 1k-1 (1023) bytes. Depending on what
1958 the application and the termcap library being used does, and where in
1959 the termcap file the terminal type that tgetent() is searching for is,
1960 several bad things can happen.
1961
1962 Some termcap libraries print a warning message or exit if they find an
1963 entry that's longer than 1023 bytes; others do not; others truncate the
1964 entries to 1023 bytes. Some application programs allocate more than
1965 the recommended 1K for the termcap entry; others do not.
1966
1967 Each termcap entry has two important sizes associated with it: before
1968 "tc" expansion, and after "tc" expansion. "tc" is the capability that
1969 tacks on another termcap entry to the end of the current one, to add on
1970 its capabilities. If a termcap entry does not use the "tc" capability,
1971 then of course the two lengths are the same.
1972
1973 The "before tc expansion" length is the most important one, because it
1974 affects more than just users of that particular terminal. This is the
1975 length of the entry as it exists in /etc/termcap, minus the backslash-
1976 newline pairs, which tgetent() strips out while reading it. Some term‐
1977 cap libraries strip off the final newline, too (GNU termcap does not).
1978 Now suppose:
1979
1980 * a termcap entry before expansion is more than 1023 bytes long,
1981
1982 * and the application has only allocated a 1k buffer,
1983
1984 * and the termcap library (like the one in BSD/OS 1.1 and GNU) reads
1985 the whole entry into the buffer, no matter what its length, to see
1986 if it is the entry it wants,
1987
1988 * and tgetent() is searching for a terminal type that either is the
1989 long entry, appears in the termcap file after the long entry, or
1990 does not appear in the file at all (so that tgetent() has to
1991 search the whole termcap file).
1992
1993 Then tgetent() will overwrite memory, perhaps its stack, and probably
1994 core dump the program. Programs like telnet are particularly vulnera‐
1995 ble; modern telnets pass along values like the terminal type automati‐
1996 cally. The results are almost as undesirable with a termcap library,
1997 like SunOS 4.1.3 and Ultrix 4.4, that prints warning messages when it
1998 reads an overly long termcap entry. If a termcap library truncates
1999 long entries, like OSF/1 3.0, it is immune to dying here but will
2000 return incorrect data for the terminal.
2001
2002 The "after tc expansion" length will have a similar effect to the
2003 above, but only for people who actually set TERM to that terminal type,
2004 since tgetent() only does "tc" expansion once it is found the terminal
2005 type it was looking for, not while searching.
2006
2007 In summary, a termcap entry that is longer than 1023 bytes can cause,
2008 on various combinations of termcap libraries and applications, a core
2009 dump, warnings, or incorrect operation. If it is too long even before
2010 "tc" expansion, it will have this effect even for users of some other
2011 terminal types and users whose TERM variable does not have a termcap
2012 entry.
2013
2014 When in -C (translate to termcap) mode, the ncurses implementation of
2015 tic(1M) issues warning messages when the pre-tc length of a termcap
2016 translation is too long. The -c (check) option also checks resolved
2017 (after tc expansion) lengths.
2018
2019 Binary Compatibility
2020 It is not wise to count on portability of binary terminfo entries
2021 between commercial UNIX versions. The problem is that there are at
2022 least two versions of terminfo (under HP-UX and AIX) which diverged
2023 from System V terminfo after SVr1, and have added extension capabili‐
2024 ties to the string table that (in the binary format) collide with Sys‐
2025 tem V and XSI Curses extensions.
2026
2028 Some SVr4 curses implementations, and all previous to SVr4, do not
2029 interpret the %A and %O operators in parameter strings.
2030
2031 SVr4/XPG4 do not specify whether msgr licenses movement while in an
2032 alternate-character-set mode (such modes may, among other things, map
2033 CR and NL to characters that do not trigger local motions). The
2034 ncurses implementation ignores msgr in ALTCHARSET mode. This raises
2035 the possibility that an XPG4 implementation making the opposite inter‐
2036 pretation may need terminfo entries made for ncurses to have msgr
2037 turned off.
2038
2039 The ncurses library handles insert-character and insert-character modes
2040 in a slightly non-standard way to get better update efficiency. See
2041 the Insert/Delete Character subsection above.
2042
2043 The parameter substitutions for set_clock and display_clock are not
2044 documented in SVr4 or the XSI Curses standard. They are deduced from
2045 the documentation for the AT&T 505 terminal.
2046
2047 Be careful assigning the kmous capability. The ncurses wants to inter‐
2048 pret it as KEY_MOUSE, for use by terminals and emulators like xterm
2049 that can return mouse-tracking information in the keyboard-input
2050 stream.
2051
2052 Different commercial ports of terminfo and curses support different
2053 subsets of the XSI Curses standard and (in some cases) different exten‐
2054 sion sets. Here is a summary, accurate as of October 1995:
2055
2056 SVR4, Solaris, ncurses -- These support all SVr4 capabilities.
2057
2058 SGI -- Supports the SVr4 set, adds one undocumented extended string
2059 capability (set_pglen).
2060
2061 SVr1, Ultrix -- These support a restricted subset of terminfo capabili‐
2062 ties. The booleans end with xon_xoff; the numerics with width_sta‐
2063 tus_line; and the strings with prtr_non.
2064
2065 HP/UX -- Supports the SVr1 subset, plus the SVr[234] numerics
2066 num_labels, label_height, label_width, plus function keys 11 through
2067 63, plus plab_norm, label_on, and label_off, plus some incompatible
2068 extensions in the string table.
2069
2070 AIX -- Supports the SVr1 subset, plus function keys 11 through 63, plus
2071 a number of incompatible string table extensions.
2072
2073 OSF -- Supports both the SVr4 set and the AIX extensions.
2074
2076 /usr/share/terminfo/?/* files containing terminal descriptions
2077
2079 tic(1M), infocmp(1M), curses(3X), printf(3), term(5).
2080
2082 Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey. Based on pcurses
2083 by Pavel Curtis.
2084
2085
2086
2087 terminfo(5)