terminfo(4) terminfo(4) (ENHANCED CURSES) NAME terminfo - printer, terminal, and modem capability database SYNOPSIS /usr/lib/terminfo/?/* DESCRIPTION The requirements in this manpage are in effect only for implementations that claim Enhanced Curses compliance.
terminfo(4) terminfo(4) (ENHANCED CURSES) shows the format of a terminfo source file: alias1 | alias2 | ... | aliasn | longname, whitespace am, lines #24, whitespace home=\Eeh, The first line, commonly referred to as the header line, must begin in column one and must contain at least two aliases separated by vertical bars. The last field in the header line must be the long name of the device and it may contain any string.
terminfo(4) terminfo(4) (ENHANCED CURSES) start_feature_line : START_FEATURE_LINE_BOOLEAN (2) | START_FEATURE_LINE_NUMERIC (3) | START_FEATURE_LINE_STRING (4) ; rest_of_feature_line : features COMMA NEWLINE | COMMA NEWLINE ; features : COMMA feature | features COMMA feature ; aliases : PIPE ALIAS | aliases PIPE ALIAS ; feature : BOOLEAN | NUMERIC | STRING ; Note (1) An ALIAS that begins in column one. This is handled by the lexical analyzer.
terminfo(4) terminfo(4) (ENHANCED CURSES) Defined Capabilities X/Open defines the capabilities listed in the following tables. All X/Open-compliant implementations must accept each of these capabilities in an entry in a terminfo source file. Implementations use this information to determine how properly to operate the current terminal.
terminfo(4) terminfo(4) (ENHANCED CURSES) Booleans Variable auto_left_margin auto_right_margin back_color_erase can_change ceol_standout_glitch col_addr_glitch cpi_changes_res Cap name bw am bce ccc xhp xhpa cpix Term cap bw am ut cc xs YA YF cr_cancels_micro_mode dest_tabs_magic_smso eat_newline_glitch erase_overstrike generic_type get_mouse hard_copy hard_cursor has_meta_key has_print_wheel crxm xt xenl eo gn getm hc chts km daisy YB xt xn eo gn Gm hc HC km YC has_status_line hs hue_lightness_satu
terminfo(4) terminfo(4) (ENHANCED CURSES) Numbers A Variable bit_image_entwining bit_image_type buffer_capacity buttons columns dot_horz_spacing dot_vert_spacing init_tabs label_height label_width lines lines_of_memory Cap name bitwin bitype bufsz btns cols spinh spinv it lh lw lines lm Term cap Yo Yp Ya BT co Yc Yb it lh lw li lm max_attributes ma ma magic_cookie_glitch xmc sg max_colors max_micro_address max_micro_jump max_pairs maximum_windows micro_col_size micro_line_size no_color_video nu
terminfo(4) terminfo(4) (ENHANCED CURSES) Strings (part 1 of 3) Term cap Description ac Graphic charset pairs aAbBcC S8 Alternate escape for scancode emulation (default is for VT100) back_tab cbt bt Back tab bell bel bl Audible signal (bell) 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 carriage_return cr cr Carriage return change_char_pitch cpi ZA Change number of cha
terminfo(4) terminfo(4) (ENHANCED CURSES) A tA 8 enter_alt_charset_mode enter_am_mode enter_blink_mode enter_bold_mode enter_ca_mode enter_delete_mode enter_dim_mode enter_doublewide_mode enter_draft_quality enter_horizontal_hl_mode enter_insert_mode enter_italics_mode enter_left_hl_mode enter_leftward_mode enter_low_hl_mode enter_micro_mode enter_near_letter_quality enter_normal_quality enter_pc_charset_mode enter_protected_mode enter_reverse_mode enter_right_hl_mode enter_scancode_mode enter_secure_m
terminfo(4) terminfo(4) (ENHANCED CURSES) flash_screen form_feed from_status_line goto_window hangup init_1string flash ff fsl wingo hup is1 vb ff fs WG HU i1 init_2string is2 is init_3string is3 i3 init_file init_prog initialize_color initialize_pair if iprog initc initp if iP IC Ip insert_character insert_line insert_padding ich1 il1 ip ic al ip Visible bell (may move cursor) Hardcopy terminal page eject Return from status line Go to window #1 Hang-up phone Terminal or printer initializat
terminfo(4) terminfo(4) (ENHANCED CURSES) A key_f7 key_f8 key_f9 key_f10 key_f11 key_f12 key_f13 key_f14 key_f15 key_f16 key_f17 key_f18 key_f19 key_f20 key_f21 key_f22 key_f23 key_f24 key_f25 key_f26 key_f27 key_f28 key_f29 key_f30 key_f31 key_f32 key_f33 key_f34 key_f35 key_f36 key_f37 key_f38 key_f39 key_f40 key_f41 key_f42 key_f43 key_f44 key_f45 key_f46 key_f47 key_f48 key_f49 key_f50 key_f51 key_f52 key_f53 key_f54 key_f55 key_f56 key_f57 key_f58 key_f59 key_f60 key_f61 key_f62 key_f63 key_find tA
terminfo(4) terminfo(4) (ENHANCED CURSES) key_help key_home key_ic key_il key_left key_ll key_mark key_message key_mouse key_move key_next key_npage key_open key_options key_ppage key_previous key_print key_redo key_reference key_refresh key_replace key_restart key_resume key_right key_save key_sbeg key_scancel key_scommand key_scopy key_screate key_sdc key_sdl key_select key_send key_seol key_sexit key_sf key_sfind key_shelp key_shome key_sic key_sleft key_smessage key_smove key_snext key_soptions key_sp
terminfo(4) terminfo(4) (ENHANCED CURSES) key_undo key_up kund &8 kcuu1 ku Sent by undo key Sent by terminal up-arrow key Strings (part 3 of 3) A Variable keypad_local keypad_xmit lab_f0 lab_f1 lab_f2 lab_f3 lab_f4 lab_f5 lab_f6 lab_f7 lab_f8 lab_f9 lab_f10 label_format label_off label_on memory_lock memory_unlock meta_off meta_on micro_column_address micro_down micro_left micro_right micro_row_address micro_up mouse_info newline order_of_pins orig_colors orig_pair pad_char parm_dch parm_delete_line
terminfo(4) terminfo(4) (ENHANCED CURSES) pkey_xmit plab_norm print_screen prtr_non prtr_off prtr_on pulse quick_dial pfx pln mc0 mc5p mc4 mc5 pulse qdial px pn ps pO pf po PU QD remove_clock repeat_char req_for_input req_mouse_pos reset_1string reset_2string reset_3string reset_file restore_cursor row_address save_cursor scancode_escape scroll_forward scroll_reverse select_char_set set0_des_seq set1_des_seq set2_des_seq set3_des_seq set_a_attributes set_a_background rmclk rep rfi reqmp rs1 rs2 rs3 rf
terminfo(4) terminfo(4) (ENHANCED CURSES) stop_bit_image stop_char_set_def subscript_characters superscript_characters tab these_cause_cr to_status_line tone user0 user1 user2 user3 user4 user5 user6 user7 user8 user9 underline_char up_half_line wait_tone xoff_character xon_character zero_motion rbim rcsd subcs supcs ht docr tsl tone u0 u1 u2 u3 u4 u5 u6 u7 u8 u9 uc hu wait xoffc xonc zerom Zs Zt Zu Zv ta Zw ts TO u0 u1 u2 u3 u4 u5 u6 u7 u8 u9 uc hu WA XF XN Zx End printing bit image graphics End defin
terminfo(4) terminfo(4) (ENHANCED CURSES) Types of Capabilities in the Sample Entry The sample entry shows the formats for the three types of terminfo capabilities: boolean, numeric, and string. All capabilities specified in the terminfo source file must be followed by commas, including the last capability in the source file. In terminfo source files, capabilities are referenced by their capability names (as shown in the Capname column of the previous tables).
terminfo(4) terminfo(4) (ENHANCED CURSES) \nnn Any character, specified as three octal digits (See the "X/Open System Interface Definitions, Issue 4, Version 2" specification, "General Terminal Interface".) Commented-Out Capabilities Sometimes individual capabilities must be commented out. To do this, put a period before the capability name. For example, see the second ind in the example in the Sample Entry section above.
terminfo(4) terminfo(4) (ENHANCED CURSES) Parameterized Strings Cursor addressing and other strings requiring arguments are described by a argumentized string capability with escapes in a form (%x) comparable to printf() (see printf (1)). For example, to address the cursor, the cup capability is given, using two arguments: the row and column to address to. (Rows and columns are numbered from zero and refer to the physical screen visible to the user, not to any unseen memory.
terminfo(4) terminfo(4) (ENHANCED CURSES) tabs are never expanded, so \t is safe to send. This turns out to be essential for the Ann Arbor 4080.) A final example is the LSI ADM-3a, which uses row and column offset by a blank character, thus: cup=\E=%p1%’\s’%+%c%p2%’\s’%+%c After sending "\E=", this pushes the first argument, pushes the ASCII decimal value for a space (32), adds them (pushing the sum on the stack in place of the two previous values), and outputs that value as a character.
terminfo(4) terminfo(4) (ENHANCED CURSES) If the terminal has the ability to define a window as part of memory, which all commands affect, it should be given as the argumentized string wind. The four arguments are the starting and ending lines in memory and the starting and ending columns in memory, in that order. If the terminal can retain display memory above, then the da capability should be given; if display memory can be retained below, then db should be given.
terminfo(4) terminfo(4) (ENHANCED CURSES) • Protected text (prot) • A reverse-video screen (rev) • An alternate character set (smacs to enter this mode and rmacs to exit it). (If a command is necessary before you can enter alternate character set mode, give the sequence in enacs or "enable alternate-character-set" mode.) Turning on any of these modes singly may turn off other modes. sgr0 should be used to turn off all video enhancement capabilities.
terminfo(4) terminfo(4) (ENHANCED CURSES) tparm() Argument p1 p2 p3 p4 p5 p6 p7 p8 p9 Attribute none standout underline reverse blink dim bold invis protect altcharset Escape Sequence \E[0m \E[0;4;7m \E[0;3m \E[0;4m \E[0;5m \E[0;7m \E[0;3;4m \E[0;8m not available ˆO (off) ˆN (on) Note that each escape sequence requires a 0 to turn off other modes before turning on its own mode. Also note that, as suggested above, standout is set up to be the combination of reverse and dim.
terminfo(4) terminfo(4) (ENHANCED CURSES) Strings to program function keys can be specified as pfkey, pfloc, and pfx. A string to program screen labels should be specified as pln. Each of these strings takes two arguments: a function key identifier and a string to program it with. pfkey causes pressing the given key to be the same as the user typing the given string; pfloc causes the string to be executed by the terminal in local mode; and pfx causes the string to be transmitted to the computer.
terminfo(4) terminfo(4) (ENHANCED CURSES) If escape sequences and other special commands, such as tab, work while in the status line, the flag eslok can be given. A string which turns off the status line (or otherwise erases its contents) should be given as dsl. If the terminal has commands to save and restore the position of the cursor, give them as sc and rc. The status line is normally assumed to be the same width as the rest of the screen (that is, cols).
terminfo(4) terminfo(4) (ENHANCED CURSES) The Tektronix method uses a set of N predefined colors (usually 8) from which an application can select "current" foreground and background colors. Thus a terminal can support up to N colors mixed into N*N color-pairs to be displayed on the screen at the same time. • Hewlett-Packard-style In the HP method, the application cannot define the foreground independently of the background, or vice-versa. Instead, the application must define an entire color-pair at once.
terminfo(4) terminfo(4) (ENHANCED CURSES) Attribute WA_STANDOUT WA_UNDERLINE WA_REVERSE WA_BLINK WA_DIM WA_BOLD WA_INVIS WA_PROTECT WA_ALTCHARSET WA_HORIZONTAL WA_LEFT WA_LOW WA_RIGHT WA_TOP WA_VERTICAL Bit Position 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Decimal Value 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 Characteristic That Sets sgr, parameter 1 sgr, parameter 2 sgr, parameter 3 sgr, parameter 4 sgr, parameter 5 sgr, parameter 6 sgr, parameter 7 sgr, parameter 8 sgr, parameter 9 sgr1, par
terminfo(4) terminfo(4) (ENHANCED CURSES) Media copy strings which control an auxiliary printer connected to the terminal can be given as: mc0 Print the contents of the screen. mc4 Turn off the printer. mc5 Turn on the printer. When the printer is on, all text sent to the terminal will be sent to the printer. A variation, mc5p, takes one argument, and leaves the printer on for as many characters as the value of the argument, then turns the printer off. The argument should not exceed 255.
terminfo(4) terminfo(4) (ENHANCED CURSES) All printers are assumed to be capable of printing with a uniform horizontal and vertical resolution. The view of printing that terminfo currently presents is one of printing inside a uniform matrix: All characters are printed at fixed positions relative to each "cell" in the matrix; furthermore, each cell has the same size given by the smallest horizontal and vertical step sizes dictated by the resolution. (The cell size can be changed as will be seen later.
terminfo(4) terminfo(4) (ENHANCED CURSES) Automatic Motion after Printing Wide Character Normal Mode or Micro Mode (mcs = orc): widcs Steps moved horizontally Micro Mode (mcs < orc): mcs Steps moved horizontally There may be control sequences to change the number of columns per inch (the character pitch) and to change the number of lines per inch (the line pitch).
terminfo(4) terminfo(4) (ENHANCED CURSES) Effects of Changing the Character/Line Pitches Before After Using cpi with cpix clear: orhi’ orc’ Using cpi with cpix set: orhi orc = orhi / Vcpi orhi’ orc’ Using lpi with lpix clear: orhi = orc * Vcpi orc orvi’ orl’ Using lpi with lpix set: orvi orl = orvi / Vlpi orvi’ orl’ Using chr: orvi = orl * Vlp orl orhi’ orc’ Using cvr: orhi Vchr orvi’ orl’ Using cpi or chr: orvi Vcvr widcs’ mcs’ widcs = widcs’ * orc / orc’ mcs = mcs’ * orc / orc’ Vchr, Vcpi,
terminfo(4) terminfo(4) (ENHANCED CURSES) Limits to Motion mjump Limit on use of mcub1, mcuf1, mcuu1, mcud1 maddr Limit on use of mhpa, mvpa xhpa xvpa If set, hpa and mhpa can’t move left If set, vpa and mvpa can’t move up If a printer needs to be in a "micro mode" for the motion capabilities described above to work, there are string capabilities defined to contain the control sequence to enter and exit this mode.
terminfo(4) terminfo(4) (ENHANCED CURSES) Two miscellaneous capabilities complete the list of motion capabilities. One of these is needed for printers that move the current position to the beginning of a line when certain control characters, such as line feed or form feed, are used. The other is used for the capability of suspending the motion that normally occurs after printing a character.
terminfo(4) terminfo(4) (ENHANCED CURSES) Enhanced Printing sshm Enter shadow-printing mode rshm Exit shadow-printing mode sitm ritm Enter italicizing mode Exit italicizing mode swidm rwidm Enter wide character mode Exit wide character mode ssupm rsupm supcs Enter superscript mode Exit superscript mode List of characters available as superscripts ssubm rsubm subcs Enter subscript mode Exit subscript mode List of characters available as subscripts If a printer requires the sshm control sequence bef
terminfo(4) terminfo(4) (ENHANCED CURSES) Alternate Character Sets scs Select character set N scsd Start definition of character set N, M characters defc Define character A, B dots wide, descender D rcsd End definition of character set N csnm List of character set names daisy Printer has manually changed print-wheels The scs, rcsd, and csnm strings are used with a single argument, N, a number from 0 to 63 that identifies the character set.
terminfo(4) terminfo(4) (ENHANCED CURSES) Dot-Matrix Graphics npins Number of pins, N, in print-head spinv Spacing of pins vertically in pins per inch spinh Spacing of dots horizontally in dots per inch porder Matches software bits to print-head pins sbim Start printing bit image graphics, B bits wide rbim End printing bit image graphics The sbim string is used with a single argument, B, the width of the image in dots.
terminfo(4) terminfo(4) (ENHANCED CURSES) Changing the Character/Line Pitches cpi Change character pitch cpix If set, cpi changes spinh lpi lpix Change line pitch If set, lpi changes spinv Programs that use cpi or lpi should recalculate the dot spacing: Effects of Changing the Character/Line Pitches Before After Using cpi with cpix clear: spinh’ spinh Using cpi with cpix set: spinh’ spinh = spinh’ * orhi / orhi’ Using lpi with lpix clear: spinv’ spinv Using lpi with lpix set: spinv’ spinv = spinv’ * orh
terminfo(4) terminfo(4) (ENHANCED CURSES) Note that most printer manufacturers advertise the maximum print rate, not the nominal print rate. A good way to get a value to put in for cps is to generate a few pages of text, count the number of printable characters, and then see how long it takes to print the text. Applications that use these values should recognize the variability in the print rate.
terminfo(4) terminfo(4) (ENHANCED CURSES) applications can use Curses to invoke those features, and can take advantages of optimizations within Curses and thus operate more efficiently. For most terminals, an optimal terminfo entry has already been written. EXTERNAL INFLUENCES Environment Variables CC Specifies a substitute character for a prototype command character. See cmdch in the Miscellaneous subsection of the Insert/Delete Line section.
(Notes) A (Notes) tA 38 Hewlett-Packard Company −1− HP-UX 11i Version 3: September 2010