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