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