terminfo (5) Linux Manual Page
terminfo – terminal capability database
Synopsis
/etc/terminfo/*/*
Description
Terminfo is a database describing terminals, used by screen-oriented programs such as nvi(1), lynx(1), mutt(1), and other curses applications, using high-level calls to libraries such as ncurses(3NCURSES). It is also used via low-level calls by non-curses applications which may be screen-oriented (such as clear(1)) or non-screen (such as tabs(1)). Terminfo describes terminals by giving a set of capabilities which they have, by specifying how to perform screen operations, and by specifying padding requirements and initialization sequences. This manual describes ncurses version 6.3 (patch 20211021).
Terminfo Entry Syntax
Entries in terminfo consist of a sequence of fields:
.IP • 4 Each field ends with a comma “,” (embedded commas may be escaped with a backslash or written as “,”).
.IP • 4 White space between fields is ignored.
.IP • 4 The first field in a terminfo entry begins in the first column.
.IP • 4 Newlines and leading whitespace (spaces or tabs) may be used for formatting entries for readability. These are removed from parsed entries.
- The
infocmp-fand-Woptions rely on this to format if-then-else expressions, or to enforce maximum line-width. The resulting formatted terminal description can be read bytic.
.IP • 4 The first field for each terminal gives the names which are known for the terminal, separated by “|” characters.- The first name given is the most common abbreviation for the terminal (its primary name), the last name given should be a long name fully identifying the terminal (see
longname(3X)), and all others are treated as synonyms (aliases) for the primary terminal name.- X/Open Curses advises that all names but the last should be in lower case and contain no blanks; the last name may well contain upper case and blanks for readability.
- This implementation is not so strict; it allows mixed case in the primary name and aliases. If the last name has no embedded blanks, it allows that to be both an alias and a verbose name (but will warn about this ambiguity).
.IP • 4 Lines beginning with a “#” in the first column are treated as comments.- While comment lines are legal at any point, the output of
captoinfoandinfotocap(aliases fortic) will move comments so they occur only between entries. - The first name given is the most common abbreviation for the terminal (its primary name), the last name given should be a long name fully identifying the terminal (see
Terminal names (except for the last, verbose entry) should be chosen using the following conventions. The particular piece of hardware making up the terminal should have a root name, thus “hp2621”. This name should not contain hyphens. Modes that the hardware can be in, or user preferences, should be indicated by appending a hyphen and a mode suffix. Thus, a vt100 in 132-column mode would be vt100-w. The following suffixes should be used where possible:
Suffix |
Meaning | Example |
| –nn | Number of lines on the screen | aaa-60 |
| –np | Number of pages of memory | c100-4p |
| -am | With automargins (usually the default) | vt100-am |
| -m | Mono mode; suppress color | ansi-m |
| -mc | Magic cookie; spaces when highlighting | wy30-mc |
| -na | No arrow keys (leave them in local) | c100-na |
| -nam | Without automatic margins | vt100-nam |
| -nl | No status line | att4415-nl |
| -ns | No status line | hp2626-ns |
| -rv | Reverse video | c100-rv |
| -s | Enable status line | vt100-s |
| -vb | Use visible bell instead of beep | wy370-vb |
| -w | Wide mode (> 80 columns, usually 132) | vt100-w |
term(7) manual page.
Terminfo Capabilities Syntax
The terminfo entry consists of several capabilities, i.e., features that the terminal has, or methods for exercising the terminal’s features. After the first field (giving the name(s) of the terminal entry), there should be one or more capability fields. These are boolean, numeric or string names with corresponding values:
.IP • 4 Boolean capabilities are true when present, false when absent. There is no explicit value for boolean capabilities.
.IP • 4 Numeric capabilities have a “#” following the name, then an unsigned decimal integer value.
.IP • 4 String capabilities have a “=” following the name, then an string of characters making up the capability value.
- String capabilities can be split into multiple lines, just as the fields comprising a terminal entry can be split into multiple lines. While blanks between fields are ignored, blanks embedded within a string value are retained, except for leading blanks on a line.
Any capability can be canceled, i.e., suppressed from the terminal entry, by following its name with “@” rather than a capability value.
Similar Terminals
If there are two very similar terminals, one (the variant) can be defined as being just like the other (the base) with certain exceptions. In the definition of the variant, the string capability use can be given with the name of the base terminal:
.IP • 4 The capabilities given before use override those in the base type named by use.
.IP • 4 If there are multiple use capabilities, they are merged in reverse order. That is, the rightmost use reference is processed first, then the one to its left, and so forth.
.IP • 4 Capabilities given explicitly in the entry override those brought in by use references. A capability can be canceled by placing xx@ to the left of the use reference that imports it, where xx is the capability. For example, the entry
- 2621-nl, smkx@, rmkx@, use=2621,
defines a 2621-nl that does not have the smkx or rmkx capabilities, and hence does not turn on the function key labels when in visual mode. This is useful for different modes for a terminal, or for different user preferences. An entry included via use can contain canceled capabilities, which have the same effect as if those cancels were inline in the using terminal entry.
Predefined Capabilities
The following is a complete table of the capabilities included in a terminfo description block and available to terminfo-using code. In each line of the table, The variable is the name by which the programmer (at the terminfo level) accesses the capability. The capname is the short name used in the text of the database, and is used by a person updating the database. Whenever possible, capnames are chosen to be the same as or similar to the ANSI X3.64-1979 standard (now superseded by ECMA-48, which uses identical or very similar names). Semantics are also intended to match those of the specification. The termcap code is the old termcap capability name (some capabilities are new, and have names which termcap did not originate). Capability names have no hard length limit, but an informal limit of 5 characters has been adopted to keep them short and to allow the tabs in the source file Caps to line up nicely. Finally, the description field attempts to convey the semantics of the capability. You may find some codes in the description field:
- (P)
- indicates that padding may be specified
- #[1-9]
- in the description field indicates that the string is passed through
tparm(3X) with parameters as given (#i).- If no parameters are listed in the description, passing the string through
tparm(3X) may give unexpected results, e.g., if it contains percent (%%) signs. - If no parameters are listed in the description, passing the string through
- (P*)
- indicates that padding may vary in proportion to the number of lines affected
- (#i)
- indicates the ith parameter. These are the boolean capabilities:
These are the numeric capabilities:VariableCap- TCap Description Booleansname Code auto_left_margin bw bw cub1 wraps from column 0 to last column auto_right_margin am am terminal has automatic margins back_color_erase bce ut screen erased with background color can_change ccc cc terminal can re-define existing colors ceol_standout_glitch xhp xs standout not erased by overwriting (hp) col_addr_glitch xhpa YA only positive motion for hpa/mhpa caps cpi_changes_res cpix YF changing character pitch changes resolution cr_cancels_micro_mode crxm YB using cr turns off micro mode dest_tabs_magic_smso xt xt tabs destructive, magic so char (t1061) eat_newline_glitch xenl xn newline ignored after 80 cols (concept) erase_overstrike eo eo can erase overstrikes with a blank generic_type gn gn generic line type hard_copy hc hc hardcopy terminal hard_cursor chts HC cursor is hard to see has_meta_key km km Has a meta key (i.e., sets 8th-bit) has_print_wheel daisy YC printer needs operator to change character set has_status_line hs hs has extra status line hue_lightness_saturation hls hl terminal uses only HLS color notation (Tektronix) insert_null_glitch in in insert mode distinguishes nulls lpi_changes_res lpix YG changing line pitch changes resolution memory_above da da display may be retained above the screen memory_below db db display may be retained below the screen move_insert_mode mir mi safe to move while in insert mode move_standout_mode msgr ms safe to move while in standout mode needs_xon_xoff nxon nx padding will not work, xon/xoff required no_esc_ctlc xsb xb beehive (f1=escape, f2=ctrl C) no_pad_char npc NP pad character does not exist non_dest_scroll_region ndscr ND scrolling region is non-destructive non_rev_rmcup nrrmc NR smcup does not reverse rmcup over_strike os os terminal can overstrike prtr_silent mc5i 5i printer will not echo on screen row_addr_glitch xvpa YD only positive motion for vpa/mvpa caps semi_auto_right_margin sam YE printing in last column causes cr status_line_esc_ok eslok es escape can be used on the status line tilde_glitch hz hz cannot print ~’s (Hazeltine) transparent_underline ul ul underline character overstrikes xon_xoff xon xo terminal uses xon/xoff handshaking The following numeric capabilities are present in the SVr4.0 term structure, but are not yet documented in the man page. They came in with SVr4’s printer support.VariableCap- TCap Description Numericname Code columns cols co number of columns in a line init_tabs it it tabs initially every # spaces label_height lh lh rows in each label label_width lw lw columns in each label lines lines li number of lines on screen or page lines_of_memory lm lm lines of memory if > line. 0 means varies magic_cookie_glitch xmc sg number of blank characters left by smso or rmso max_attributes ma ma maximum combined attributes terminal can handle max_colors colors Co maximum number of colors on screen max_pairs pairs pa maximum number of color-pairs on the screen maximum_windows wnum MW maximum number of definable windows no_color_video ncv NC video attributes that cannot be used with colors num_labels nlab Nl number of labels on screen padding_baud_rate pb pb lowest baud rate where padding needed virtual_terminal vt vt virtual terminal number (CB/unix) width_status_line wsl ws number of columns in status line These are the string capabilities:VariableCap- TCap Description Numericname Code bit_image_entwining bitwin Yo number of passes for each bit-image row bit_image_type bitype Yp type of bit-image device buffer_capacity bufsz Ya numbers of bytes buffered before printing buttons btns BT number of buttons on mouse dot_horz_spacing spinh Yc spacing of dots horizontally in dots per inch dot_vert_spacing spinv Yb spacing of pins vertically in pins per inch max_micro_address maddr Yd maximum value in micro_…_address max_micro_jump mjump Ye maximum value in parm_…_micro micro_col_size mcs Yf character step size when in micro mode micro_line_size mls Yg line step size when in micro mode number_of_pins npins Yh numbers of pins in print-head output_res_char orc Yi horizontal resolution in units per line output_res_horz_inch orhi Yk horizontal resolution in units per inch output_res_line orl Yj vertical resolution in units per line output_res_vert_inch orvi Yl vertical resolution in units per inch print_rate cps Ym print rate in characters per second wide_char_size widcs Yn character step size when in double wide mode VariableCap - TCapDescription StringnameCode acs_charsacscac graphics charset pairs, based on vt100 back_tabcbtbt back tab(P) bellbelbl audible signal(bell)(P) carriage_returncrcr carriage return (P *)(P *) change_char_pitchcpiZA Change number of characters per inch to #1 change_line_pitchlpiZB Change number of lines per inch to #1 change_res_horzchrZC Change horizontal resolution to #1 change_res_vertcvrZD Change vertical resolution to #1 change_scroll_regioncsrcs change region to line #1 to line #2(P) char_paddingrmprP like ip but when in insert mode clear_all_tabstbcct clear all tab stops(P) clear_marginsmgcMC clear right and left soft margins clear_screenclearcl clear screen and home cursor(P *) clr_bolel1cb Clear to beginning of line clr_eolelce clear to end of line(P) clr_eosedcd clear to end of screen(P *) column_addresshpach horizontal position #1, absolute(P) command_charactercmdchCC terminal settable cmd character in prototype ! ? create_windowcwinCW define a window #1 from #2, #3 to #4, #5 cursor_addresscupcm move to row #1 columns #2 cursor_downcud1do down one line cursor_homehomeho home cursor(if no cup) cursor_invisiblecivisvi make cursor invisible cursor_leftcub1le move left one space cursor_mem_addressmrcupCM memory relative cursor addressing, move to row #1 columns #2 cursor_normalcnormve make cursor appear normal(undo civis / cvvis) cursor_rightcuf1nd non - destructive space(move right one space) cursor_to_llllll last line, first column(if no cup) cursor_upcuu1up up one line cursor_visiblecvvisvs make cursor very visible define_chardefcZE Define a character #1, #2 dots wide, descender #3 delete_characterdch1dc delete character(P *) delete_linedl1dl delete line(P *) dial_phonedialDI dial number #1 dis_status_linedslds disable status line display_clockdclkDK display clock down_half_linehdhd half a line down ena_acsenacseA enable alternate char set enter_alt_charset_modesmacsas start alternate character set(P) enter_am_modesmamSA turn on automatic margins enter_blink_modeblinkmb turn on blinking enter_bold_modeboldmd turn on bold(extra bright) mode enter_ca_modesmcupti string to start programs using cup enter_delete_modesmdcdm enter delete mode enter_dim_modedimmh turn on half - bright mode enter_doublewide_modeswidmZF Enter double - wide mode enter_draft_qualitysdrfqZG Enter draft - quality mode enter_insert_modesmirim enter insert mode enter_italics_modesitmZH Enter italic mode enter_leftward_modeslmZI Start leftward carriage motion enter_micro_modesmicmZJ Start micro - motion mode enter_near_letter_qualitysnlqZK Enter NLQ mode enter_normal_qualitysnrmqZL Enter normal - quality mode enter_protected_modeprotmp turn on protected mode enter_reverse_moderevmr turn on reverse video mode enter_secure_modeinvismk turn on blank mode(characters invisible) enter_shadow_modesshmZM Enter shadow - print mode enter_standout_modesmsoso begin standout mode enter_subscript_modessubmZN Enter subscript mode enter_superscript_modessupmZO Enter superscript mode enter_underline_modesmulus begin underline mode enter_upward_modesumZP Start upward carriage motion enter_xon_modesmxonSX turn on xon / xoff handshaking erase_charsechec erase #1 characters(P) exit_alt_charset_modermacsae end alternate character set(P) exit_am_modermamRA turn off automatic margins exit_attribute_modesgr0me turn off all attributes exit_ca_modermcupte strings to end programs using cup exit_delete_modermdced end delete mode exit_doublewide_moderwidmZQ End double-wide mode exit_insert_modermirei exit insert mode exit_italics_moderitmZR End italic mode exit_leftward_moderlmZS End left-motion mode exit_micro_modermicmZT End micro-motion mode exit_shadow_modershmZU End shadow-print mode exit_standout_modermsose exit standout mode exit_subscript_modersubmZV End subscript mode exit_superscript_modersupmZW End superscript mode exit_underline_modermulue exit underline mode exit_upward_moderumZX End reverse character motion exit_xon_modermxonRX turn off xon/xoff handshaking fixed_pausepausePA pause for 2-3 seconds flash_hookhookfh flash switch hook flash_screenflashvb visible bell (may not move cursor) form_feedffff hardcopy terminal page eject (P*) from_status_linefslfs return from status line goto_windowwingoWG go to window #1 hanguphupHU hang-up phone init_1stringis1i1 initialization string init_2stringis2is initialization string init_3stringis3i3 initialization string init_fileifif name of initialization file init_progiprogiP path name of program for initialization initialize_colorinitcIc initialize color #1 to (#2,#3,#4) initialize_pairinitpIp Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7) insert_characterich1ic insert character (P) insert_lineil1al insert line(P *) insert_paddingipip insert padding after inserted character key_a1ka1K1 upper left of keypad key_a3ka3K3 upper right of keypad key_b2kb2K2 center of keypad key_backspacekbskb backspace key key_begkbeg @1 begin key key_btabkcbtkB back - tab key key_c1kc1K4 lower left of keypad key_c3kc3K5 lower right of keypad key_cancelkcan @2 cancel key key_catabktbcka clear - all - tabs key key_clearkclrkC clear - screen or erase key key_closekclo @3 close key key_commandkcmd @4 command key key_copykcpy @5 copy key key_createkcrt @6 create key key_ctabkctabkt clear - tab key key_dckdch1kD delete - character key key_dlkdl1kL delete - line key key_downkcud1kd down - arrow key key_eickrmirkM sent by rmir or smir in insert mode key_endkend @7 end key key_enterkent @8 enter / send key key_eolkelkE clear - to - end - of - line key key_eoskedkS clear - to - end - of - screen key key_exitkext @9 exit key key_f0kf0k0 F0 function key key_f1kf1k1 F1 function key key_f10kf10k; F10 function key key_f11kf11F1 F11 function key key_f12kf12F2 F12 function key key_f13kf13F3 F13 function key key_f14kf14F4 F14 function key key_f15kf15F5 F15 function key key_f16kf16F6 F16 function key key_f17kf17F7 F17 function key key_f18kf18F8 F18 function key key_f19kf19F9 F19 function key key_f2kf2k2 F2 function key key_f20kf20FA F20 function key key_f21kf21FB F21 function key key_f22kf22FC F22 function key key_f23kf23FD F23 function key key_f24kf24FE F24 function key key_f25kf25FF F25 function key key_f26kf26FG F26 function key key_f27kf27FH F27 function key key_f28kf28FI F28 function key key_f29kf29FJ F29 function key key_f3kf3k3 F3 function key key_f30kf30FK F30 function key key_f31kf31FL F31 function key key_f32kf32FM F32 function key key_f33kf33FN F33 function key key_f34kf34FO F34 function key key_f35kf35FP F35 function key key_f36kf36FQ F36 function key key_f37kf37FR F37 function key key_f38kf38FS F38 function key key_f39kf39FT F39 function key key_f4kf4k4 F4 function key key_f40kf40FU F40 function key key_f41kf41FV F41 function key key_f42kf42FW F42 function key key_f43kf43FX F43 function key key_f44kf44FY F44 function key key_f45kf45FZ F45 function key key_f46kf46Fa F46 function key key_f47kf47Fb F47 function key key_f48kf48Fc F48 function key key_f49kf49Fd F49 function key key_f5kf5k5 F5 function key key_f50kf50Fe F50 function key key_f51kf51Ff F51 function key key_f52kf52Fg F52 function key key_f53kf53Fh F53 function key key_f54kf54Fi F54 function key key_f55kf55Fj F55 function key key_f56kf56Fk F56 function key key_f57kf57Fl F57 function key key_f58kf58Fm F58 function key key_f59kf59Fn F59 function key key_f6kf6k6 F6 function key key_f60kf60Fo F60 function key key_f61kf61Fp F61 function key key_f62kf62Fq F62 function key key_f63kf63Fr F63 function key key_f7kf7k7 F7 function key key_f8kf8k8 F8 function key key_f9kf9k9 F9 function key key_findkfnd @0 find key key_helpkhlp % 1 help key key_homekhomekh home key key_ickich1kI insert - character key key_ilkil1kA insert - line key key_leftkcub1kl left - arrow key key_llkllkH lower - left key(home down) key_markkmrk % 2 mark key key_messagekmsg % 3 message key key_movekmov % 4 move key key_nextknxt % 5 next key key_npageknpkN next - page key key_openkopn % 6 open key key_optionskopt % 7 options key key_ppagekppkP previous - page key key_previouskprv % 8 previous key key_printkprt % 9 print key key_redokrdo % 0 redo key key_referencekref & 1 reference key key_refreshkrfr & 2 refresh key key_replacekrpl & 3 replace key key_restartkrst & 4 restart key key_resumekres & 5 resume key key_rightkcuf1kr right - arrow key key_saveksav & 6 save key key_sbegkBEG & 9 shifted begin key key_scancelkCAN & 0 shifted cancel key key_scommandkCMD * 1 shifted command key key_scopykCPY * 2 shifted copy key key_screatekCRT * 3 shifted create key key_sdckDC * 4 shifted delete - character key key_sdlkDL * 5 shifted delete - line key key_selectkslt * 6 select key key_sendkEND * 7 shifted end key key_seolkEOL * 8 shifted clear - to - end - of - line key key_sexitkEXT * 9 shifted exit key key_sfkindkF scroll - forward key key_sfindkFND * 0 shifted find key key_shelpkHLP #1 shifted help key key_shomekHOM #2 shifted home key key_sickIC #3 shifted insert - character key key_sleftkLFT #4 shifted left - arrow key key_smessagekMSG % a shifted message key key_smovekMOV % b shifted move key key_snextkNXT % c shifted next key key_soptionskOPT % d shifted options key key_spreviouskPRV % e shifted previous key key_sprintkPRT % f shifted print key key_srkrikR scroll - backward key key_sredokRDO % g shifted redo key key_sreplacekRPL % h shifted replace key key_srightkRIT % i shifted right - arrow key key_srsumekRES % j shifted resume key key_ssavekSAV !1 shifted save key key_ssuspendkSPD !2 shifted suspend key key_stabkhtskT set - tab key key_sundokUND !3 shifted undo key key_suspendkspd & 7 suspend key key_undokund & 8 undo key key_upkcuu1ku up - arrow key keypad_localrmkxke leave 'keyboard_transmit' mode keypad_xmitsmkxks enter 'keyboard_transmit' mode lab_f0lf0l0 label on function key f0 if not f0 lab_f1lf1l1 label on function key f1 if not f1 lab_f10lf10la label on function key f10 if not f10 lab_f2lf2l2 label on function key f2 if not f2 lab_f3lf3l3 label on function key f3 if not f3 lab_f4lf4l4 label on function key f4 if not f4 lab_f5lf5l5 label on function key f5 if not f5 lab_f6lf6l6 label on function key f6 if not f6 lab_f7lf7l7 label on function key f7 if not f7 lab_f8lf8l8 label on function key f8 if not f8 lab_f9lf9l9 label on function key f9 if not f9 label_formatflnLf label format label_offrmlnLF turn off soft labels label_onsmlnLO turn on soft labels meta_offrmmmo turn off meta mode meta_onsmmmm turn on meta mode(8th - bit on) micro_column_addressmhpaZY Like column_address in micro mode micro_downmcud1ZZ Like cursor_down in micro mode micro_leftmcub1Za Like cursor_left in micro mode micro_rightmcuf1Zb Like cursor_right in micro mode micro_row_addressmvpaZc Like row_address #1 in micro mode micro_upmcuu1Zd Like cursor_up in micro mode newlinenelnw newline(behave like cr followed by lf) order_of_pinsporderZe Match software bits to print - head pins orig_colorsococ Set all color pairs to the original ones orig_pairopop Set default pair to its original value pad_charpadpc padding char(instead of null) parm_dchdchDC delete #1 characters(P *) parm_delete_linedlDL delete #1 lines(P *) parm_down_cursorcudDO down #1 lines(P *) parm_down_micromcudZf Like parm_down_cursor in micro mode parm_ichichIC insert #1 characters(P *) parm_indexindnSF scroll forward #1 lines(P) parm_insert_lineilAL insert #1 lines(P *) parm_left_cursorcubLE move #1 characters to the left(P) parm_left_micromcubZg Like parm_left_cursor in micro mode parm_right_cursorcufRI move #1 characters to the right (P*) parm_right_micromcufZh Like parm_right_cursor in micro mode parm_rindexrinSR scroll back #1 lines (P) parm_up_cursorcuuUP up #1 lines (P*) parm_up_micromcuuZi Like parm_up_cursor in micro mode pkey_keypfkeypk program function key #1 to type string #2 pkey_localpflocpl program function key #1 to execute string #2 pkey_xmitpfxpx program function key #1 to transmit string #2 plab_normplnpn program label #1 to show string #2 print_screenmc0ps print contents of screen prtr_nonmc5ppO turn on printer for #1 bytes prtr_offmc4pf turn off printer prtr_onmc5po turn on printer pulsepulsePU select pulse dialing quick_dialqdialQD dial number #1 without checking remove_clockrmclkRC remove clock repeat_charreprp repeat char #1 #2 times (P*) req_for_inputrfiRF send next input char (for ptys) reset_1stringrs1r1 reset string reset_2stringrs2r2 reset string reset_3stringrs3r3 reset string reset_filerfrf name of reset file restore_cursorrcrc restore cursor to position of last save_cursor row_addressvpacv vertical position #1 absolute (P) save_cursorscsc save current cursor position (P) scroll_forwardindsf scroll text up(P) scroll_reverserisr scroll text down(P) select_char_setscsZj Select character set, #1 set_attributessgrsa define video attributes #1 - #9(PG9) set_backgroundsetbSb Set background color #1 set_bottom_marginsmgbZk Set bottom margin at current line set_bottom_margin_parmsmgbpZl Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom set_clocksclkSC set clock, #1 hrs #2 mins #3 secs set_color_pairscpsp Set current color pair to #1 set_foregroundsetfSf Set foreground color #1 set_left_marginsmglML set left soft margin at current column.(ML is not in BSD termcap) . set_left_margin_parmsmglpZm Set left(right) margin at column #1 set_right_marginsmgrMR set right soft margin at current column set_right_margin_parmsmgrpZn Set right margin at column #1 set_tabhtsst set a tab in every row, current columns set_top_marginsmgtZo Set top margin at current line set_top_margin_parmsmgtpZp Set top(bottom) margin at row #1 set_windowwindwi current window is lines #1-#2 cols #3-#4 start_bit_imagesbimZq Start printing bit image graphics start_char_set_defscsdZr Start character set definition #1, with #2 characters in the set stop_bit_imagerbimZs Stop printing bit image graphics stop_char_set_defrcsdZt End definition of character set #1 subscript_characterssubcsZu List of subscriptable characters superscript_characterssupcsZv List of superscriptable characters tabhtta tab to next 8-space hardware tab stop these_cause_crdocrZw Printing any of these characters causes CR to_status_linetslts move to status line, column #1 tonetoneTO select touch tone dialing underline_charucuc underline char and move past it up_half_linehuhu half a line up user0u0u0 User string #0 user1u1u1 User string #1 user2u2u2 User string #2 user3u3u3 User string #3 user4u4u4 User string #4 user5u5u5 User string #5 user6u6u6 User string #6 user7u7u7 User string #7 user8u8u8 User string #8 user9u9u9 User string #9 wait_tonewaitWA wait for dial-tone xoff_characterxoffcXF XOFF character xon_characterxoncXN XON character zero_motionzeromZx No motion for subsequent characterThe following string capabilities are present in the SVr4.0 term structure, but were originally not documented in the man page.
The XSI Curses standard added these hardcopy capabilities. They were used in some post-4.1 versions of System V curses, e.g., Solaris 2.5 and IRIX 6.x. Except forVariableCap- TCap Description Stringname Code alt_scancode_esc scesa S8 Alternate escape for scancode emulation bit_image_carriage_return bicr Yv Move to beginning of same row bit_image_newline binel Zz Move to next row of the bit image bit_image_repeat birep Xy Repeat bit image cell #1 #2 times char_set_names csnm Zy Produce #1’th item from list of character set names code_set_init csin ci Init sequence for multiple codesets color_names colornm Yw Give name for color #1 define_bit_image_region defbi Yx Define rectangular bit image region device_type devt dv Indicate language/codeset support display_pc_char dispc S1 Display PC character #1 end_bit_image_region endbi Yy End a bit-image region enter_pc_charset_mode smpch S2 Enter PC character display mode enter_scancode_mode smsc S4 Enter PC scancode mode exit_pc_charset_mode rmpch S3 Exit PC character display mode exit_scancode_mode rmsc S5 Exit PC scancode mode get_mouse getm Gm Curses should get button events, parameter #1 not documented. key_mouse kmous Km Mouse event has occurred mouse_info minfo Mi Mouse status information pc_term_options pctrm S6 PC terminal options pkey_plab pfxl xl Program function key #1 to type string #2 and show string #3 req_mouse_pos reqmp RQ Request mouse position scancode_escape scesc S7 Escape for scancode emulation set0_des_seq s0ds s0 Shift to codeset 0 (EUC set 0, ASCII) set1_des_seq s1ds s1 Shift to codeset 1 set2_des_seq s2ds s2 Shift to codeset 2 set3_des_seq s3ds s3 Shift to codeset 3 set_a_background setab AB Set background color to #1, using ANSI escape set_a_foreground setaf AF Set foreground color to #1, using ANSI escape set_color_band setcolor Yz Change to ribbon color #1 set_lr_margin smglr ML Set both left and right margins to #1, #2. (ML is not in BSD termcap). set_page_length slines YZ Set page length to #1 lines set_tb_margin smgtb MT Sets both top and bottom margins to #1, #2 YI, thencursestermcap names for them are invented. According to the XSI Curses standard, they have no termcap names. If your compiled terminfo entries use these, they may not be binary-compatible with System V terminfo entries after SVr4.1; beware!VariableCap- TCap Description Stringname Code enter_horizontal_hl_mode ehhlm Xh Enter horizontal highlight mode enter_left_hl_mode elhlm Xl Enter left highlight mode enter_low_hl_mode elohlm Xo Enter low highlight mode enter_right_hl_mode erhlm Xr Enter right highlight mode enter_top_hl_mode ethlm Xt Enter top highlight mode enter_vertical_hl_mode evhlm Xv Enter vertical highlight mode set_a_attributes sgr1 sA Define second set of video attributes #1-#6 set_pglen_inch slength YI Set page length to #1 hundredth of an inch (some implementations use sL for termcap). User-Defined Capabilities
The preceding section listed the predefined capabilities. They deal with some special features for terminals no longer (or possibly never) produced. Occasionally there are special features of newer terminals which are awkward or impossible to represent by reusing the predefined capabilities.
ncursesaddresses this limitation by allowing user-defined capabilities. Theticandinfocmpprograms provide the-xoption for this purpose. When-xis set,tictreats unknown capabilities as user-defined. That is, ifticencounters a capability name which it does not recognize, it infers its type (boolean, number or string) from the syntax and makes an extended table entry for that capability. Theuse_extended_names(3X) function makes this information conditionally available to applications. The ncurses library provides the data leaving most of the behavior to applications:
.IP • 4 User-defined capability strings whose name begins with “k” are treated as function keys.
.IP • 4 The types (boolean, number, string) determined byticcan be inferred by successful calls ontigetflag, etc.
.IP • 4 If the capability name happens to be two characters, the capability is also available through the termcap interface. While termcap is said to be extensible because it does not use a predefined set of capabilities, in practice it has been limited to the capabilities defined by terminfo implementations. As a rule, user-defined capabilities intended for use by termcap applications should be limited to booleans and numbers to avoid running past the 1023 byte limit assumed by termcap implementations and their applications. In particular, providing extended sets of function keys (past the 60 numbered keys and the handful of special named keys) is best done using the longer names available using terminfo.A Sample Entry
The following entry, describing an ANSI-standard terminal, is representative of what a
terminfoentry for a modern terminal typically looks like.ansi|ansi/pc-term compatible with color, am, mc5i, mir, msgr, colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64, acsc=+\,-.^Y0\333`a\261f\370g\361h\260 j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303 u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376, bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, cr=^M, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, home=\E[H, hpa=\E[%i%p1%dG, ht=\E[I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=^J, indn=\E[%p1%dS, invis=\E[8m, kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, khome=\E[H, kich1=\E[L, mc4=\E[4i, mc5=\E[5i, nel= \E[S, op=\E[39;49m, rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, rin=\E[%p1%dT, rmacs=\E[10m, rmpch=\E[10m, rmso=\E[m, rmul=\E[m, s0ds=\E(B, s1ds=\E)B, s2ds=\E*B, s3ds=\E+B, setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr=\E[0;10%?%p1%t;7%; %?%p2%t;4%; %?%p3%t;7%; %?%p4%t;5%; %?%p6%t;1%; %?%p7%t;8%; %?%p9%t;11%;m, sgr0=\E[0;10m, smacs=\E[11m, smpch=\E[11m, smso=\E[7m, smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%i%p1%dd,Entries may continue onto multiple lines by placing white space at the beginning of each line except the first. Comments may be included on lines beginning with “#”. Capabilities in terminfo are of three types:
.IP • 4 Boolean capabilities which indicate that the terminal has some particular feature,
.IP • 4 numeric capabilities giving the size of the terminal or the size of particular delays, and
.IP • 4 string capabilities, which give a sequence which can be used to perform particular terminal operations.Types of Capabilities
All capabilities have names. For instance, the fact that ANSI-standard terminals have automatic margins (i.e., an automatic return and line-feed when the end of a line is reached) is indicated by the capability
am. Hence the description of ansi includesam. Numeric capabilities are followed by the character “#” and then a positive value. Thuscols, which indicates the number of columns the terminal has, gives the value “80” for ansi. Values for numeric capabilities may be specified in decimal, octal or hexadecimal, using the C programming language conventions (e.g., 255, 0377 and 0xff or 0xFF). Finally, string valued capabilities, such asel(clear to end of line sequence) are given by the two-character code, an “=”, and then a string ending at the next following “,”. A number of escape sequences are provided in the string valued capabilities for easy encoding of characters there:
.IP • 4 Both\Eandmap to an ESCAPE character,
.IP • 4^xmaps to a control-x for any appropriate x, and
.IP • 4 the sequences,
\l,,
,,, and\s
- produce
- newline, line-feed, return, tab, backspace, form-feed, and space,
- respectively.
X/Open Curses does not say what “appropriate x” might be. In practice, that is a printable ASCII graphic character. The special case “^?” is interpreted as DEL (127). In all other cases, the character value is AND’d with 0x1f, mapping to ASCII control codes in the range 0 through 31. Other escapes include
.IP • 4\^for^,
.IP • 4\for\,
.IP • 4\, for comma,
.IP • 4\:for:,
.IP • 4 and
