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