1.\" Copyright (c) 1985, 1991, 1993, 1994 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. Neither the name of the University nor the names of its contributors 13.\" may be used to endorse or promote products derived from this software 14.\" without specific prior written permission. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" @(#)termcap.5 8.3 (Berkeley) 4/16/94 29.\" 30.\" /*************************************************************************** 31.\" * COPYRIGHT NOTICE * 32.\" **************************************************************************** 33.\" * ncurses is copyright (C) 1992-1995 * 34.\" * Zeyd M. Ben-Halim * 35.\" * zmbenhal@netcom.com * 36.\" * Eric S. Raymond * 37.\" * esr@snark.thyrsus.com * 38.\" * * 39.\" * Permission is hereby granted to reproduce and distribute ncurses * 40.\" * by any means and for any fee, whether alone or as part of a * 41.\" * larger distribution, in source or in binary form, PROVIDED * 42.\" * this notice is included with any such distribution, and is not * 43.\" * removed from any of its header files. Mention of ncurses in any * 44.\" * applications linked with it is highly appreciated. * 45.\" * * 46.\" * ncurses comes AS IS with no warranty, implied or expressed. * 47.\" * * 48.\" ***************************************************************************/ 49.\" 50.Dd December 13, 2009 51.Dt TERMCAP 5 52.Os 53.Sh NAME 54.Nm termcap 55.Nd terminal capability data base 56.Sh SYNOPSIS 57.Nm 58.Sh DESCRIPTION 59The 60.Nm 61file 62is a data base describing terminals, 63used, 64for example, 65by 66.Xr \&vi 1 67and 68.Xr ncurses 3 . 69Terminals are described in 70.Nm 71by giving a set of capabilities that they have and by describing 72how operations are performed. 73Padding requirements and initialization sequences 74are included in 75.Nm . 76.Pp 77Entries in 78.Nm 79consist of a number of `:'-separated fields. 80The first entry for each terminal gives the names that are known for the 81terminal, separated by `|' characters. 82The first name given is the most common abbreviation for the terminal. 83The last name given should be a long name fully identifying the terminal, 84and all others are understood as synonyms for the terminal name. 85All names but the last should be in lower case and contain no blanks; 86the last name may well contain upper case characters and blanks for 87readability. 88.Pp 89Terminal names (except for the last, verbose entry) 90should be chosen using the following conventions. 91The particular piece of hardware making up the terminal 92should have a root name chosen, thus 93.Dq hp2621 94This name should not contain hyphens. 95Modes that the hardware can be in 96or user preferences 97should be indicated by appending a hyphen and an indicator of the mode. 98Therefore, a 99.Dq vt100 100in 132-column mode would be 101.Dq vt100-w . 102The following suffixes should be used where possible: 103.Bl -column indent "With automatic margins (usually default)xx" -offset indent 104.Sy "Suffix Meaning Example" 105-w Wide mode (more than 80 columns) vt100-w 106-am With automatic margins (usually default) vt100-am 107-nam Without automatic margins vt100-nam 108.Pf \- Ar n Ta No "Number of lines on screen aaa-60" 109-na No arrow keys (leave them in local) concept100-na 110.Pf \- Ar \&np Ta No "Number of pages of memory concept100-4p" 111-rv Reverse video concept100-rv 112.El 113.Sh CAPABILITIES 114The description field attempts to convey the semantics of the 115capability. 116You may find some codes in the description field: 117.Bl -tag -width #[1-9] 118.It (P) 119indicates that padding may be specified. 120.It #[1-9] 121in the description field indicates that the string is passed through 122.Xr tparm 3 123or 124.Xr tgoto 3 125with parms as given (#\fIi\fP). 126.It (P*) 127indicates that padding may vary in proportion to the number of 128lines affected. 129.It (#\d\fIi\fP\u) 130indicates the \fIi\fP\uth\d parameter. 131.El 132.Pp 133These are the boolean capabilities: 134.Bd -literal 135\fBBoolean TCap Description\fR 136\fBVariables Code\fR 137auto_left_margin bw cursor_left wraps from column 0 to last 138 column 139auto_right_margin am terminal has automatic margins 140no_esc_ctlc xb beehive (f1=escape, f2=ctrl C) 141ceol_standout_glitch xs standout not erased by overwriting (hp) 142eat_newline_glitch xn newline ignored after 80 cols (concept) 143erase_overstrike eo can erase overstrikes with a blank 144generic_type gn generic line type 145hard_copy hc hardcopy terminal 146has_meta_key km Has a meta key, sets msb high 147has_status_line hs has extra status line 148insert_null_glitch in insert mode distinguishes nulls 149memory_above da display may be retained above the screen 150memory_below db display may be retained below the screen 151move_insert_mode mi safe to move while in insert mode 152move_standout_mode ms safe to move while in standout mode 153over_strike os terminal can overstrike 154status_line_esc_ok es escape can be used on the status line 155dest_tabs_magic_smso xt tabs destructive, magic so char (t1061) 156tilde_glitch hz cannot print ~'s (hazeltine) 157transparent_underline ul underline character overstrikes 158xon_xoff xo terminal uses xon/xoff handshaking 159needs_xon_xoff nx padding will not work, xon/xoff required 160prtr_silent 5i printer will not echo on screen 161hard_cursor HC cursor is hard to see 162non_rev_rmcup NR enter_ca_mode does not reverse exit_ca_mode 163no_pad_char NP pad character does not exist 164non_dest_scroll_region ND scrolling region is non-destructive 165can_change cc terminal can re-define existing colors 166back_color_erase ut screen erased with background color 167hue_lightness_saturation hl terminal uses only HLS color 168 notation (tektronix) 169col_addr_glitch YA only positive motion for column address and 170 micro_column_address caps 171cr_cancels_micro_mode YB using cr turns off micro mode 172has_print_wheel YC printer needs operator to change character 173 set 174row_addr_glitch YD only positive motion for row_address and 175 micro_row_address caps 176semi_auto_right_margin YE printing in last column causes cr 177cpi_changes_res YF changing character pitch changes resolution 178lpi_changes_res YG changing line pitch changes resolution 179.Ed 180.Pp 181These are the numeric capabilities: 182.Bd -literal 183\fBNumeric TCap Description\fR 184\fBVariables Code\fR 185columns co number of columns in aline 186init_tabs it tabs initially every # spaces 187lines li number of lines on screen or page 188lines_of_memory lm lines of memory if > line. 0 => varies 189magic_cookie_glitch sg number of blank chars left by 190 enter_standout_mode or exit_standout_mode 191padding_baud_rate pb lowest baud rate where padding needed 192virtual_terminal vt virtual terminal number (CB/unix) 193width_status_line ws columns in status line 194num_labels Nl number of labels on screen 195label_height lh rows in each label 196label_width lw columns in each label 197max_attributes ma maximum combined attributes terminal can 198 handle 199maximum_windows MW maximum number of definable windows 200magic_cookie_glitch_ul ug number of blanks left by underline 201# 202# These came in with SVr4's color support 203# 204max_colors Co maximum numbers of colors on screen 205max_pairs pa maximum number of color-pairs on the screen 206no_color_video NC video attributes that cannot be used with 207 colors 208# 209# The following numeric capabilities are present in the SVr4.0 term 210# structure, but are not yet documented in the man page. 211# They came in with SVr4's printer support. 212# 213buffer_capacity Ya numbers of bytes buffered before printing 214dot_vert_spacing Yb spacing of pins vertically in pins per inch 215dot_horz_spacing Yc spacing of dots horizontally in dots per 216 inch 217max_micro_address Yd maximum value in micro_..._address 218max_micro_jump Ye maximum value in parm_..._micro 219micro_char_size Yf character size when in micro mode 220micro_line_size Yg line size when in micro mode 221number_of_pins Yh numbers of pins in print-head 222output_res_char Yi horizontal resolution in units per line 223output_res_line Yj vertical resolution in units per line 224output_res_horz_inch Yk horizontal resolution in units per inch 225output_res_vert_inch Yl vertical resolution in units per inch 226print_rate Ym print rate in chars per second 227wide_char_size Yn character step size when in double wide 228 mode 229buttons BT number of buttons on mouse 230bit_image_entwining Yo number of passed for each bit-image row 231bit_image_type Yp type of bit-image device 232.Ed 233.Pp 234These are the string capabilities: 235.Bd -literal 236\fBString TCap Description\fR 237\fBVariables Code\fR 238back_tab bt back tab (P) 239bell bl audible signal (bell) (P) 240carriage_return cr carriage return (P*) 241change_scroll_region cs change region to line #1 to line #2 (P) 242clear_all_tabs ct clear all tab stops (P) 243clear_screen cl clear screen and home cursor (P*) 244clr_eol ce clear to end of line (P) 245clr_eos cd clear to end of screen (P*) 246column_address ch horizontal position #1, absolute (P) 247command_character CC terminal settable cmd character in 248 prototype 249cursor_address cm move to row #1 columns #2 250cursor_down do down one line 251cursor_home ho home cursor 252cursor_invisible vi make cursor invisible 253cursor_left le move left one space 254cursor_mem_address CM memory relative cursor addressing 255cursor_normal ve make cursor appear normal (undo 256 cursor_invisible/cursor_visible) 257cursor_right nd move right one space 258cursor_to_ll ll last line, first column 259cursor_up up up one line 260cursor_visible vs make cursor very visible 261delete_character dc delete character (P*) 262delete_line dl delete line (P*) 263dis_status_line ds disable status line 264down_half_line hd half a line down 265enter_alt_charset_mode as start alternate character set (P) 266enter_blink_mode mb turn on blinking 267enter_bold_mode md turn on bold (extra bright) mode 268enter_ca_mode ti string to start programs using 269 cursor_address 270enter_delete_mode dm enter delete mode 271enter_dim_mode mh turn on half-bright mode 272enter_insert_mode im enter insert mode 273enter_secure_mode mk turn on blank mode (characters invisible) 274enter_protected_mode mp turn on protected mode 275enter_reverse_mode mr turn on reverse video mode 276enter_standout_mode so begin standout mode 277enter_underline_mode us begin underline mode 278erase_chars ec erase #1 characters (P) 279exit_alt_charset_mode ae end alternate character set (P) 280exit_attribute_mode me turn off all attributes 281exit_ca_mode te strings to end programs using cup 282exit_delete_mode ed end delete mode 283exit_insert_mode ei exit insert mode 284exit_standout_mode se exit standout mode 285exit_underline_mode ue exit underline mode 286flash_screen vb visible bell (may not move cursor) 287form_feed ff hardcopy terminal page eject (P*) 288from_status_line fs return from status line 289init_1string i1 initialization string 290init_2string is initialization string 291init_3string i3 initialization string 292init_file if name of initialization file 293insert_character ic insert character (P) 294insert_line al insert line (P*) 295insert_padding ip insert padding after inserted character 296key_backspace kb backspace key 297key_catab ka clear-all-tabs key 298key_clear kC clear-screen or erase key 299key_ctab kt clear-tab key 300key_dc kD delete-character key 301key_dl kL delete-line key 302key_down kd down-arrow key 303key_eic kM sent by rmir or smir in insert mode 304key_eol kE clear-to-end-of-line key 305key_eos kS clear-to-end-of-screen key 306key_f0 k0 F0 function key 307key_f1 k1 F1 function key 308key_f10 k; F10 function key 309key_f2 k2 F2 function key 310key_f3 k3 F3 function key 311key_f4 k4 F4 function key 312key_f5 k5 F5 function key 313key_f6 k6 F6 function key 314key_f7 k7 F7 function key 315key_f8 k8 F8 function key 316key_f9 k9 F9 function key 317key_home kh home key 318key_ic kI insert-character key 319key_il kA insert-line key 320key_left kl left-arrow key 321key_ll kH last-line key 322key_npage kN next-page key 323key_ppage kP prev-page key 324key_right kr right-arrow key 325key_sf kF scroll-forward key 326key_sr kR scroll-backward key 327key_stab kT set-tab key 328key_up ku up-arrow key 329keypad_local ke leave 'keyboard_transmit' mode 330keypad_xmit ks enter 'keyboard_transmit' mode 331lab_f0 l0 label on function key f0 if not f0 332lab_f1 l1 label on function key f1 if not f1 333lab_f10 la label on function key f10 if not f10 334lab_f2 l2 label on function key f2 if not f2 335lab_f3 l3 label on function key f3 if not f3 336lab_f4 l4 label on function key f4 if not f4 337lab_f5 l5 label on function key f5 if not f5 338lab_f6 l6 label on function key f6 if not f6 339lab_f7 l7 label on function key f7 if not f7 340lab_f8 l8 label on function key f8 if not f8 341lab_f9 l9 label on function key f9 if not f9 342meta_off mo turn off meta mode 343meta_on mm turn on meta mode (8th-bit on) 344newline nw newline (behave like cr followed by lf) 345pad_char pc padding char (instead of null) 346parm_dch DC delete #1 chars (P*) 347parm_delete_line DL delete #1 lines (P*) 348parm_down_cursor DO down #1 lines (P*) 349parm_ich IC insert #1 chars (P*) 350parm_index SF scroll forward #1 lines (P) 351parm_insert_line AL insert #1 lines (P*) 352parm_left_cursor LE move #1 chars to the left (P) 353parm_right_cursor RI move #1 chars to the right (P*) 354parm_rindex SR scroll back #1 lines (P) 355parm_up_cursor UP up #1 lines (P*) 356pkey_key pk program function key #1 to type string #2 357pkey_local pl program function key #1 to execute 358 string #2 359pkey_xmit px program function key #1 to transmit 360 string #2 361print_screen ps print contents of screen 362prtr_off pf turn off printer 363prtr_on po turn on printer 364repeat_char rp repeat char #1 #2 times (P*) 365reset_1string r1 reset string 366reset_2string r2 reset string 367reset_3string r3 reset string 368reset_file rf name of reset file 369restore_cursor rc restore cursor to last position of 370 save_cursor 371row_address cv vertical position #1 absolute (P) 372save_cursor sc save current cursor position (P) 373scroll_forward sf scroll text up (P) 374scroll_reverse sr scroll text down (P) 375set_attributes sa define video attributes #1-#9 (PG9) 376set_tab st set a tab in every row, current columns 377set_window wi current window is lines #1-#2 cols #3-#4 378tab ta tab to next 8-space hardware tab stop 379to_status_line ts move to status line 380underline_char uc underline char and move past it 381up_half_line hu half a line up 382init_prog iP path name of program for initialization 383key_a1 K1 upper left of keypad 384key_a3 K3 upper right of keypad 385key_b2 K2 center of keypad 386key_c1 K4 lower left of keypad 387key_c3 K5 lower right of keypad 388prtr_non pO turn on printer for #1 bytes 389termcap_init2 i2 secondary initialization string 390termcap_reset rs terminal reset string 391# 392# SVr1 capabilities stop here. IBM's version of terminfo is the same as 393# SVr4 up to this point, but has a different set afterwards. 394# 395char_padding rP like insert_padding but when in insert mode 396acs_chars ac graphics charset pairs - def=vt100 397plab_norm pn program label #1 to show string #2 398key_btab kB back-tab key 399enter_xon_mode SX turn on xon/xoff handshaking 400exit_xon_mode RX turn off xon/xoff handshaking 401enter_am_mode SA turn on automatic margins 402exit_am_mode RA turn off automatic margins 403xon_character XN XON character 404xoff_character XF XOFF character 405ena_acs eA enable alternate char set 406label_on LO turn on soft labels 407label_off LF turn off soft labels 408key_beg @1 begin key 409key_cancel @2 cancel key 410key_close @3 close key 411key_command @4 command key 412key_copy @5 copy key 413key_create @6 create key 414key_end @7 end key 415key_enter @8 enter/send key 416key_exit @9 exit key 417key_find @0 find key 418key_help %1 help key 419key_mark %2 mark key 420key_message %3 message key 421key_move %4 move key 422key_next %5 next key 423key_open %6 open key 424key_options %7 options key 425key_previous %8 previous key 426key_print %9 print key 427key_redo %0 redo key 428key_reference &1 reference key 429key_refresh &2 refresh key 430key_replace &3 replace key 431key_restart &4 restart key 432key_resume &5 resume key 433key_save &6 save key 434key_suspend &7 suspend key 435key_undo &8 undo key 436key_sbeg &9 shifted key 437key_scancel &0 shifted key 438key_scommand *1 shifted key 439key_scopy *2 shifted key 440key_screate *3 shifted key 441key_sdc *4 shifted key 442key_sdl *5 shifted key 443key_select *6 select key 444key_send *7 shifted key 445key_seol *8 shifted key 446key_sexit *9 shifted key 447key_sfind *0 shifted key 448key_shelp #1 shifted key 449key_shome #2 shifted key 450key_sic #3 shifted key 451key_sleft #4 shifted key 452key_smessage %a shifted key 453key_smove %b shifted key 454key_snext %c shifted key 455key_soptions %d shifted key 456key_sprevious %e shifted key 457key_sprint %f shifted key 458key_sredo %g shifted key 459key_sreplace %h shifted key 460key_sright %i shifted key 461key_srsume %j shifted key 462key_ssave !1 shifted key 463key_ssuspend !2 shifted key 464key_sundo !3 shifted key 465req_for_input RF send next input char (for ptys) 466key_f11 F1 F11 function key 467key_f12 F2 F12 function key 468key_f13 F3 F13 function key 469key_f14 F4 F14 function key 470key_f15 F5 F15 function key 471key_f16 F6 F16 function key 472key_f17 F7 F17 function key 473key_f18 F8 F18 function key 474key_f19 F9 F19 function key 475key_f20 FA F20 function key 476key_f21 FB F21 function key 477key_f22 FC F22 function key 478key_f23 FD F23 function key 479key_f24 FE F24 function key 480key_f25 FF F25 function key 481key_f26 FG F26 function key 482key_f27 FH F27 function key 483key_f28 FI F28 function key 484key_f29 FJ F29 function key 485key_f30 FK F30 function key 486key_f31 FL F31 function key 487key_f32 FM F32 function key 488key_f33 FN F33 function key 489key_f34 FO F34 function key 490key_f35 FP F35 function key 491key_f36 FQ F36 function key 492key_f37 FR F37 function key 493key_f38 FS F38 function key 494key_f39 FT F39 function key 495key_f40 FU F40 function key 496key_f41 FV F41 function key 497key_f42 FW F42 function key 498key_f43 FX F43 function key 499key_f44 FY F44 function key 500key_f45 FZ F45 function key 501key_f46 Fa F46 function key 502key_f47 Fb F47 function key 503key_f48 Fc F48 function key 504key_f49 Fd F49 function key 505key_f50 Fe F50 function key 506key_f51 Ff F51 function key 507key_f52 Fg F52 function key 508key_f53 Fh F53 function key 509key_f54 Fi F54 function key 510key_f55 Fj F55 function key 511key_f56 Fk F56 function key 512key_f57 Fl F57 function key 513key_f58 Fm F58 function key 514key_f59 Fn F59 function key 515key_f60 Fo F60 function key 516key_f61 Fp F61 function key 517key_f62 Fq F62 function key 518key_f63 Fr F63 function key 519clr_bol cb Clear to beginning of line 520clear_margins MC clear right and left soft margins 521set_left_margin ML set left soft margin 522set_right_margin MR set right soft margin 523label_format Lf label format 524set_clock SC set clock, #1 hrs #2 mins #3 secs 525display_clock DK display clock at (#1,#2) 526remove_clock RC remove clock 527create_window CW define a window #1 from #2, #3 to #4, #5 528goto_window WG go to window #1 529hangup HU hang-up phone 530dial_phone DI dial number #1 531quick_dial QD dial number #1 without checking 532tone TO select touch tone dialing 533pulse PU select pulse dialling 534flash_hook fh flash switch hook 535fixed_pause PA pause for 2-3 seconds 536wait_tone WA wait for dial-tone 537user0 u0 User string #0 538user1 u1 User string #1 539user2 u2 User string #2 540user3 u3 User string #3 541user4 u4 User string #4 542user5 u5 User string #5 543user6 u6 User string #6 544user7 u7 User string #7 545user8 u8 User string #8 546user9 u9 User string #9 547# 548# SVr4 added these capabilities to support color 549# 550orig_pair op Set default pair to its original value 551orig_colors oc Set all color pairs to the original ones 552initialize_color Ic initialize color #1 to (#2,#3,#4) 553initialize_pair Ip Initialize color pair #1 to fg=(#2,#3,#4), 554 bg=(#5,#6,#7) 555set_color_pair sp Set current color pair to #1 556set_foreground Sf Set foreground color #1 557set_background Sb Set background color #1 558# 559# SVr4 added these capabilities to support printers 560# 561change_char_pitch ZA Change number of characters per inch 562change_line_pitch ZB Change number of lines per inch 563change_res_horz ZC Change horizontal resolution 564change_res_vert ZD Change vertical resolution 565define_char ZE Define a character 566enter_doublewide_mode ZF Enter double-wide mode 567enter_draft_quality ZG Enter draft-quality mode 568enter_italics_mode ZH Enter italic mode 569enter_leftward_mode ZI Start leftward carriage motion 570enter_micro_mode ZJ Start micro-motion mode 571enter_near_letter_quality ZK Enter NLQ mode 572enter_normal_quality ZL Enter normal-quality mode 573enter_shadow_mode ZM Enter shadow-print mode 574enter_subscript_mode ZN Enter subscript mode 575enter_superscript_mode ZO Enter superscript mode 576enter_upward_mode ZP Start upward carriage motion 577exit_doublewide_mode ZQ End double-wide mode 578exit_italics_mode ZR End italic mode 579exit_leftward_mode ZS End left-motion mode 580exit_micro_mode ZT End micro-motion mode 581exit_shadow_mode ZU End shadow-print mode 582exit_subscript_mode ZV End subscript mode 583exit_superscript_mode ZW End superscript mode 584exit_upward_mode ZX End reverse character motion 585micro_column_address ZY Like column_address in micro mode 586micro_down ZZ Like cursor_down in micro mode 587micro_left Za Like cursor_left in micro mode 588micro_right Zb Like cursor_right in micro mode 589micro_row_address Zc Like row_address in micro mode 590micro_up Zd Like cursor_up in micro mode 591order_of_pins Ze Match software bits to print-head pins 592parm_down_micro Zf Like parm_down_cursor in micro mode 593parm_left_micro Zg Like parm_left_cursor in micro mode 594parm_right_micro Zh Like parm_right_cursor in micro mode 595parm_up_micro Zi Like parm_up_cursor in micro mode 596select_char_set Zj Select character set 597set_bottom_margin Zk Set bottom margin at current line 598set_bottom_margin_parm Zl Set bottom margin at line #1 or #2 lines 599 from bottom 600set_left_margin_parm Zm Set left (right) margin at column #1 (#2) 601set_right_margin_parm Zn Set right margin at column #1 602set_top_margin Zo Set top margin at current line 603set_top_margin_parm Zp Set top (bottom) margin at row #1 (#2) 604start_bit_image Zq Start printing bit image graphics 605start_char_set_def Zr Start character set definition 606stop_bit_image Zs Stop printing bit image graphics 607stop_char_set_def Zt End definition of character aet 608subscript_characters Zu List of subscriptible characters 609superscript_characters Zv List of superscriptible characters 610these_cause_cr Zw Printing any of these chars causes CR 611zero_motion Zx No motion for subsequent character 612# 613# The following string capabilities are present in the SVr4.0 term 614# structure, but are not documented in the man page. 615# 616char_set_names Zy List of character set names 617key_mouse Km Mouse event has occurred 618mouse_info Mi Mouse status information 619req_mouse_pos RQ Request mouse position 620get_mouse Gm Curses should get button events 621set_a_foreground AF Set ANSI foreground color 622set_a_background AB Set ANSI background color 623pkey_plab xl Program function key #1 to type string #2 624 and show string #3 625device_type dv Indicate language/codeset support 626code_set_init ci Init sequence for multiple codesets 627set0_des_seq s0 Shift to code set 0 (EUC set 0, ASCII) 628set1_des_seq s1 Shift to code set 1 629set2_des_seq s2 Shift to code set 2 630set3_des_seq s3 Shift to code set 3 631set_lr_margin ML Set both left and right margins to #1, #2 632set_tb_margin MT Sets both top and bottom margins to #1, #2 633bit_image_repeat Xy Repeat bit image cell #1 #2 times 634bit_image_newline Zz Move to next row of the bit image 635bit_image_carriage_return Yv Move to beginning of same row 636color_names Yw Give name for color #1 637define_bit_image_region Yx Define rectangular bit image region 638end_bit_image_region Yy End a bit-image region 639set_color_band Yz Change to ribbon color #1 640set_page_length YZ Set page length to #1 lines 641# 642# SVr4 added these capabilities for direct PC-clone support 643# 644display_pc_char S1 Display PC character 645enter_pc_charset_mode S2 Enter PC character display mode 646exit_pc_charset_mode S3 Exit PC character display mode 647enter_scancode_mode S4 Enter PC scancode mode 648exit_scancode_mode S5 Exit PC scancode mode 649pc_term_options S6 PC terminal options 650scancode_escape S7 Escape for scancode emulation 651alt_scancode_esc S8 Alternate escape for scancode emulation 652# 653# The XSI Curses standard added these. 654# 655enter_horizontal_hl_mode Xh Enter horizontal highlight mode 656enter_left_hl_mode Xl Enter left highlight mode 657enter_low_hl_mode Xo Enter low highlight mode 658enter_right_hl_mode Xr Enter right highlight mode 659enter_top_hl_mode Xt Enter top highlight mode 660enter_vertical_hl_mode Xv Enter vertical highlight mode 661.Ed 662.Pp 663Obsolete termcap capabilities. 664New software should not rely on them at all. 665.Bd -literal 666\fBBoolean TCap Description\fR 667\fBVariables Code\fR 668linefeed_is_newline NL move down with ^J 669even_parity EP terminal requires even parity 670odd_parity OP terminal requires odd parity 671half_duplex HD terminal is half-duplex 672lower_case_only LC terminal has only lower case 673upper_case_only UC terminal has only upper case 674has_hardware_tabs pt has 8-char tabs invoked with ^I 675return_does_clr_eol xr return clears the line 676tek_4025_insert_line xx Tektronix 4025 insert-line glitch 677backspaces_with_bs bs uses ^H to move left 678crt_no_scrolling ns crt cannot scroll 679no_correctly_working_cr nc no way to go to start of line 680.Ed 681.Bd -literal 682\fBNumber TCap Description\fR 683\fBVariables Code\fR 684backspace_delay dB padding required for ^H 685form_feed_delay dF padding required for ^L 686horizontal_tab_delay dT padding required for ^I 687vertical_tab_delay dV padding required for ^V 688number_of_function_keys kn count of function keys 689carriage_return_delay dC pad needed for CR 690new_line_delay dN pad needed for LF 691.Ed 692.Bd -literal 693\fBString TCap Description\fR 694\fBVariables Code\fR 695other_non_function_keys ko list of self-mapped keycaps 696arrow_key_map ma map arrow keys 697memory_lock_above ml lock visible screen memory above the 698 current line 699memory_unlock mu unlock visible screen memory above the 700 current line 701linefeed_if_not_lf nl use to move down 702backspace_if_not_bs bc move left, if not ^H 703.Ed 704.Ss A Sample Entry 705The following entry, which describes the Concept\-100, is among the more 706complex entries in the 707.Nm 708file as of this writing. 709.Bd -literal 710ca\||\|concept100\||\|c100\||\|concept\||\|c104\||\|concept100-4p\||\|HDS Concept\-100:\e 711 :al=3*\eE^R:am:bl=^G:cd=16*\eE^C:ce=16\eE^U:cl=2*^L:cm=\eEa%+ %+ :\e 712 :co#80:.cr=9^M:db:dc=16\eE^A:dl=3*\eE^B:do=^J:ei=\eE\e200:eo:im=\eE^P:in:\e 713 :ip=16*:is=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200\eEo\e47\eE:k1=\eE5:\e 714 :k2=\eE6:k3=\eE7:kb=^h:kd=\eE<:ke=\eEx:kh=\eE?:kl=\eE>:kr=\eE=:ks=\eEX:\e 715 :ku=\eE;:le=^H:li#24:mb=\eEC:me=\eEN\e200:mh=\eEE:mi:mk=\eEH:mp=\eEI:\e 716 :mr=\eED:nd=\eE=:pb#9600:rp=0.2*\eEr%.%+ :se=\eEd\eEe:sf=^J:so=\eEE\eED:\e 717 :.ta=8\et:te=\eEv \e200\e200\e200\e200\e200\e200\eEp\er\en:\e 718 :ti=\eEU\eEv 8p\eEp\er:ue=\eEg:ul:up=\eE;:us=\eEG:\e 719 :vb=\eEk\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\eEK:\e 720 :ve=\eEw:vs=\eEW:vt#8:xn:\e 721 :bs:cr=^M:dC#9:dT#8:nl=^J:ta=^I:pt: 722.Ed 723.Pp 724Entries may continue onto multiple lines by giving a \e as the last 725character of a line, and empty fields 726may be included for readability (here between the last field on a line 727and the first field on the next). 728Comments may be included on lines beginning with 729.Dq # . 730.Ss Types of Capabilities 731Capabilities in 732.Nm 733are of three types: Boolean capabilities, 734which indicate particular features that the terminal has; 735numeric capabilities, 736giving the size of the display or the size of other attributes; 737and string capabilities, 738which give character sequences that can be used to perform particular 739terminal operations. 740All capabilities have two-letter codes. 741For instance, the fact that 742the Concept has 743.Em automatic margins 744(an automatic return and linefeed 745when the end of a line is reached) is indicated by the Boolean capability 746.Sy \&am . 747Hence the description of the Concept includes 748.Sy \&am . 749.Pp 750Numeric capabilities are followed by the character `#' then the value. 751In the example above 752.Sy \&co , 753which indicates the number of columns the display has, 754gives the value `80' for the Concept. 755.Pp 756Finally, string-valued capabilities, such as 757.Sy \&ce 758(clear-to-end-of-line 759sequence) are given by the two-letter code, an `=', then a string 760ending at the next following `:'. 761A delay in milliseconds may appear after 762the `=' in such a capability, 763which causes padding characters to be supplied by 764.Xr tputs 3 765after the remainder of the string is sent to provide this delay. 766The delay can be either a number, 767such as `20', or a number followed by 768an `*', 769such as `3*'. 770An `*' indicates that the padding required is proportional 771to the number of lines affected by the operation, and the amount given is 772the per-affected-line padding required. 773(In the case of insert-character, 774the factor is still the number of 775.Em lines 776affected; 777this is always 1 unless the terminal has 778.Sy \&in 779and the software uses it.) 780When an `*' is specified, it is sometimes useful to give a delay of the form 781`3.5' to specify a delay per line to tenths of milliseconds. 782(Only one decimal place is allowed.) 783.Pp 784A number of escape sequences are provided in the string-valued capabilities 785for easy encoding of control characters there. 786.Sy \&\eE 787maps to an 788.Dv ESC 789character, 790.Sy \&^X 791maps to a control-X for any appropriate X, 792and the sequences 793.Sy \&\en 794.Sy \&\er 795.Sy \&\et 796.Sy \&\eb 797.Sy \&\ef 798map to linefeed, return, tab, backspace, and formfeed, respectively. 799Finally, characters may be given as three octal digits after a 800.Sy \&\e , 801and the characters 802.Sy \&^ 803and 804.Sy \&\e 805may be given as 806.Sy \&\e^ 807and 808.Sy \&\e\e . 809If it is necessary to place a 810.Sy \&: 811in a capability it must be escaped as 812.Sy \e: 813or be encoded as 814.Sy \&\e072 . 815If it is necessary to place a 816.Dv NUL 817character in a string capability it 818must be encoded as 819.Sy \&\e200 . 820(The routines that deal with 821.Nm 822use C strings and strip the high bits of the output very late, so that 823a 824.Sy \&\e200 825comes out as a 826.Sy \&\e000 827would.) 828.Pp 829Sometimes individual capabilities must be commented out. 830To do this, put a period before the capability name. 831For example, see the first 832.Sy \&cr 833and 834.Sy \&ta 835in the example above. 836.Ss Preparing Descriptions 837The most effective way to prepare a terminal description is by imitating 838the description of a similar terminal in 839.Nm 840and to build up a description gradually, using partial descriptions 841with 842.Xr \&vi 1 843to check that they are correct. 844Be aware that a very unusual terminal may expose deficiencies in 845the ability of the 846.Nm 847file to describe it 848or bugs in 849.Xr \&vi 1 . 850To easily test a new terminal description you are working on 851you can put it in your home directory in a file called 852.Pa .termcap 853and programs will look there before looking in 854.Pa /usr/share/misc/termcap . 855You can also set the environment variable 856.Ev TERMPATH 857to a list of absolute file pathnames (separated by spaces or colons), 858one of which contains the description you are working on, 859and programs will search them in the order listed, and nowhere else. 860See 861.Xr termcap 3 . 862The 863.Ev TERMCAP 864environment variable is usually set to the 865.Nm 866entry itself 867to avoid reading files when starting up a program. 868.Pp 869To get the padding for insert-line right 870(if the terminal manufacturer did not document it), 871a severe test is to use 872.Xr \&vi 1 873to edit 874.Pa /etc/passwd 875at 9600 baud, delete roughly 16 lines from the middle of the screen, 876then hit the `u' key several times quickly. 877If the display messes up, more padding is usually needed. 878A similar test can be used for insert-character. 879.Ss Basic Capabilities 880The number of columns on each line of the display is given by the 881.Sy \&co 882numeric capability. 883If the display is a 884.Tn CRT , 885then the 886number of lines on the screen is given by the 887.Sy \&li 888capability. 889If the display wraps around to the beginning of the next line when 890the cursor reaches the right margin, then it should have the 891.Sy \&am 892capability. 893If the terminal can clear its screen, 894the code to do this is given by the 895.Sy \&cl 896string capability. 897If the terminal overstrikes 898(rather than clearing the position when a character is overwritten), 899it should have the 900.Sy \&os 901capability. 902If the terminal is a printing terminal, 903with no soft copy unit, 904give it both 905.Sy \&hc 906and 907.Sy \&os . 908.Pf ( Sy \&os 909applies to storage scope terminals, 910such as the Tektronix 4010 series, 911as well as to hard copy and 912.Tn APL 913terminals.) 914If there is a code to move the cursor to the left edge of the current row, 915give this as 916.Sy \&cr . 917(Normally this will be carriage-return, 918.Sy \&^M . ) 919If there is a code to produce an audible signal (bell, beep, 920etc.), 921give this as 922.Sy \&bl . 923.Pp 924If there is a code (such as backspace) 925to move the cursor one position to the left, 926that capability should be given as 927.Sy \&le . 928Similarly, 929codes to move to the right, up, and down 930should be given as 931.Sy \&nd , 932.Sy \&up , 933and 934.Sy \&do , 935respectively. 936These 937.Em local cursor motions 938should not alter the text they pass over; 939for example, you would not normally use 940.Dq nd=\ \& 941unless the terminal has the 942.Sy \&os 943capability, 944because the space would erase the character moved over. 945.Pp 946A very important point here is that the local cursor motions encoded 947in 948.Nm 949have undefined behavior at the left and top edges of a 950.Tn CRT 951display. 952Programs should never attempt to backspace around the left edge, 953unless 954.Sy \&bw 955is given, and never attempt to go up off the top 956using local cursor motions. 957.Pp 958In order to scroll text up, 959a program goes to the bottom left corner of the screen and sends the 960.Sy \&sf 961(index) string. 962To scroll text down, 963a program goes to the top left corner of the screen and sends the 964.Sy \&sr 965(reverse index) string. 966The strings 967.Sy \&sf 968and 969.Sy \&sr 970have undefined behavior 971when not on their respective corners of the screen. 972Parameterized versions of the scrolling sequences are 973.Sy \&SF 974and 975.Sy \&SR , 976which have the same semantics as 977.Sy \&sf 978and 979.Sy \&sr 980except that they take one parameter 981and scroll that many lines. 982They also have undefined behavior 983except at the appropriate corner of the screen. 984.Pp 985The 986.Sy \&am 987capability tells whether the cursor sticks at the right 988edge of the screen when text is output there, 989but this does not necessarily apply to 990.Sy \&nd 991from the last column. 992Leftward local motion is defined from the left edge only when 993.Sy \&bw 994is given; then an 995.Sy \&le 996from the left edge will move to the right edge of the previous row. 997This is useful for drawing a box around the edge of the screen, 998for example. 999If the terminal has switch-selectable automatic margins, 1000the 1001.Nm 1002description usually assumes that this feature is on, 1003.Em i.e . , 1004.Sy \&am . 1005If the terminal has a command 1006that moves to the first column of the next line, 1007that command can be given as 1008.Sy \&nw 1009(newline). 1010It is permissible for this to clear the remainder of the current line, 1011so if the terminal has no correctly-working 1012.Tn \&CR 1013and 1014.Tn \&LF 1015it may still be possible to craft a working 1016.Sy \&nw 1017out of one or both of them. 1018.Pp 1019These capabilities suffice to describe hardcopy and 1020.Dq glass-tty 1021terminals. 1022Thus the Teletype model 33 is described as 1023.Bd -literal -offset indent 1024T3\||\|tty33\||\|33\||\|tty\||\|Teletype model 33:\e 1025 :bl=^G:co#72:cr=^M:do=^J:hc:os: 1026.Ed 1027.Pp 1028and the Lear Siegler 1029.Tn ADM Ns \-3 1030is described as 1031.Bd -literal -offset indent 1032l3\||\|adm3\||\|3\||\|LSI ADM-3:\e 1033:am:bl=^G:cl=^Z:co#80:cr=^M:do=^J:le=^H:li#24:sf=^J: 1034.Ed 1035.Ss Parameterized Strings 1036Cursor addressing and other strings requiring parameters 1037are described by a 1038parameterized string capability, with 1039.Xr printf 3 Ns \-like 1040escapes 1041.Sy \&%x 1042in it, 1043while other characters are passed through unchanged. 1044For example, to address the cursor the 1045.Sy \&cm 1046capability is given, using two parameters: the row and column to move to. 1047(Rows and columns are numbered from zero and refer to the physical screen 1048visible to the user, not to any unseen memory. 1049If the terminal has memory-relative cursor addressing, 1050that can be indicated by an analogous 1051.Sy \&CM 1052capability.) 1053.Pp 1054The 1055.Sy \&% 1056encodings have the following meanings: 1057.Bl -column xxxxx 1058.It "%% output `%'" 1059.It "%d output value as in" 1060.Xr printf 3 1061%d 1062.It "%2 output value as in" 1063.Xr printf 3 1064%2d 1065.It "%3 output value as in" 1066.Xr printf 3 1067%3d 1068.It "%. output value as in" 1069.Xr printf 3 1070%c 1071.It "%+" Ns Em x Ta No add 1072.Em x 1073to value, then do %. 1074.It "%>" Ns Em \&xy Ta No if 1075value > 1076.Em x 1077then add 1078.Em y , 1079no output 1080.It "%r reverse order of two parameters, no output" 1081.It "%i increment by one, no output" 1082.It "%n exclusive-or all parameters with 0140 (Datamedia 2500)" 1083.It "\&%B" Ta Tn BCD No "(16*(value/10)) + (value%10), no output" 1084.It "%D Reverse coding (value \- 2*(value%16)), no output (Delta Data)." 1085.El 1086.Pp 1087Consider the Hewlett-Packard 2645, which, to get to row 3 and column 12, needs 1088to be sent 1089.Dq \eE&a12c03Y 1090padded for 6 milliseconds. 1091Note that the order 1092of the row and column coordinates is reversed here 1093and that the row and column 1094are sent as two-digit integers. 1095Thus its 1096.Sy \&cm 1097capability is 1098.Dq Li cm=6\eE&%r%2c%2Y . 1099.Pp 1100The Datamedia 2500 needs the current row and column sent 1101encoded in binary using 1102.Dq \&%. . 1103Terminals that use 1104.Dq %.\& 1105need to be able to 1106backspace the cursor 1107.Pq Sy \&le 1108and to move the cursor up one line on the screen 1109.Pq Sy \&up . 1110This is necessary because it is not always safe to transmit 1111.Sy \&\en , 1112.Sy \&^D , 1113and 1114.Sy \&\er , 1115as the system may change or discard them. 1116(Programs using 1117.Nm 1118must set terminal modes so that tabs are not expanded, so 1119.Sy \&\et 1120is safe to send. 1121This turns out to be essential for the Ann Arbor 4080.) 1122.Pp 1123A final example is the Lear Siegler 1124.Tn ADM Ns \-3a , 1125which offsets row and column 1126by a blank character, thus 1127.Dq Li cm=\eE=%+ %+\ \& . 1128.Pp 1129Row or column absolute cursor addressing 1130can be given as single parameter capabilities 1131.Sy \&ch 1132(horizontal position absolute) and 1133.Sy \&cv 1134(vertical position absolute). 1135Sometimes these are shorter than the more general two-parameter sequence 1136(as with the Hewlett-Packard 2645) and can be used in preference to 1137.Sy \&cm . 1138If there are parameterized local motions 1139.Pf ( Em e.g . , 1140move 1141.Ar n 1142positions to the right) 1143these can be given as 1144.Sy \&DO , 1145.Sy \&LE , 1146.Sy \&RI , 1147and 1148.Sy \&UP 1149with a single parameter indicating how many positions to move. 1150These are primarily useful if the terminal does not have 1151.Sy \&cm , 1152such as the Tektronix 4025. 1153.Ss Cursor Motions 1154If the terminal has a fast way to home the cursor 1155(to the very upper left corner of the screen), this can be given as 1156.Sy \&ho . 1157Similarly, a fast way of getting to the lower left-hand corner 1158can be given as 1159.Sy \&ll ; 1160this may involve going up with 1161.Sy \&up 1162from the home position, 1163but a program should never do this itself (unless 1164.Sy \&ll 1165does), because it can 1166make no assumption about the effect of moving up from the home position. 1167Note that the home position is the same as 1168cursor address (0,0): to the top left corner of the screen, not of memory. 1169(Therefore, the 1170.Dq \eEH 1171sequence on Hewlett-Packard terminals 1172cannot be used for 1173.Sy \&ho . ) 1174.Ss Area Clears 1175If the terminal can clear from the current position to the end of the 1176line, leaving the cursor where it is, this should be given as 1177.Sy \&ce . 1178If the terminal can clear from the current position to the end of the 1179display, this should be given as 1180.Sy \&cd . 1181.Sy \&cd 1182must only be invoked from the first column of a line. 1183(Therefore, 1184it can be simulated by a request to delete a large number of lines, 1185if a true 1186.Sy \&cd 1187is not available.) 1188.Ss Insert/Delete Line 1189If the terminal can open a new blank line 1190before the line containing the cursor, 1191this should be given as 1192.Sy \&al ; 1193this must be invoked only from the first 1194position of a line. 1195The cursor must then appear at the left of the newly blank line. 1196If the terminal can delete the line that the cursor is on, this 1197should be given as 1198.Sy \&dl ; 1199this must only be used from the first position on 1200the line to be deleted. 1201Versions of 1202.Sy \&al 1203and 1204.Sy \&dl 1205which take a single parameter 1206and insert or delete that many lines 1207can be given as 1208.Sy \&AL 1209and 1210.Sy \&DL . 1211If the terminal has a settable scrolling region 1212(like the VT100), 1213the command to set this can be described with the 1214.Sy \&cs 1215capability, 1216which takes two parameters: the top and bottom lines of the scrolling region. 1217The cursor position is, alas, undefined after using this command. 1218It is possible to get the effect of insert or delete line 1219using this command \(em the 1220.Sy \&sc 1221and 1222.Sy \&rc 1223(save and restore cursor) commands are also useful. 1224Inserting lines at the top or bottom of the screen can also be done using 1225.Sy \&sr 1226or 1227.Sy \&sf 1228on many terminals without a true insert/delete line, 1229and is often faster even on terminals with those features. 1230.Pp 1231If the terminal has the ability to define a window as part of memory 1232which all commands affect, it should be given as the parameterized string 1233.Sy \&wi . 1234The four parameters are the starting and ending lines in memory 1235and the starting and ending columns in memory, in that order. 1236(This 1237.Xr terminfo 5 1238capability is described for completeness. 1239It is unlikely that any 1240.Nm Ns \-using 1241program will support it.) 1242.Pp 1243If the terminal can retain display memory above the screen, then the 1244.Sy \&da 1245capability should be given; 1246if display memory can be retained 1247below, then 1248.Sy \&db 1249should be given. 1250These indicate 1251that deleting a line or scrolling may bring non-blank lines up from below 1252or that scrolling back with 1253.Sy \&sr 1254may bring down non-blank lines. 1255.Ss Insert/Delete Character 1256There are two basic kinds of intelligent terminals with respect to 1257insert/delete character that can be described using 1258.Nm . 1259The most common insert/delete character operations affect only the characters 1260on the current line and shift characters off the end of the line rigidly. 1261Other terminals, such as the Concept\-100 and the Perkin Elmer Owl, make 1262a distinction between typed and untyped blanks on the screen, shifting 1263upon an insert or delete only to an untyped blank on the screen which is 1264either eliminated or expanded to two untyped blanks. 1265You can determine 1266the kind of terminal you have by clearing the screen then typing 1267text separated by cursor motions. 1268Type 1269.Dq Li abc\ \ \ \ def 1270using local 1271cursor motions (not spaces) between the 1272.Dq abc 1273and the 1274.Dq def . 1275Then position the cursor before the 1276.Dq abc 1277and put the terminal in insert 1278mode. 1279If typing characters causes the rest of the line to shift 1280rigidly and characters to fall off the end, then your terminal does 1281not distinguish between blanks and untyped positions. 1282If the 1283.Dq abc 1284shifts over to the 1285.Dq def 1286which then move together around the end of the 1287current line and onto the next as you insert, then you have the second type of 1288terminal and should give the capability 1289.Sy \&in , 1290which stands for 1291.Dq insert null . 1292While these are two logically separate attributes 1293(one line 1294.Em \&vs . 1295multi-line insert mode, 1296and special treatment of untyped spaces), 1297we have seen no terminals whose insert 1298mode cannot be described with the single attribute. 1299.Pp 1300The 1301.Nm 1302entries can describe both terminals that have an insert mode and terminals 1303that send a simple sequence to open a blank position on the current line. 1304Give as 1305.Sy \&im 1306the sequence to get into insert mode. 1307Give as 1308.Sy \&ei 1309the sequence to leave insert mode. 1310Now give as 1311.Sy \&ic 1312any sequence that needs to be sent just before 1313each character to be inserted. 1314Most terminals with a true insert mode 1315will not give 1316.Sy \&ic ; 1317terminals that use a sequence to open a screen 1318position should give it here. 1319(If your terminal has both, 1320insert mode is usually preferable to 1321.Sy \&ic . 1322Do not give both unless the terminal actually requires both to be used 1323in combination.) 1324If post-insert padding is needed, give this as a number of milliseconds 1325in 1326.Sy \&ip 1327(a string option). 1328Any other sequence that may need to be 1329sent after insertion of a single character can also be given in 1330.Sy \&ip . 1331If your terminal needs to be placed into an `insert mode' 1332and needs a special code preceding each inserted character, 1333then both 1334.Sy \&im Ns / Sy \&ei 1335and 1336.Sy \&ic 1337can be given, and both will be used. 1338The 1339.Sy \&IC 1340capability, with one parameter 1341.Em n , 1342will repeat the effects of 1343.Sy \&ic 1344.Em n 1345times. 1346.Pp 1347It is occasionally necessary to move around while in insert mode 1348to delete characters on the same line 1349.Pf ( Em e.g . , 1350if there is a tab after 1351the insertion position). 1352If your terminal allows motion while in 1353insert mode, you can give the capability 1354.Sy \&mi 1355to speed up inserting 1356in this case. 1357Omitting 1358.Sy \&mi 1359will affect only speed. 1360Some terminals 1361(notably Datamedia's) must not have 1362.Sy \&mi 1363because of the way their 1364insert mode works. 1365.Pp 1366Finally, you can specify 1367.Sy \&dc 1368to delete a single character, 1369.Sy \&DC 1370with one parameter 1371.Em n 1372to delete 1373.Em n 1374characters, 1375and delete mode by giving 1376.Sy \&dm 1377and 1378.Sy \&ed 1379to enter and exit delete mode 1380(which is any mode the terminal needs to be placed in for 1381.Sy \&dc 1382to work). 1383.Ss Highlighting, Underlining, and Visible Bells 1384If your terminal has one or more kinds of display attributes, 1385these can be represented in a number of different ways. 1386You should choose one display form as 1387.Em standout mode , 1388representing a good high-contrast, easy-on-the-eyes format 1389for highlighting error messages and other attention getters. 1390(If you have a choice, reverse video plus half-bright is good, 1391or reverse video alone.) 1392The sequences to enter and exit standout mode 1393are given as 1394.Sy \&so 1395and 1396.Sy \&se , 1397respectively. 1398If the code to change into or out of standout 1399mode leaves one or even two blank spaces or garbage characters on the screen, 1400as the 1401.Tn TVI 1402912 and Teleray 1061 do, 1403then 1404.Sy \&sg 1405should be given to tell how many characters are left. 1406.Pp 1407Codes to begin underlining and end underlining can be given as 1408.Sy \&us 1409and 1410.Sy \&ue , 1411respectively. 1412Underline mode change garbage is specified by 1413.Sy \&ug , 1414similar to 1415.Sy \&sg . 1416If the terminal has a code to underline the current character and move 1417the cursor one position to the right, 1418such as the Microterm Mime, 1419this can be given as 1420.Sy \&uc . 1421.Pp 1422Other capabilities to enter various highlighting modes include 1423.Sy \&mb 1424(blinking), 1425.Sy \&md 1426(bold or extra bright), 1427.Sy \&mh 1428(dim or half-bright), 1429.Sy \&mk 1430(blanking or invisible text), 1431.Sy \&mp 1432(protected), 1433.Sy \&mr 1434(reverse video), 1435.Sy \&me 1436(turn off 1437.Em all 1438attribute modes), 1439.Sy \&as 1440(enter alternate character set mode), and 1441.Sy \&ae 1442(exit alternate character set mode). 1443Turning on any of these modes singly may or may not turn off other modes. 1444.Pp 1445If there is a sequence to set arbitrary combinations of mode, 1446this should be given as 1447.Sy \&sa 1448(set attributes), taking 9 parameters. 1449Each parameter is either 0 or 1, 1450as the corresponding attributes is on or off. 1451The 9 parameters are, in order: standout, underline, reverse, blink, 1452dim, bold, blank, protect, and alternate character set. 1453Not all modes need be supported by 1454.Sy \&sa , 1455only those for which corresponding attribute commands exist. 1456(It is unlikely that a 1457.Nm Ns \-using 1458program will support this capability, which is defined for compatibility 1459with 1460.Xr terminfo 5 . ) 1461.Pp 1462Terminals with the 1463.Dq magic cookie 1464glitches 1465.Pf ( Sy \&sg 1466and 1467.Sy \&ug ) , 1468rather than maintaining extra attribute bits for each character cell, 1469instead deposit special 1470.Dq cookies , 1471or 1472.Dq garbage characters , 1473when they receive mode-setting sequences, 1474which affect the display algorithm. 1475.Pp 1476Some terminals, 1477such as the Hewlett-Packard 2621, 1478automatically leave standout 1479mode when they move to a new line or when the cursor is addressed. 1480Programs using standout mode 1481should exit standout mode on such terminals 1482before moving the cursor or sending a newline. 1483On terminals where this is not a problem, 1484the 1485.Sy \&ms 1486capability should be present 1487to say that this overhead is unnecessary. 1488.Pp 1489If the terminal has 1490a way of flashing the screen to indicate an error quietly 1491(a bell replacement), 1492this can be given as 1493.Sy \&vb ; 1494it must not move the cursor. 1495.Pp 1496If the cursor needs to be made more visible than normal 1497when it is not on the bottom line 1498(to change, for example, a non-blinking underline into an easier-to-find 1499block or blinking underline), 1500give this sequence as 1501.Sy \&vs . 1502If there is a way to make the cursor completely invisible, give that as 1503.Sy \&vi . 1504The capability 1505.Sy \&ve , 1506which undoes the effects of both of these modes, 1507should also be given. 1508.Pp 1509If your terminal correctly displays underlined characters 1510(with no special codes needed) 1511even though it does not overstrike, 1512then you should give the capability 1513.Sy \&ul . 1514If overstrikes are erasable with a blank, 1515this should be indicated by giving 1516.Sy \&eo . 1517.Ss Keypad 1518If the terminal has a keypad that transmits codes when the keys are pressed, 1519this information can be given. 1520Note that it is not possible to handle 1521terminals where the keypad only works in local mode 1522(this applies, for example, to the unshifted Hewlett-Packard 2621 keys). 1523If the keypad can be set to transmit or not transmit, 1524give these codes as 1525.Sy \&ks 1526and 1527.Sy \&ke . 1528Otherwise the keypad is assumed to always transmit. 1529The codes sent by the left-arrow, right-arrow, up-arrow, down-arrow, 1530and home keys can be given as 1531.Sy \&kl , 1532.Sy \&kr , 1533.Sy \&ku , 1534.Sy \&kd , 1535and 1536.Sy \&kh , 1537respectively. 1538If there are function keys such as f0, f1, ..., f9, the codes they send 1539can be given as 1540.Sy \&k0 , 1541.Sy \&k1 , 1542\&..., 1543.Sy \&k9 . 1544If these keys have labels other than the default f0 through f9, the labels 1545can be given as 1546.Sy \&l0 , 1547.Sy \&l1 , 1548\&..., 1549.Sy \&l9 . 1550The codes transmitted by certain other special keys can be given: 1551.Sy \&kH 1552(home down), 1553.Sy \&kb 1554(backspace), 1555.Sy \&ka 1556(clear all tabs), 1557.Sy \&kt 1558(clear the tab stop in this column), 1559.Sy \&kC 1560(clear screen or erase), 1561.Sy \&kD 1562(delete character), 1563.Sy \&kL 1564(delete line), 1565.Sy \&kM 1566(exit insert mode), 1567.Sy \&kE 1568(clear to end of line), 1569.Sy \&kS 1570(clear to end of screen), 1571.Sy \&kI 1572(insert character or enter insert mode), 1573.Sy \&kA 1574(insert line), 1575.Sy \&kN 1576(next page), 1577.Sy \&kP 1578(previous page), 1579.Sy \&kF 1580(scroll forward/down), 1581.Sy \&kR 1582(scroll backward/up), and 1583.Sy \&kT 1584(set a tab stop in this column). 1585In addition, if the keypad has a 3 by 3 array of keys 1586including the four arrow keys, then the other five keys can be given as 1587.Sy \&K1 , 1588.Sy \&K2 , 1589.Sy \&K3 , 1590.Sy \&K4 , 1591and 1592.Sy \&K5 . 1593These keys are useful when the effects of a 3 by 3 directional pad are needed. 1594The obsolete 1595.Sy \&ko 1596capability formerly used to describe 1597.Dq other 1598function keys has been 1599completely supplanted by the above capabilities. 1600.Pp 1601The 1602.Sy \&ma 1603entry is also used to indicate arrow keys on terminals that have 1604single-character arrow keys. 1605It is obsolete but still in use in 1606version 2 of 1607.Sy \&vi 1608which must be run on some minicomputers due to 1609memory limitations. 1610This field is redundant with 1611.Sy \&kl , 1612.Sy \&kr , 1613.Sy \&ku , 1614.Sy \&kd , 1615and 1616.Sy \&kh . 1617It consists of groups of two characters. 1618In each group, the first character is what an arrow key sends, and the 1619second character is the corresponding 1620.Sy \&vi 1621command. 1622These commands are 1623.Ar h 1624for 1625.Sy \&kl , 1626.Ar j 1627for 1628.Sy \&kd , 1629.Ar k 1630for 1631.Sy \&ku , 1632.Ar l 1633for 1634.Sy \&kr , 1635and 1636.Ar H 1637for 1638.Sy \&kh . 1639For example, the Mime would have 1640.Dq Li ma=^Hh^Kj^Zk^Xl 1641indicating arrow keys left (^H), down (^K), up (^Z), and right (^X). 1642(There is no home key on the Mime.) 1643.Ss Tabs and Initialization 1644If the terminal needs to be in a special mode when running 1645a program that uses these capabilities, 1646the codes to enter and exit this mode can be given as 1647.Sy \&ti 1648and 1649.Sy \&te . 1650This arises, for example, from terminals like the Concept with more than 1651one page of memory. 1652If the terminal has only memory-relative cursor addressing and not 1653screen-relative cursor addressing, 1654a screen-sized window must be fixed into 1655the display for cursor addressing to work properly. 1656This is also used for the Tektronix 4025, where 1657.Sy \&ti 1658sets the command character to be the one used by 1659.Nm . 1660.Pp 1661Other capabilities 1662include 1663.Sy \&is , 1664an initialization string for the terminal, 1665and 1666.Sy \&if , 1667the name of a file containing long initialization strings. 1668These strings are expected to set the terminal into modes 1669consistent with the rest of the 1670.Nm 1671description. 1672They are normally sent to the terminal by the 1673.Xr tset 1 1674program each time the user logs in. 1675They will be printed in the following order: 1676.Sy \&is ; 1677setting tabs using 1678.Sy \&ct 1679and 1680.Sy \&st ; 1681and finally 1682.Sy \&if . 1683.Pf ( Xr Terminfo 1684uses 1685.Sy \&i\&1-i2 1686instead of 1687.Sy \&is 1688and runs the program 1689.Sy \&iP 1690and prints 1691.Sy "\&i\&3" 1692after the other initializations.) 1693A pair of sequences that does a harder reset from a totally unknown state 1694can be analogously given as 1695.Sy \&rs 1696and 1697.Sy \&if . 1698These strings are output by the 1699.Xr reset 1 1700program, which is used when the terminal gets into a wedged state. 1701.Pf ( Xr Terminfo 1702uses 1703.Sy "\&r1-r3" 1704instead of 1705.Sy \&rs . ) 1706Commands are normally placed in 1707.Sy \&rs 1708and 1709.Sy \&rf 1710only if they produce annoying effects on the screen and are not necessary 1711when logging in. 1712For example, the command to set the VT100 into 80-column mode 1713would normally be part of 1714.Sy \&is , 1715but it causes an annoying glitch of the screen and is not normally needed 1716since the terminal is usually already in 80-column mode. 1717.Pp 1718If the terminal has hardware tabs, 1719the command to advance to the next tab stop can be given as 1720.Sy \&ta 1721(usually 1722.Sy \&^I ) . 1723A 1724.Dq backtab 1725command which moves leftward to the previous tab stop 1726can be given as 1727.Sy \&bt . 1728By convention, 1729if the terminal driver modes indicate that tab stops are being expanded 1730by the computer rather than being sent to the terminal, 1731programs should not use 1732.Sy \&ta 1733or 1734.Sy \&bt 1735even if they are present, 1736since the user may not have the tab stops properly set. 1737If the terminal has hardware tabs that are initially set every 1738.Ar n 1739positions when the terminal is powered up, then the numeric parameter 1740.Sy \&it 1741is given, showing the number of positions between tab stops. 1742This is normally used by the 1743.Xr tset 1 1744command to determine whether to set the driver mode for hardware tab 1745expansion, and whether to set the tab stops. 1746If the terminal has tab stops that can be saved in nonvolatile memory, the 1747.Nm 1748description can assume that they are properly set. 1749.Pp 1750If there are commands to set and clear tab stops, they can be given as 1751.Sy \&ct 1752(clear all tab stops) and 1753.Sy \&st 1754(set a tab stop in the current column of every row). 1755If a more complex sequence is needed to set the tabs than can be 1756described by this, the sequence can be placed in 1757.Sy \&is 1758or 1759.Sy \&if . 1760.Ss Delays 1761Certain capabilities control padding in the terminal driver. 1762These are primarily needed by hardcopy terminals and are used by the 1763.Xr tset 1 1764program to set terminal driver modes appropriately. 1765Delays embedded in the capabilities 1766.Sy \&cr , 1767.Sy \&sf , 1768.Sy \&le , 1769.Sy \&ff , 1770and 1771.Sy \&ta 1772will cause the appropriate delay bits to be set in the terminal driver. 1773If 1774.Sy \&pb 1775(padding baud rate) is given, these values can be ignored at baud rates 1776below the value of 1777.Sy \&pb . 1778For 1779.Bx 4.2 1780.Xr tset 1 , 1781the delays are given as numeric capabilities 1782.Sy \&dC , 1783.Sy \&dN , 1784.Sy \&dB , 1785.Sy \&dF , 1786and 1787.Sy \&dT 1788instead. 1789.Ss Miscellaneous 1790If the terminal requires other than a 1791.Dv NUL 1792(zero) character as a pad, 1793this can be given as 1794.Sy \&pc . 1795Only the first character of the 1796.Sy \&pc 1797string is used. 1798.Pp 1799If the terminal has commands to save and restore the position of the 1800cursor, give them as 1801.Sy \&sc 1802and 1803.Sy \&rc . 1804.Pp 1805If the terminal has an extra 1806.Dq status line 1807that is not normally used by 1808software, this fact can be indicated. 1809If the status line is viewed as an extra line below the bottom line, 1810then the capability 1811.Sy \&hs 1812should be given. 1813Special strings to go to a position in the status line and to return 1814from the status line can be given as 1815.Sy \&ts 1816and 1817.Sy \&fs . 1818.Pf ( Sy \&fs 1819must leave the cursor position in the same place that it was before 1820.Sy \&ts . 1821If necessary, the 1822.Sy \&sc 1823and 1824.Sy \&rc 1825strings can be included in 1826.Sy \&ts 1827and 1828.Sy \&fs 1829to get this effect.) 1830The capability 1831.Sy \&ts 1832takes one parameter, which is the column number of the status line 1833to which the cursor is to be moved. 1834If escape sequences and other special commands such as tab work while in 1835the status line, the flag 1836.Sy \&es 1837can be given. 1838A string that turns off the status line (or otherwise erases its contents) 1839should be given as 1840.Sy \&ds . 1841The status line is normally assumed to be the same width as the 1842rest of the screen, 1843.Em i.e . , 1844.Sy \&co . 1845If the status line is a different width (possibly because the terminal 1846does not allow an entire line to be loaded), then its width in columns 1847can be indicated with the numeric parameter 1848.Sy \&ws . 1849.Pp 1850If the terminal can move up or down half a line, this can be 1851indicated with 1852.Sy \&hu 1853(half-line up) and 1854.Sy \&hd 1855(half-line down). 1856This is primarily useful for superscripts and subscripts on hardcopy 1857terminals. 1858If a hardcopy terminal can eject to the next page (form feed), 1859give this as 1860.Sy \&ff 1861(usually 1862.Sy \&^L ) . 1863.Pp 1864If there is a command to repeat a given character a given number of times 1865(to save time transmitting a large number of identical characters), 1866this can be indicated with the parameterized string 1867.Sy \&rp . 1868The first parameter is the character to be repeated and the second is 1869the number of times to repeat it. 1870(This is a 1871.Xr terminfo 5 1872feature that is unlikely to be supported by a program that uses 1873.Nm . ) 1874.Pp 1875If the terminal has a settable command character, such as the 1876Tektronix 4025, this can be indicated with 1877.Sy \&CC . 1878A prototype command character is chosen which is used in all capabilities. 1879This character is given in the 1880.Sy \&CC 1881capability to identify it. 1882The following convention is supported on some 1883.Ux 1884systems: 1885The environment is to be searched for a 1886.Ev \&CC 1887variable, 1888and if found, 1889all occurrences of the prototype character are replaced by the character 1890in the environment variable. 1891This use of the 1892.Ev \&CC 1893environment variable 1894is a very bad idea, as it conflicts with 1895.Xr make 1 . 1896.Pp 1897Terminal descriptions that do not represent a specific kind of known 1898terminal, such as 1899.Em switch , 1900.Em dialup , 1901.Em patch , 1902and 1903.Em network , 1904should include the 1905.Sy \&gn 1906(generic) capability so that programs can complain that they do not know 1907how to talk to the terminal. 1908(This capability does not apply to 1909.Em virtual 1910terminal descriptions for which the escape sequences are known.) 1911.Pp 1912If the terminal uses xoff/xon 1913.Pq Tn DC3 Ns / Ns Tn DC1 1914handshaking for flow control, give 1915.Sy \&xo . 1916Padding information should still be included so that routines can make 1917better decisions about costs, but actual pad characters will not be 1918transmitted. 1919.Pp 1920If the terminal has a 1921.Dq meta key 1922which acts as a shift key, setting the 19238th bit of any character transmitted, then this fact can be indicated with 1924.Sy \&km . 1925Otherwise, software will assume that the 8th bit is parity and it will 1926usually be cleared. 1927If strings exist to turn this 1928.Dq meta mode 1929on and off, they can be given as 1930.Sy \&mm 1931and 1932.Sy \&mo . 1933.Pp 1934If the terminal has more lines of memory than will fit on the screen at once, 1935the number of lines of memory can be indicated with 1936.Sy \&lm . 1937An explicit value of 0 indicates that the number of lines is not fixed, 1938but that there is still more memory than fits on the screen. 1939.Pp 1940If the terminal is one of those supported by the 1941.Ux 1942system virtual 1943terminal protocol, the terminal number can be given as 1944.Sy \&vt . 1945.Pp 1946Media copy strings which control an auxiliary printer 1947connected to the terminal can be given as 1948.Sy \&ps : 1949print the contents of the screen; 1950.Sy \&pf : 1951turn off the printer; and 1952.Sy \&po : 1953turn on the printer. 1954When the printer is on, all text sent to the terminal will be sent to the 1955printer. 1956It is undefined whether the text is also displayed on the terminal screen 1957when the printer is on. 1958A variation 1959.Sy \&pO 1960takes one parameter and leaves the printer on for as many characters as the 1961value of the parameter, then turns the printer off. 1962The parameter should not exceed 255. 1963All text, including 1964.Sy \&pf , 1965is transparently passed to the printer while 1966.Sy \&pO 1967is in effect. 1968.Pp 1969Strings to program function keys can be given as 1970.Sy \&pk , 1971.Sy \&pl , 1972and 1973.Sy \&px . 1974Each of these strings takes two parameters: the function key number 1975to program (from 0 to 9) and the string to program it with. 1976Function key numbers out of this range may program undefined keys 1977in a terminal-dependent manner. 1978The differences among the capabilities are that 1979.Sy \&pk 1980causes pressing the given key to be the same as the user typing the given 1981string; 1982.Sy \&pl 1983causes the string to be executed by the terminal in local mode; 1984and 1985.Sy \&px 1986causes the string to be transmitted to the computer. 1987Unfortunately, due to lack of a definition for string parameters in 1988.Nm , 1989only 1990.Xr terminfo 5 1991supports these capabilities. 1992.Pp 1993For the 1994.Xr xterm 1 Pq Pa ports/x11/xterm 1995terminal emulator the traditional behavior in 1996.Fx 1997when exiting a pager such as 1998.Xr less 1 1999or 2000.Xr more 1 , 2001or an editor such as 2002.Xr vi 1 2003is 2004.Em NOT 2005to clear the screen after the program exits. 2006If you prefer to clear the screen there are a number of 2007.Dq xterm-clear 2008entries that add this capability in the 2009.Nm 2010file that you can use directly, or as examples. 2011.Ss Glitches and Braindamage 2012Hazeltine terminals, which do not allow `~' characters to be displayed, 2013should indicate 2014.Sy \&hz . 2015.Pp 2016The 2017.Sy \&nc 2018capability, now obsolete, formerly indicated Datamedia terminals, 2019which echo 2020.Sy \&\er \en 2021for 2022carriage return then ignore a following linefeed. 2023.Pp 2024Terminals that ignore a linefeed immediately after an 2025.Sy \&am 2026wrap, such as the Concept, should indicate 2027.Sy \&xn . 2028.Pp 2029If 2030.Sy \&ce 2031is required to get rid of standout 2032(instead of merely writing normal text on top of it), 2033.Sy \&xs 2034should be given. 2035.Pp 2036Teleray terminals, where tabs turn all characters moved over to blanks, 2037should indicate 2038.Sy \&xt 2039(destructive tabs). 2040This glitch is also taken to mean that it is not possible 2041to position the cursor on top of a 2042.Dq magic cookie , 2043and that 2044to erase standout mode it is necessary to use delete and insert line. 2045.Pp 2046The Beehive Superbee, which is unable to correctly transmit the 2047.Dv ESC 2048or 2049.Sy \&^C 2050characters, has 2051.Sy \&xb , 2052indicating that the 2053.Dq \&f\&1 2054key is used for 2055.Dv ESC 2056and 2057.Dq \&f\&2 2058for ^C. 2059(Only certain Superbees have this problem, depending on the 2060.Tn ROM . ) 2061.Pp 2062Other specific terminal problems may be corrected by adding more 2063capabilities of the form 2064.Sy x Ns Em x . 2065.Ss Similar Terminals 2066If there are two very similar terminals, 2067one can be defined as being just like the other with certain exceptions. 2068The string capability 2069.Sy \&tc 2070can be given 2071with the name of the similar terminal. 2072This capability must be 2073.Em last , 2074and the combined length of the entries 2075must not exceed 1024. 2076The capabilities given before 2077.Sy \&tc 2078override those in the terminal type invoked by 2079.Sy \&tc . 2080A capability can be canceled by placing 2081.Sy \&xx@ 2082to the left of the 2083.Sy \&tc 2084invocation, where 2085.Sy \&xx 2086is the capability. 2087For example, the entry 2088.Bd -literal -offset indent 2089hn\||\|2621\-nl:ks@:ke@:tc=2621: 2090.Ed 2091.Pp 2092defines a 2093.Dq 2621\-nl 2094that does not have the 2095.Sy \&ks 2096or 2097.Sy \&ke 2098capabilities, 2099hence does not turn on the function key labels when in visual mode. 2100This is useful for different modes for a terminal, or for different 2101user preferences. 2102.Sh FILES 2103.Bl -tag -width /usr/share/misc/termcap.db -compact 2104.It Pa /usr/share/misc/termcap 2105File containing terminal descriptions. 2106.It Pa /usr/share/misc/termcap.db 2107Hash database file containing terminal descriptions (see 2108.Xr cap_mkdb 1 ) . 2109.El 2110.Sh SEE ALSO 2111.Xr cap_mkdb 1 , 2112.Xr ex 1 , 2113.Xr more 1 , 2114.Xr tset 1 , 2115.Xr ul 1 , 2116.Xr vi 1 , 2117.Xr xterm 1 Pq Pa ports/x11/xterm , 2118.Xr ncurses 3 , 2119.Xr printf 3 , 2120.Xr termcap 3 , 2121.Xr term 5 2122.Sh CAVEATS AND BUGS 2123The 2124.Em Note : 2125.Nm 2126functions 2127were replaced by 2128.Xr terminfo 5 2129in 2130.At V 2131Release 2.0. 2132The transition will be relatively painless if capabilities flagged as 2133.Dq obsolete 2134are avoided. 2135.Pp 2136Lines and columns are now stored by the kernel as well as in the termcap 2137entry. 2138Most programs now use the kernel information primarily; the information 2139in this file is used only if the kernel does not have any information. 2140.Pp 2141The 2142.Xr \&vi 1 2143program allows only 256 characters for string capabilities, and the routines 2144in 2145.Xr termlib 3 2146do not check for overflow of this buffer. 2147The total length of a single entry (excluding only escaped newlines) 2148may not exceed 1024. 2149.Pp 2150Not all programs support all entries. 2151.Sh HISTORY 2152The 2153.Nm 2154file format appeared in 2155.Bx 3 . 2156