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