home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume1 / pcurses / part03 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  50.0 KB

  1. Subject:  Terminfo/Curses Part 3 of 11
  2.  
  3. : Run this shell script with "sh" not "csh"
  4. PATH=:/bin:/usr/bin:/usr/ucb
  5. export PATH
  6. if test ! -d =doc
  7. then
  8.     echo 'Making directory "=doc"'
  9.     mkdir =doc
  10. fi
  11. echo 'x - =doc/term.5'
  12. sed 's/^X//' <<'//go.sysin dd *' >=doc/term.5
  13. X.TH TERM 5
  14. X.SH NAME
  15. term \- format of compiled term file.
  16. X.SH SYNOPSIS
  17. X.B term
  18. X.SH DESCRIPTION
  19. X.PP
  20. Compiled terminfo descriptions are placed under the directory /etc/term.
  21. In order to avoid a linear search of a huge UNIX directory, a two
  22. level scheme is used: /etc/term/c/name
  23. where
  24. X.B name
  25. is the name of the terminal, and
  26. X.B c
  27. is the first character of
  28. X.BR name .
  29. Thus,
  30. X.B act4
  31. can be found in the file ``/etc/term/a/act4''.
  32. Synonyms for the same terminal are implemented by multiple
  33. links to the same compiled file.
  34. X.PP
  35. The format has been chosen so that it will be the same on all hardware.
  36. An 8 or more bit byte is assumed, but no assumptions about byte ordering
  37. or sign extension are made.
  38. X.PP
  39. The compiled file is created with the
  40. X.I compile
  41. program, and read by the routine
  42. X.IR setupterm .
  43. Both of these pieces of software are part of
  44. X.IR curses (3).
  45. The file is divided into six parts:
  46. the header,
  47. terminal names,
  48. boolean flags,
  49. numbers,
  50. strings,
  51. and
  52. string table.
  53. X.PP
  54. The header section begins the file.
  55. This section contains six short integers in the format
  56. described below.
  57. These integers are
  58. (1) the magic number (octal 0432);
  59. (2) the size, in bytes, of the names section;
  60. (3) the number of bytes in the boolean section;
  61. (4) the number of short integers in the numbers section;
  62. (5) the number of offsets (short integers) in the strings section;
  63. (6) the size, in bytes, of the string table.
  64. X.PP
  65. Short integers are stored in two 8 bit bytes.
  66. The first byte contains the least significant 8 bits of the value,
  67. and the second byte contains the most significant 8 bits.
  68. (Thus, the value represented is 256*second+first.)
  69. The value \-1 is represented by 0377, 0377, other negative
  70. value are illegal.
  71. \-1 generally means that a capability is missing from this terminal.
  72. Note that this format corresponds to the hardware of the VAX and PDP-11.
  73. Machines where this does not correspond to the hardware read the
  74. integers as two bytes and compute the result.
  75. X.PP
  76. The terminal names section comes next.
  77. It contains the first line of the terminfo description,
  78. listing the various names for the terminal,
  79. separated by the `|' character.
  80. The section is terminated with an ASCII NUL character.
  81. X.PP
  82. The boolean flags have one byte for each flag.
  83. This byte is either 0 or 1 as the flag is present or absent.
  84. The capabilities are in the same order as the file <term.h>.
  85. X.PP
  86. Between the boolean section and the number section,
  87. a null byte will be inserted, if necessary,
  88. to ensure that the number section begins on an even byte.
  89. All short integers are aligned on a short word boundary.
  90. X.PP
  91. The numbers section is similar to the flags section.
  92. Each capability takes up two bytes,
  93. and is stored as a short integer.
  94. If the value represented is \-1, the capability is taken to be missing.
  95. X.PP
  96. The strings section is also similar.
  97. Each capability is stored as a short integer, in the format above.
  98. A value of \-1 means the capability is missing.
  99. Otherwise, the value is taken as an offset from the beginning
  100. of the string table.
  101. Special characters in ^X or \ec notation are stored in their
  102. interpreted form, not the printing representation.
  103. Padding information $<nn> and parameter information %x are
  104. stored intact in uninterpreted form.
  105. X.PP
  106. The final section is the string table.
  107. It contains all the values of string capabilities referenced in
  108. the string section.
  109. Each string is null terminated.
  110. X.PP
  111. Note that it is possible for
  112. X.I setupterm
  113. to expect a different set of capabilities
  114. than are actually present in the file.
  115. Either the database may have been updated since
  116. X.I setupterm
  117. has been recompiled
  118. (resulting in extra unrecognized entries in the file)
  119. or the program may have been recompiled more recently
  120. than the database was updated
  121. (resulting in missing entries).
  122. X.I setupterm
  123. must be prepared for both possibilities \-
  124. this is why the numbers and sizes are included.
  125. Also, new capabilities must always be added at the end of the lists
  126. of boolean, number, and string capabilities.
  127. X.PP
  128. As an example, an octal dump of the description for the Microterm ACT 4
  129. is included:
  130. X.nf
  131. X.sp
  132. microterm|act4|microterm act iv,
  133.     cr=^M, cud1=^J, ind=^J, bel=^G, am, cub1=^H,
  134.     ed=^_, el=^^, clear=^L, cup=^T%p1%c%p2%c,
  135.     cols#80, lines#24, cuf1=^X, cuu1=^Z, home=^],
  136. X.sp
  137. X.in 0
  138. X.ft CW
  139. 000 032 001      \e0 025  \e0  \eb  \e0 212  \e0   "  \e0   m   i   c   r
  140. 020   o   t   e   r   m   |   a   c   t   4   |   m   i   c   r   o
  141. 040   t   e   r   m       a   c   t       i   v  \e0  \e0 001  \e0  \e0
  142. 060  \e0  \e0  \e0  \e0  \e0  \e0  \e0  \e0  \e0  \e0  \e0  \e0  \e0  \e0  \e0  \e0
  143. 100  \e0  \e0   P  \e0 377 377 030  \e0 377 377 377 377 377 377 377 377
  144. 120 377 377 377 377  \e0  \e0 002  \e0 377 377 377 377 004  \e0 006  \e0
  145. 140  \eb  \e0 377 377 377 377  \en  \e0 026  \e0 030  \e0 377 377 032  \e0
  146. 160 377 377 377 377 034  \e0 377 377 036  \e0 377 377 377 377 377 377
  147. 200 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
  148. *
  149. 520 377 377 377 377      \e0 377 377 377 377 377 377 377 377 377 377
  150. 540 377 377 377 377 377 377 007  \e0  \er  \e0  \ef  \e0 036  \e0 037  \e0
  151. 560 024   %   p   1   %   c   %   p   2   %   c  \e0  \en  \e0 035  \e0
  152. 600  \eb  \e0 030  \e0 032  \e0  \en  \e0
  153. X.ft R
  154. X.fi
  155. X.PP
  156. Some limitations: total compiled entries cannot exceed 4096 bytes.
  157. The name field cannot exceed 128 bytes.
  158. X.SH FILES
  159. X/etc/term/*/*    compiled terminal capability data base
  160. X.SH "SEE ALSO"
  161. terminfo(5), curses(3)
  162. //go.sysin dd *
  163. echo 'x - =doc/terminfo.5'
  164. sed 's/^X//' <<'//go.sysin dd *' >=doc/terminfo.5
  165. X.tr ||
  166. X.TH TERMINFO 5 8/16/82
  167. X.UC 4
  168. X.SH NAME
  169. terminfo \- terminal capability data base
  170. X.SH SYNOPSIS
  171. X/etc/terminfo
  172. X.SH DESCRIPTION
  173. X.I Terminfo
  174. is a data base describing terminals.
  175. It is used, for example, by
  176. X.IR vi (1)
  177. and
  178. X.IR curses (3).
  179. Terminals are described in
  180. X.I terminfo
  181. by giving a set of capabilities which they have and by describing
  182. how operations are performed.
  183. Padding requirements and initialization sequences
  184. are included in
  185. X.I terminfo.
  186. X.PP
  187. Entries in
  188. X.I terminfo
  189. consist of a number of comma-separated fields.
  190. White space after each comma is ignored.
  191. The first entry for each terminal gives the names which are known for the
  192. terminal, separated by `|' characters.
  193. The first name given is the most common abbreviation for the terminal,
  194. the last name given should be a long name fully identifying the terminal,
  195. and all others are understood as synonyms for the terminal name.
  196. All names but the last should be in lower case and contain no blanks;
  197. the last name may well contain upper case and blanks for readability.
  198. X.PP
  199. Terminal names (except for the last, verbose entry) should
  200. be chosen using the following conventions.
  201. The particular piece of hardware making up the terminal should
  202. have a root name chosen, thus ``hp2621''.
  203. This name should not contain hyphens, except that synonyms may
  204. be chosen that do not conflict with other names.
  205. Modes that the hardware can be in, or user preferences, should
  206. be indicated by appending a hyphen and an indicator of the mode.
  207. Thus, a vt100 in 132 column mode would be vt100-w.
  208. The following suffixes should be used where possible:
  209. X.LP
  210. X.nf
  211. X.ta 1i 5i
  212. \fBSuffix    Meaning    Example\fP
  213. -w    Wide mode (more than 80 columns)    vt100-w
  214. -am    With auto. margins (usually default)    vt100-am
  215. -nam    Without automatic margins    vt100-nam
  216. -\fIn\fP    Number of lines on the screen    aaa-60
  217. -na    No arrow keys (leave them in local)    c100-na
  218. -\fIn\fPp    Number of pages of memory    c100-4p
  219. -rv    Reverse video    c100-rv
  220. X.fi
  221. X.SH CAPABILITIES
  222. The variable is the name by which the programmer (at the terminfo level)
  223. accesses the capability.
  224. The capname is the short name used in the text of the database,
  225. and is used by a person updating the database.
  226. X.P
  227. Capability names have no hard length limit, but an informal limit of 5
  228. characters has been adopted to keep them short.
  229. Whenever possible, names are chosen to be the same as or similar to
  230. the ANSI X3.64-1979 standard.  Semantics are also intended to match
  231. those of the specification.
  232. X.LP
  233. X.nf
  234. (P)    indicates padding may be specified
  235. (G)    indicates that the string is passed through tparm with
  236.     parms as given (#\fIi\fP).
  237. (*)    indicates that padding may be based on the number of
  238.     lines affected
  239. (#\fIi\fP)    indicates the \fIi\fP\uth\d parameter.
  240.  
  241. X.ta \w'enter_alt_charset_mode  'u +\w'Capname  'u
  242. \fBVariable    Capname    Description\fR
  243. X.I Booleans:
  244. auto_left_margin,    bw    cub1 wraps from column 0 to last column
  245. auto_right_margin,    am    Terminal has automatic margins
  246. beehive_glitch,    xsb    Beehive (f1=escape, f2=ctrl C)
  247. ceol_standout_glitch,    xhp    Standout not erased by overwriting (hp)
  248. eat_newline_glitch,    xenl    newline ignored after 80 cols (Concept)
  249. erase_overstrike,    eo    Can erase overstrikes with a blank
  250. generic_type,    gn    Generic line type (e.g. dialup, switch).
  251. hard_copy,    hc    Hardcopy terminal
  252. has_meta_key,    km    Has a meta key (shift, sets parity bit)
  253. has_status_line,    hs    Has extra ``status line''
  254. insert_null_glitch,    in    Insert mode distinguishes nulls
  255. memory_above,    da    Display may be retained above the screen
  256. memory_below,    db    Display may be retained below the screen
  257. move_insert_mode,    mir    Safe to move while in insert mode
  258. move_standout_mode,    msgr    Safe to move in standout modes
  259. over_strike,    os    Terminal overstrikes
  260. status_line_esc_ok,    eslok    Escape can be used on the status line
  261. teleray_glitch,    xt    Tabs destructive, magic so char (Teleray 1061)
  262. tilde_glitch,    hz    Hazeltine; can't print ~'s
  263. transparent_underline,    ul    underline character overstrikes
  264. xon_xoff,    xon    Terminal uses xon/xoff handshaking
  265.  
  266. X.I Numbers:
  267. columns,    cols    Number of columns in a line
  268. init_tabs,    it    Tabs initially every # spaces
  269. lines,    lines    Number of lines on screen or page
  270. lines_of_memory,    lm    Lines of memory if > lines.  0 means varies
  271. magic_cookie_glitch,    xmc    Number of blank chars left by smso or rmso
  272. padding_baud_rate,    pb    Lowest baud rate where cr/nl padding is needed
  273. virtual_terminal,    vt    Virtual terminal number (CB/Unix)
  274. width_status_line,    wsl    No. columns in status line
  275.  
  276. X.I Strings:
  277. back_tab,    cbt    Back tab (P)
  278. bell,    bel    Audible signal (bell) (P)
  279. carriage_return,    cr    Carriage return (P*)
  280. change_scroll_region,    csr    change to lines #1 through #2 (vt100) (PG)
  281. clear_all_tabs,    tbc    Clear all tab stops. (P)
  282. clear_screen,    clear    Clear screen (P*)
  283. clr_eol,    el    Clear to end of line (P)
  284. clr_eos,    ed    Clear to end of display (P*)
  285. column_address,    hpa    Set cursor column (PG)
  286. command_character,    CC    Term. settable cmd char in prototype
  287. cursor_address,    cup    Screen relative cursor motion to row #1 col #2 (PG)
  288. cursor_down,    cud1    Down one line
  289. cursor_home,    home    Home cursor (if no cup)
  290. cursor_invisible,    civis    Make cursor invisible
  291. cursor_left,    cub1    Move cursor left one space.
  292. cursor_mem_address,    mrcup    Memory relative cursor addressing
  293. cursor_normal,    cnorm    Make cursor appear normal (undo vs/vi)
  294. cursor_right,    cuf1    Non-destructive space (cursor right)
  295. cursor_to_ll,    ll    Last line, first column (if no cup)
  296. cursor_up,    cuu1    Upline (cursor up)
  297. cursor_visible,    cvvis    Make cursor very visible
  298. delete_character,    dch1    Delete character (P*)
  299. delete_line,    dl1    Delete line (P*)
  300. dis_status_line,    dsl    Disable status line
  301. down_half_line,    hd    Half-line down (forward 1/2 linefeed)
  302. enter_alt_charset_mode,    smacs    Start alternate character set (P)
  303. enter_blink_mode,    blink    Turn on blinking
  304. enter_bold_mode,    bold    Turn on bold (extra bright) mode
  305. enter_ca_mode,    smcup    String to begin programs that use cup
  306. enter_delete_mode,    smdc    Delete mode (enter)
  307. enter_dim_mode,    dim    Turn on half-bright mode
  308. enter_insert_mode,    smir    Insert mode (enter);
  309. enter_protected_mode,    prot    Turn on protected mode
  310. enter_reverse_mode,    rev    Turn on reverse video mode
  311. enter_secure_mode,    invis    Turn on blank mode (chars invisible)
  312. enter_standout_mode,    smso    Begin stand out mode
  313. enter_underline_mode,    smul    Start underscore mode
  314. erase_chars    ech    Erase #1 characters (PG)
  315. exit_alt_charset_mode,    rmacs    End alternate character set (P)
  316. exit_attribute_mode,    sgr0    Turn off all attributes
  317. exit_ca_mode,    rmcup    String to end programs that use cup
  318. exit_delete_mode,    rmdc    End delete mode
  319. exit_insert_mode,    rmir    End insert mode
  320. exit_standout_mode,    rmso    End stand out mode
  321. exit_underline_mode,    rmul    End underscore mode
  322. flash_screen,    flash    Visible bell (may not move cursor)
  323. form_feed,    ff    Hardcopy terminal page eject (P*)
  324. from_status_line,    fsl    Return from status line
  325. init_1string,    is1    Terminal initialization string
  326. init_2string,    is2    Terminal initialization string
  327. init_3string,    is3    Terminal initialization string
  328. init_file,    if    Name of file containing is
  329. insert_character,    ich1    Insert character (P)
  330. insert_line,    il1    Add new blank line (P*)
  331. insert_padding,    ip    Insert pad after character inserted (P*)
  332. key_backspace,    kbs    Sent by backspace key
  333. key_catab,    ktbc    Sent by clear-all-tabs key.
  334. key_clear,    kclr    Sent by clear screen or erase key.
  335. key_ctab,    kctab    Sent by clear-tab key
  336. key_dc,    kdch1    Sent by delete character key.
  337. key_dl,    kdl1    Sent by delete line key.
  338. key_down,    kcud1    Sent by terminal down arrow key
  339. key_eic,    krmir    Sent by rmir or smir in insert mode.
  340. key_eol,    kel    Sent by clear-to-end-of-line key.
  341. key_eos,    ked    Sent by clear-to-end-of-screen key.
  342. key_f0,    kf0    Sent by function key f0.
  343. key_f1,    kf1    Sent by function key f1.
  344. key_f10,    kf10    Sent by function key f10.
  345. key_f2,    kf2    Sent by function key f2.
  346. key_f3,    kf3    Sent by function key f3.
  347. key_f4,    kf4    Sent by function key f4.
  348. key_f5,    kf5    Sent by function key f5.
  349. key_f6,    kf6    Sent by function key f6.
  350. key_f7,    kf7    Sent by function key f7.
  351. key_f8,    kf8    Sent by function key f8.
  352. key_f9,    kf9    Sent by function key f9.
  353. key_home,    khome    Sent by home key.
  354. key_ic,    kich1    Sent by ins char/enter ins mode key.
  355. key_il,    kil1    Sent by insert line.
  356. key_left,    kcub1    Sent by terminal left arrow key
  357. key_npage,    knp    Sent by next-page key
  358. key_ppage,    kpp    Sent by previous-page key
  359. key_right,    kcuf1    Sent by terminal right arrow key
  360. key_sf,    kind    Sent by scroll-forward/down key
  361. key_sr,    kri    Sent by scroll-backward/up key
  362. key_stab,    khts    Sent by set-tab key
  363. key_up,    kcuu1    Sent by terminal up arrow key
  364. keypad_local,    rmkx    Out of "keypad transmit" mode
  365. keypad_xmit,    smkx    Put terminal in "keypad transmit" mode
  366. label_f0,    lf0    Labels on function key f0 if not f0
  367. label_f1,    lf1    Labels on function key f1 if not f1
  368. label_f10,    lf10    Labels on function key f10 if not f10
  369. label_f2,    lf2    Labels on function key f2 if not f2
  370. label_f3,    lf3    Labels on function key f3 if not f3
  371. label_f4,    lf4    Labels on function key f4 if not f4
  372. label_f5,    lf5    Labels on function key f5 if not f5
  373. label_f6,    lf6    Labels on function key f6 if not f6
  374. label_f7,    lf7    Labels on function key f7 if not f7
  375. label_f8,    lf8    Labels on function key f8 if not f8
  376. label_f9,    lf9    Labels on function key f9 if not f9
  377. meta_on,    smm    Turn on "meta mode" (8th bit)
  378. meta_off,    rmm    Turn off "meta mode"
  379. newline,    nel    Newline (behaves like cr followed by lf)
  380. pad_char,    pad    Pad character (rather than null)
  381. parm_dch,    dch    Delete #1 chars (PG*)
  382. parm_delete_line,    dl    Delete #1 lines (PG*)
  383. parm_down_cursor,    cud    Move cursor down #1 lines. (PG*)
  384. parm_ich,    ich    Insert #1 blank chars (PG*)
  385. parm_index,    indn    Scroll forward #1 lines (PG)
  386. parm_insert_line,    il    Add #1 new blank lines (PG*)
  387. parm_left_cursor,    cub    Move cursor left #1 spaces (PG)
  388. parm_right_cursor,    cuf    Move cursor right #1 spaces. (PG*)
  389. parm_rindex,    rin    Scroll backward #1 lines (PG)
  390. parm_up_cursor,    cuu    Move cursor up #1 lines. (PG*)
  391. pkey_key,    pfkey    Prog funct key #1 to type string #2
  392. pkey_local,    pfloc    Prog funct key #1 to execute string #2
  393. pkey_xmit,    pfx    Prog funct key #1 to xmit string #2
  394. print_screen,    mc0    Print contents of the screen
  395. prtr_off,    mc4    Turn off the printer
  396. prtr_on,    mc5    Turn on the printer
  397. repeat_char,    rep    Repeat char #1 #2 times.  (PG*)
  398. reset_1string,    rs1    Reset terminal completely to sane modes.
  399. reset_2string,    rs2    Reset terminal completely to sane modes.
  400. reset_3string,    rs3    Reset terminal completely to sane modes.
  401. reset_file,    rf    Name of file containing reset string.
  402. restore_cursor,    rc    Restore cursor to position of last sc.
  403. row_address,    vpa    Vertical position absolute (set row). (PG)
  404. save_cursor,    sc    Save cursor position. (P)
  405. scroll_forward,    ind    Scroll text up (P)
  406. scroll_reverse,    ri    Scroll text down (P)
  407. set_attributes,    sgr    Define the video attributes (PG9)
  408. set_tab,    hts    Set a tab in all rows, current column.
  409. set_window,    wind    Current window is lines #1-#2 cols #3-#4
  410. tab,    ht    Tab to next 8 space hardware tab stop.
  411. to_status_line,    tsl    Go to status line, column #1
  412. underline_char,    uc    Underscore one char and move past it
  413. up_half_line,    hu    Half-line up (reverse 1/2 linefeed)
  414. X.fi
  415. X.PP
  416. X.B A Sample Entry
  417. X.PP
  418. The following entry, which describes the Concept\-100, is among the more
  419. complex entries in the
  420. X.I terminfo
  421. file as of this writing.
  422. X.PP
  423. X.nf
  424. X.ta .3i
  425. concept100\||\|c100|\|\|concept\||\|c104\||\|c100-4p\||\|concept 100,
  426.     is2=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200\eEo\e47\eE,
  427.     cr=^M, cud1=^J, ind=^J, bel=^G, smcup=\eEU\eEv  8p\eEp\er,
  428.     rmcup=\eEv    $<6>\eEp\er\en, il1=\eE^R$<3*>, am, cub1=^H,
  429.     ed=\eE^C$<16*>, el=\eE^U$<16>, clear=^L$<2*>,
  430.     cup=\eEa%p1%' '%+%c%p2%' '%+%c, cols#80, dch1=\eE^A$<16*>,
  431.     dl1=\eE^B$<3*>, rmir=\eE\e200, eo, smir=\eE^P, in, ip=$<16*>,
  432.     lines#24, mir, cuf1=\eE=, ht=\et$<8>, kbs=^h, ul, cuu1=\eE;,
  433.     db, smul=\eEG, rmul=\eEg, xenl, cvvis=\eEW, cnorm=\eEw,
  434.     flash=\eEk$<20>\eEK, pb#9600, vt#8, smul=\eEG, rmul=\eEg,
  435.     smso=\eEE\eED, rmso=\eEd\eEe, dim=\eEE, rev=\eED, blink=\eEC,
  436.     prot=\eEI, invis=\eEH, sgr0=\eEN\e200, rep=\eEr%p1%c%p2%' '%+%c$<.2*>,
  437.     smkx=\eEX, rmkx=\eEx, kcuu1=\eE;, kcud1=\eE<, kcub1=\eE>,
  438.     kcuf1=\eE=, khome=\eE?, kf1=\eE5, kf2=\eE6, kf3=\eE7,
  439. X.fi
  440. X.PP
  441. Entries may continue onto multiple lines by placing white space at
  442. the beginning of each line except the first.
  443. Comments may be included on lines beginning with ``#''.
  444. Capabilities in
  445. X.I terminfo
  446. are of three types:
  447. Boolean capabilities which indicate that the terminal has
  448. some particular feature, numeric capabilities giving the size of the terminal
  449. or the size of particular delays, and string
  450. capabilities, which give a sequence which can be used to perform particular
  451. terminal operations.
  452. X.PP
  453. X.B Types of Capabilities
  454. X.PP
  455. All capabilities have short codes.  For instance, the fact that
  456. the Concept has \*(lqautomatic margins\*(rq (i.e. an automatic return and linefeed
  457. when the end of a line is reached) is indicated by the capability \fBam\fR.
  458. Hence the description of the Concept includes \fBam\fR.
  459. Numeric capabilities are followed by the character `#' and then the value.
  460. Thus \fBcols\fR which indicates the number of columns the terminal has
  461. gives the value `80' for the Concept.
  462. X.PP
  463. XFinally, string valued capabilities, such as \fBel\fR (clear to end of line
  464. sequence) are given by the two character code, an `=', and then a string
  465. ending at the next following `,'.  A delay in milliseconds may appear
  466. anywhere in such a capability, enclosed in $<..> brackets,
  467. as in \fBel\fP=\eEK$<3>,
  468. and padding characters are supplied by
  469. X.I tputs
  470. to provide this delay.
  471. The delay can be either a number, e.g. `20', or a number followed by
  472. an `*', i.e. `3*'.  A `*' indicates that the padding required is proportional
  473. to the number of lines affected by the operation, and the amount given is
  474. the per-affected-unit padding required.
  475. (In the case of insert character, the factor is still the number of
  476. X.IR lines
  477. affected.
  478. This is always one unless the terminal has \fBxenl\fP and the software uses it.)
  479. When a `*' is specified, it is sometimes useful to give a delay of the form
  480. `3.5' to specify a delay per unit to tenths of milliseconds.
  481. (Only one decimal place is allowed.)
  482. X.PP
  483. A number of escape sequences are provided in the string valued capabilities
  484. for easy encoding of characters there.  A \fB\eE\fR (or \fB\ee\fP)
  485. maps to an \s-2ESCAPE\s0
  486. character, \fB^x\fR maps to a control-x for any appropriate x, and the sequences
  487. \fB\en \er \et \eb \ef \es\fR give a newline,
  488. return, tab, backspace, formfeed and space, respectively.
  489. XFinally, characters may be given as three octal digits after a \fB\e\fR,
  490. and the characters \fB^\fR, \fB\e\fR and comma may be given
  491. as \fB\e^\fR, \fB\e\e\fR and \fB\e,\fR.
  492. X.PP
  493. XFor convenience when testing entries, individual capabilities may be easily
  494. commented out by directly preceding the name of the capability by a period.
  495. Thus the entry
  496. X.DT
  497. X.nf
  498.     33\||\|tty33\||\|tty\||\|model 33 teletype,
  499.         cr=^M, cud1=^J, .ind=^J, bel=^G, cols#72, hc, os,
  500. X.fi
  501. X.ad
  502. is equivalent to the entry
  503. X.DT
  504. X.nf
  505.     33\||\|tty33\||\|tty\||\|model 33 teletype,
  506.         cr=^M, cud1=^J, bel=^G, cols#72, hc, os,
  507. X.fi
  508. X.ad
  509. the \fBind\fP capability having been 'commented out'.
  510. X.br
  511. X.ne 5
  512. X.PP
  513. X.B Preparing Descriptions
  514. X.PP
  515. We now outline how to prepare descriptions of terminals.
  516. The most effective way to prepare a terminal description is by imitating
  517. the description of a similar terminal in
  518. X.I terminfo
  519. and to build up a description gradually, using partial descriptions
  520. with
  521. X.I vi
  522. to check that they are correct.
  523. Be aware that a very unusual terminal may expose deficiencies in
  524. the ability of the
  525. X.I terminfo
  526. file to describe it
  527. or bugs in
  528. X.I vi.
  529. To easily test a new terminal description you can set the environment variable
  530. TERMINFO to a pathname of a file containing the description you are working
  531. on and the editor will look there rather than in
  532. X.I /etc/terminfo.
  533. To get the padding for insert line right (if the terminal manufacturer
  534. did not document it) a severe test is to edit /etc/passwd at 9600 baud,
  535. delete 16 or so lines from the middle of the screen, then hit the `u'
  536. key several times quickly.
  537. If the terminal messes up, more padding is usually needed.
  538. A similar test can be used for insert character.
  539. X.PP
  540. X.B Basic capabilities
  541. X.PP
  542. The number of columns on each line for the terminal is given by the
  543. \fBcols\fR numeric capability.  If the terminal is a \s-2CRT\s0, then the
  544. number of lines on the screen is given by the \fBlines\fR capability.
  545. If the terminal wraps around to the beginning of the next line when
  546. it reaches the right margin, then it should have the \fBam\fR capability.
  547. If the terminal can clear its screen, then this is given by the
  548. \fBclear\fR string capability.
  549. If the terminal overstrikes
  550. (rather than clearing a position when a character is struck over)
  551. then it should have the \fBos\fR capability.
  552. If the terminal is a printing terminal, with no soft copy unit,
  553. give it both
  554. X.B hc
  555. and
  556. X.BR os .
  557. X.RB ( os
  558. applies to storage scope terminals, such as Tektronix 4010
  559. series, as well as hard copy and APL terminals.)
  560. If there is a code to move the cursor to the left edge of the current
  561. row, give this as
  562. X.BR cr .
  563. (Normally this will be carriage return, control M.)
  564. If there is a code to produce an audible signal (bell, beep, etc)
  565. give this as
  566. X.BR bel .
  567. X.PP
  568. If there is a code to move the cursor one position to the left
  569. (such as backspace) that capability should be given as
  570. X.BR cub1 .
  571. Similarly, codes to move forward, up, and down should be
  572. given as
  573. X.BR cuf1 ,
  574. X.BR cuu1 ,
  575. and
  576. X.BR cud1 .
  577. These local cursor motions should not alter the text they pass over,
  578. for example, you would not normally use `\fBcuf1\fP=\es' because the
  579. space would erase the character moved over.
  580. X.PP
  581. A very important point here is that the local cursor motions encoded
  582. in
  583. X.I terminfo
  584. are undefined at the left and top edges of a \s-2CRT\s0 terminal.
  585. Programs should never attempt to backspace around the left edge,
  586. unless
  587. X.B bw
  588. is given,
  589. and never attempt to go up locally off the top.
  590. In order to scroll text up, a program will go to the bottom of the screen
  591. and send the
  592. X.B ind
  593. (index) string.
  594. X.PP
  595. To scroll text down, a program goes to the top of the screen and sends the
  596. X.B ri
  597. (reverse index) string.
  598. The strings
  599. X.B ind
  600. and
  601. X.B ri
  602. are undefined when not on their respective edges of the screen.
  603. X.PP
  604. The \fBam\fR capability tells whether the cursor sticks at the right
  605. edge of the screen when text is output, but this does not necessarily
  606. apply to a
  607. X.B cuf1
  608. from the last column.
  609. The only local motion which is defined from the left edge is if
  610. X.B bw
  611. is given, then a
  612. X.B cub1
  613. from the left edge will move to the right edge of the previous row.
  614. If
  615. X.B bw
  616. is not given, the effect is undefined.
  617. This is useful for drawing a box around the edge of the screen, for example.
  618. If the terminal has switch selectable automatic margins,
  619. the
  620. X.I terminfo
  621. file usually assumes that this is on, i.e. \fBam\fR.
  622. If the terminal has a command which moves to the first column of the next
  623. line, that command can be given as
  624. X.B nel
  625. (newline).
  626. It does not matter if the command clears the remainder of the current line,
  627. so if the terminal has no
  628. X.B cr
  629. and
  630. X.B lf
  631. it may still be possible to craft a working
  632. X.B nel
  633. out of one or both of them.
  634. X.PP
  635. These capabilities suffice to describe hardcopy and \*(lqglass-tty\*(rq terminals.
  636. Thus the model 33 teletype is described as
  637. X.PP
  638. X.DT
  639. X.nf
  640.     33\||\|tty33\||\|tty\||\|model 33 teletype,
  641.         cr=^M, cud1=^J, ind=^J, bel=^G, cols#72, hc, os,
  642. X.PP
  643. while the Lear Siegler \s-2ADM\-3\s0 is described as
  644. X.PP
  645. X.DT
  646. X.nf
  647.     adm3\||\|3\||\|lsi adm3,
  648.         cr=^M, cud1=^J, ind=^J, bel=^G,
  649.         am, cub1=^H, clear=^Z, lines#24, cols#80,
  650. X.fi
  651. X.PP
  652. X.B Parameterized Strings
  653. X.PP
  654. Cursor addressing and other strings requiring parameters
  655. in the terminal are described by a
  656. parameterized string capability, with 
  657. X.IR printf (3s)
  658. like escapes \fB%x\fR in it.
  659. XFor example, to address the cursor, the
  660. X.B cup
  661. capability is given, using two parameters:
  662. the row and column to address to.
  663. (Rows and columns are numbered from zero and refer to the
  664. physical screen visible to the user, not to any unseen memory.)
  665. If the terminal has memory relative cursor addressing,
  666. that can be indicated by
  667. X.BR mrcup .
  668. X.PP
  669. The parameter mechanism uses a stack and special \fB%\fP codes
  670. to manipulate it.  Typically a sequence will push one of the
  671. parameters onto the stack and then print it in some format.
  672. Often more complex operations are necessary.
  673. X.PP
  674. The \fB%\fR encodings have the following meanings:
  675. X.PP
  676. X.DT
  677. X.nf
  678. X.ta .5i 1.5i
  679.     %%    outputs `%'
  680.     %d    print pop() as in printf
  681.     %2d    print pop() like %2d
  682.     %02d    print pop() like %02d
  683.     %3d    print pop() like %3d
  684.     %03d    print pop() like %03d
  685.     %c    print pop() like %c
  686.     %s    print pop() like %s
  687.  
  688.     %p[1-9]    push ith parm
  689.     %P[a-z]    set variable [a-z] to pop()
  690.     %g[a-z]    get variable [a-z] and push it
  691.     %'c'    char constant c
  692.     %{nn}    integer constant nn
  693.  
  694.     %+ %- %* %/ %m
  695.         arithmetic (%m is mod): push(pop() op pop())
  696.     %& %| %^    bit operations: push(pop() op pop())
  697.     %= %> %<    logical operations: push(pop() op pop())
  698.     %! %~    unary operations push(op pop())
  699.     %i    add 1 to first two parms (for ANSI terminals)
  700.  
  701.     %? expr %t thenpart %e elsepart %;
  702.         if-then-else, %e elsepart is optional.
  703.         else-if's are possible ala Algol 68:
  704.         %? c1 %t %e c2 %t %e c3 %t %e c4 %t %e %;
  705. X.fi
  706. X.PP
  707. It should be noted that the binary operators above (e.g. %+, %-, %m, etc.)
  708. all work in the usual fashion, i.e.
  709. X.ce
  710. %gx %gy %m
  711. yields \fBx mod y\fR not \fBy mod x\fR.
  712. X.PP
  713. Consider the HP2645, which, to get to row 3 and column 12, needs
  714. to be sent \eE&a12c03Y padded for 6 milliseconds.  Note that the order
  715. of the rows and columns is inverted here, and that the row and column
  716. are printed as two digits.
  717. Thus its \fBcup\fR capability is \*(lqcup=\eE&%p2%2dc%p1%2dY$<6>\*(rq.
  718. X.PP
  719. The Microterm \s-2ACT-IV\s0 needs the current row and column sent
  720. preceded by a \fB^T\fR, with the row and column simply encoded in binary,
  721. \*(lqcup=^T%p1%c%p2%c\*(rq.
  722. Terminals which use \*(lq%c\*(rq need to be able to
  723. backspace the cursor (\fBcub1\fR),
  724. and to move the cursor up one line on the screen (\fBcuu1\fR).
  725. This is necessary because it is not always safe to transmit \fB\en\fR,
  726. \fB^D\fR and \fB\er\fR, as the system may change or discard them.
  727. (The library routines dealing with terminfo set tty modes so that
  728. tabs are never expanded, so \et is safe to send.
  729. This turns out to be essential for the Ann Arbor 4080.)
  730. X.PP
  731. A final example is the \s-2LSI ADM\s0-3a, which uses row and column
  732. offset by a blank character, thus \*(lqcup=\eE=%p1%' '%+%c%p2%' '%+%c\*(rq.
  733. After sending `\eE=', this pushes the first parameter, pushes the
  734. ASCII value for a space (32), adds them (pushing the sum on the stack
  735. in place of the two previous values) and outputs that value as a character.
  736. Then the same is done for the second parameter.
  737. More complex arithmetic is possible using the stack.
  738. X.PP
  739. If the terminal has row or column absolute cursor addressing,
  740. these can be given as single parameter capabilities
  741. X.B hpa
  742. (horizontal position absolute)
  743. and
  744. X.B vpa
  745. (vertical position absolute).
  746. Sometimes these are shorter than the more general two parameter
  747. sequence (as with the hp2645) and can be used in preference to
  748. X.B cup .
  749. If there are parameterized local motions (e.g. move
  750. X.I n
  751. spaces to the right) these can be given as
  752. X.BR cud ,
  753. X.BR cub ,
  754. X.BR cuf ,
  755. and
  756. X.BR cuu
  757. with a single parameter indicating how many spaces to move.
  758. These are primarily useful if the terminal does not have
  759. X.BR cup ,
  760. such as the Tektronix 4025.
  761. X.PP
  762. X.B Cursor motions
  763. X.PP
  764. If the terminal has a fast way to home the cursor
  765. (to very upper left corner of screen) then this can be given as
  766. \fBhome\fR; similarly a fast way of getting to the lower left hand corner
  767. can be given as \fBll\fR; this may involve going up with \fBcuu1\fR
  768. from the home position,
  769. but a program should never do this itself (unless \fBll\fR does) because it
  770. can make no assumption about the effect of moving up from the home position.
  771. Note that the home position is the same as addressing to (0,0):
  772. to the top left corner of the screen, not of memory.
  773. (Thus, the \eEH sequence on HP terminals cannot be used for
  774. X.BR home .)
  775. X.PP
  776. X.B Area clears
  777. X.PP
  778. If the terminal can clear from the current position to the end of the
  779. line, leaving the cursor where it is, this should be given as \fBel\fR.
  780. If the terminal can clear from the current position to the end of the
  781. display, then this should be given as \fBed\fR.
  782. \fBed\fR is only defined from the first column of a line.
  783. (Thus, it can be simulated by a request to delete a large number of lines,
  784. if a true
  785. X.B ed
  786. is not available.)
  787. X.PP
  788. X.B Insert/delete line
  789. X.PP
  790. If the terminal can open a new blank line before the line where the cursor
  791. is, this should be given as \fBil1\fR; this is done only from the first
  792. position of a line.  The cursor must then appear on the newly blank line.
  793. If the terminal can delete the line which the cursor is on, then this
  794. should be given as \fBdl1\fR; this is done only from the first position on
  795. the line to be deleted.
  796. Versions of
  797. X.B il1
  798. and
  799. X.B dl1
  800. which take a single parameter and insert or delete that many lines can
  801. be given as
  802. X.B il
  803. and
  804. X.BR dl .
  805. If the terminal has a settable scrolling region (like the vt100)
  806. the command to set this can be described with the
  807. X.B csr
  808. capability, which takes two parameters:
  809. the top and bottom lines of the scrolling region.
  810. The cursor position is, alas, undefined after using this command.
  811. It is possible to get the effect of insert or delete line using
  812. this command \- the
  813. X.B sc
  814. and
  815. X.B rc
  816. (save and restore cursor) commands are also useful.
  817. Inserting lines at the top or bottom of the screen can also be
  818. done using
  819. X.B ri
  820. or
  821. X.B ind
  822. on many terminals without true insert/delete line,
  823. and are often faster even on terminals with those features.
  824. X.PP
  825. If the terminal has the ability to define a window as part of
  826. memory, which all commands affect,
  827. it should be given as the parameterized string
  828. X.BR wind .
  829. The four parameters are the starting and ending lines in memory
  830. and the starting and ending columns in memory, in that order.
  831. X.PP
  832. If the terminal can retain display memory above then the
  833. \fBda\fR capability should be given; if display memory can be retained
  834. below then \fBdb\fR should be given.  These indicate
  835. that deleting a line or scrolling may bring non-blank lines up from below
  836. or that scrolling back with \fBri\fR may bring down non-blank lines.
  837. X.PP
  838. X.B Insert/delete character
  839. X.PP
  840. There are two basic kinds of intelligent terminals with respect to
  841. insert/delete character which can be described using
  842. X.I terminfo.
  843. The most common insert/delete character operations affect only the characters
  844. on the current line and shift characters off the end of the line rigidly.
  845. Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make
  846. a distinction between typed and untyped blanks on the screen, shifting
  847. upon an insert or delete only to an untyped blank on the screen which is
  848. either eliminated, or expanded to two untyped blanks.  You can find out
  849. which kind of terminal you have by clearing the screen and then typing
  850. text separated by cursor motions.  Type \*(lqabc\ \ \ \ def\*(rq using local
  851. cursor motions (not spaces) between the \*(lqabc\*(rq and the \*(lqdef\*(rq.
  852. Then position the cursor before the \*(lqabc\*(rq and put the terminal in insert
  853. mode.  If typing characters causes the rest of the line to shift
  854. rigidly and characters to fall off the end, then your terminal does
  855. not distinguish between blanks and untyped positions.  If the \*(lqabc\*(rq
  856. shifts over to the \*(lqdef\*(rq which then move together around the end of the
  857. current line and onto the next as you insert, you have the second type of
  858. terminal, and should give the capability \fBin\fR, which stands for
  859. \*(lqinsert null\*(rq.
  860. While these are two logically separate attributes (one line vs. multi line
  861. insert mode, and special treatment of untyped spaces) we have seen no
  862. terminals whose insert mode cannot be described with the single attribute.
  863. X.PP
  864. Termcap can describe both terminals which have an insert mode, and terminals
  865. which send a simple sequence to open a blank position on the current line.
  866. Give as \fBsmir\fR the sequence to get into insert mode.
  867. Give as \fBrmir\fR the sequence to leave insert mode.
  868. Now give as \fBich1\fR any sequence needed to be sent just before sending
  869. the character to be inserted.  Most terminals with a true insert mode
  870. will not give \fBich1\fR, terminals which send a sequence to open a screen
  871. position should give it here.  (Insert mode is usually
  872. preferable to the sequence
  873. to open a position on the screen if your terminal has both.)
  874. If post insert padding is needed, give this as a number of milliseconds
  875. in \fBip\fR (a string option).  Any other sequence which may need to be
  876. sent after an insert of a single character may also be given in \fBip\fR.
  877. If your terminal needs both to be placed into an `insert mode' and
  878. a special code to precede each inserted character, then both
  879. X.BR smir / rmir
  880. and
  881. X.B ich1
  882. can be given, and both will be used.
  883. The
  884. X.B ich
  885. capability, with one parameter,
  886. X.IR n ,
  887. will repeat the effects of
  888. X.B ich1
  889. X.I n
  890. times.
  891. X.PP
  892. It is occasionally necessary to move around while in insert mode
  893. to delete characters on the same line (e.g. if there is a tab after
  894. the insertion position).  If your terminal allows motion while in
  895. insert mode you can give the capability \fBmir\fR to speed up inserting
  896. in this case.  Omitting \fBmir\fR will affect only speed.   Some terminals
  897. (notably Datamedia's) must not have \fBmir\fR because of the way their
  898. insert mode works.
  899. X.PP
  900. XFinally, you can specify
  901. X.B dch1
  902. to delete a single character,
  903. X.B dch
  904. with one parameter,
  905. X.IR n ,
  906. to delete
  907. X.I n characters,
  908. and delete mode by giving \fBsmdc\fR and \fBrmdc\fR
  909. to enter and exit delete mode (any mode the terminal needs to be placed
  910. in for
  911. X.B dch1
  912. to work).
  913. X.PP
  914. A command to erase
  915. X.I n
  916. characters (equivalent to outputting
  917. X.I n
  918. blanks without moving the cursor)
  919. can be given as
  920. X.B ech
  921. with one parameter.
  922. X.PP
  923. X.B "Highlighting, underlining, and visible bells"
  924. X.PP
  925. If your terminal has one or more kinds of display attributes,
  926. these can be represented in a number of different ways.
  927. You should choose one display form as
  928. X.I standout mode ,
  929. representing a good, high contrast, easy on the eyes,
  930. format for highlighting error messages and other attention getters.
  931. (If you have a choice, reverse video plus half bright is good,
  932. or reverse video alone.)
  933. The sequences to enter and exit standout mode
  934. are given as \fBsmso\fR and \fBrmso\fR respectively.
  935. If the code to change into or out of standout
  936. mode leaves one or even two blank spaces on the screen,
  937. as the TVI 912 and Teleray 1061 do,
  938. then \fBxmc\fR should be given to tell how many spaces are left.
  939. X.PP
  940. Codes to begin underlining and end underlining can be given as \fBsmul\fR
  941. and \fBrmul\fR respectively.
  942. If the terminal has a code to underline the current character and move
  943. the cursor one space to the right, 
  944. such as the Microterm Mime,
  945. this can be given as \fBuc\fR.
  946. X.PP
  947. Other capabilities to enter various highlighting modes include
  948. X.B blink
  949. (blinking)
  950. X.B bold
  951. (bold or extra bright)
  952. X.B dim
  953. (dim or half bright)
  954. X.B invis
  955. (blanking or invisible text)
  956. X.B prot
  957. (protected)
  958. X.B rev
  959. (reverse video)
  960. X.B sgr0
  961. (turn off
  962. X.I all
  963. attribute modes)
  964. X.B smacs
  965. (enter alternate character set mode)
  966. and
  967. X.B rmacs
  968. (exit alternate character set mode).
  969. Turning on any of these modes singly may or may not turn off other modes.
  970. X.PP
  971. If there is a sequence to set arbitrary combinations of modes,
  972. this should be given as
  973. X.B sgr
  974. (set attributes),
  975. taking 9 parameters.
  976. Each parameter is either 0 or 1, as the corresponding attribute is on or off.
  977. The 9 parameters are, in order:
  978. standout, underline, reverse, blink, dim, bold, invis, protect, alternate
  979. character set.
  980. Not all modes need be supported by
  981. X.BR sgr ,
  982. only those for which corresponding separate attribute commands exist.
  983. X.PP
  984. Terminals with the ``magic cookie'' glitch
  985. X.RB ( xmc )
  986. deposit special ``cookies'' when they receive mode setting sequences,
  987. which affect the display algorithm, rather than having extra bits for
  988. each character.
  989. Some terminals, such as the HP 2621, automatically leave standout
  990. mode when they move to a new line or the cursor is addressed.
  991. Programs using standout mode should exit standout mode before
  992. moving the cursor or sending a newline,
  993. unless the
  994. X.B msgr
  995. capability, asserting that it is safe to move in standout mode, is present.
  996. X.PP
  997. If the terminal has
  998. a way of flashing the screen to indicate an error quietly (a bell replacement)
  999. then this can be given as \fBflash\fR; it must not move the cursor.
  1000. X.PP
  1001. If the cursor needs to be made more visible than normal when it is
  1002. not on the bottom line (to make, for example, a non-blinking underline into an
  1003. easier to find block or blinking underline)
  1004. give this sequence as
  1005. X.BR cvvis .
  1006. If there is a way to make the cursor completely invisible, give that as
  1007. X.BR civis .
  1008. The capability
  1009. X.BR cnorm
  1010. should be given which undoes the effects of both of these modes.
  1011. X.PP
  1012. If the terminal needs to be in a special mode when running
  1013. a program that uses these capbilities,
  1014. the codes to enter and exit this mode can be given as \fBsmcup\fR and \fBrmcup\fR.
  1015. This arises, for example, from terminals like the Concept with more than
  1016. one page of memory.
  1017. If the terminal has only memory relative cursor addressing and not screen
  1018. relative cursor addressing, a one screen-sized window must be fixed into
  1019. the terminal for cursor addressing to work properly.
  1020. This is also used for the Tektronix 4025,
  1021. where
  1022. X.B smcup
  1023. sets the command character to be the one used by terminfo.
  1024. X.PP
  1025. If your terminal correctly generates underlined characters
  1026. (with no special codes needed)
  1027. even though it does not overstrike,
  1028. then you should give the capability \fBul\fR.
  1029. If overstrikes are erasable with a blank,
  1030. then this should be indicated by giving \fBeo\fR.
  1031. X.PP
  1032. X.B Keypad
  1033. X.PP
  1034. If the terminal has a keypad that transmits codes when the keys are pressed,
  1035. this information can be given. Note that it is not possible to handle
  1036. terminals where the keypad only works in local (this applies, for example,
  1037. to the unshifted HP 2621 keys).
  1038. If the keypad can be set to transmit or not transmit,
  1039. give these codes as \fBsmkx\fR and \fBrmkx\fR.
  1040. Otherwise the keypad is assumed to always transmit.
  1041. The codes sent by the left arrow, right arrow, up arrow, down arrow,
  1042. and home keys can be given as \fBkcub1, kcuf1, kcuu1, kcud1,
  1043. \fRand\fB khome\fR respectively.
  1044. If there are function keys such as f0, f1, ..., f10, the codes they send
  1045. can be given as \fBkf0, kf1, ..., kf10\fR.
  1046. If these keys have labels other than the default f0 through f10, the labels
  1047. can be given as \fBlf0, lf1, ..., lf10\fR.
  1048. The codes transmitted by certain other special keys can be given:
  1049. X.B kbs
  1050. (backspace),
  1051. X.B ktbc
  1052. (clear all tabs),
  1053. X.B kctab
  1054. (clear the tab stop in this column),
  1055. X.B kclr
  1056. (clear screen or erase key),
  1057. X.B kdch1
  1058. (delete character),
  1059. X.B kdl1
  1060. (delete line),
  1061. X.B krmir
  1062. (exit insert mode),
  1063. X.B kel
  1064. (clear to end of line),
  1065. X.B ked
  1066. (clear to end of screen),
  1067. X.B kich1
  1068. (insert character or enter insert mode),
  1069. X.B kil1
  1070. (insert line),
  1071. X.B knp
  1072. (next page),
  1073. X.B kpp
  1074. (previous page),
  1075. X.B kind
  1076. (scroll forward/down),
  1077. X.B kri
  1078. (scroll backward/up),
  1079. X.B khts
  1080. (set a tab stop in this column).
  1081. X.PP
  1082. X.B Tabs and Initialization
  1083. X.PP
  1084. If the terminal has hardware tabs, the command to advance to the next
  1085. tab stop can be given as
  1086. X.B ht
  1087. (usually control I).
  1088. A ``backtab'' command which moves leftward to the next tab stop can
  1089. be given as
  1090. X.BR cbt .
  1091. By convention, if the teletype modes indicate that tabs are being
  1092. expanded by the computer rather than being sent to the terminal,
  1093. programs should not use
  1094. X.B ht
  1095. or
  1096. X.B cbt
  1097. even if they are present, since the user may not have the tab stops
  1098. properly set.
  1099. If the terminal has hardware tabs activated by control I, then
  1100. X.B tabs
  1101. is given, in addition to
  1102. X.BR ht .
  1103. This is normally used by the
  1104. X.IR tset (1)
  1105. command to determine whether to set the mode for hardware tab expansion.
  1106. X.PP
  1107. Other capabilities
  1108. include
  1109. X.BR is1 ,
  1110. X.BR is2 ,
  1111. and
  1112. X.BR is3 ,
  1113. initialization strings for the terminal,
  1114. and \fBif\fR, the name of a file containing long initialization strings.
  1115. These strings are expected to set the terminal into modes consistent
  1116. with the rest of the terminfo description.
  1117. They are normally sent to the terminal, by the
  1118. X.IR tset (1)
  1119. program, each time the user logs in.
  1120. They will be printed in the following order:
  1121. X.BR is1 ;
  1122. X.BR is2 ;
  1123. setting tabs using
  1124. X.B tbc
  1125. and
  1126. X.BR hts ;
  1127. X.BR if ;
  1128. and finally
  1129. X.BR is3 .
  1130. Most initialization is done with
  1131. X.B is2 .
  1132. Special terminal modes can be set up without duplicating strings
  1133. by putting the common sequences in
  1134. X.B is2
  1135. and special cases in
  1136. X.B is1
  1137. and
  1138. X.BR is3 .
  1139. A pair of sequences that does a harder reset from a totally unknown state
  1140. can be analogously given as
  1141. X.BR rs1 ,
  1142. X.BR rs2 ,
  1143. X.BR rf ,
  1144. and
  1145. X.BR rs3 ,
  1146. analogous to
  1147. X.B is2
  1148. and
  1149. X.BR if .
  1150. These strings are output by the
  1151. X.IR reset (1)
  1152. program, which is used when the terminal gets into a wedged state.
  1153. Commands are normally placed in
  1154. X.B rs2
  1155. and
  1156. X.B rf
  1157. only if they produce annoying effects on the screen and are not
  1158. necessary when logging in.
  1159. XFor example, the command to set the vt100 into 80 column mode would
  1160. normally be part of
  1161. X.BR is2 ,
  1162. but it causes an annoying glitch of the screen and is not normally
  1163. needed since the terminal is usually already in 80 column mode.
  1164. X.PP
  1165. If there are commands to set and clear tab stops, they can be given as
  1166. X.B tbc
  1167. (clear all tab stops)
  1168. and
  1169. X.B hts
  1170. (set a tab stop in the current column of every row).
  1171. If a more complex sequence is needed to set the tabs than can be
  1172. described by this, the sequence can be placed in
  1173. X.B is2
  1174. or
  1175. X.BR if .
  1176. X.PP
  1177. X.B Delays
  1178. X.PP
  1179. Certain capabilities control padding in the teletype driver.
  1180. These are primarily needed by hard copy terminals, and are used
  1181. by the
  1182. X.IR tset (1)
  1183. program to set teletype modes appropriately.
  1184. Delays embedded in the capabilities
  1185. X.B cr ,
  1186. X.B ind ,
  1187. X.B cub1 ,
  1188. X.B ff ,
  1189. and
  1190. X.B tab
  1191. will cause the appropriate delay bits to be set in the teletype driver.
  1192. If
  1193. X.B pb
  1194. (padding baud rate)
  1195. is given,
  1196. these values can be ignored at baud rates below the value of
  1197. X.B pb .
  1198. X.PP
  1199. X.B Miscellaneous
  1200. X.PP
  1201. If the terminal requires other than a null (zero) character as a pad,
  1202. then this can be given as \fBpad\fR.
  1203. Only the first character of the
  1204. X.B pad
  1205. string is used.
  1206. X.PP
  1207. If the terminal has an extra ``status line'' that is not normally
  1208. used by software, this fact can be indicated.
  1209. If the status line is viewed as an extra line below the bottom line,
  1210. into which one can cursor address normally,
  1211. (such as the Heathkit h19's 25th line, or the 24th line of a vt100
  1212. which is set to a 23 line scrolling region)
  1213. the capability
  1214. X.B hs
  1215. should be given.
  1216. Special strings to go to the beginning of the status
  1217. line and to return from the status line can be given as
  1218. X.B tsl
  1219. and
  1220. X.BR fsl .
  1221. X.RB ( fsl
  1222. must leave the cursor position in the same place it was before
  1223. X.BR tsl .)
  1224. X.B tsl
  1225. takes one parameter, which is the column number of the status line
  1226. the cursor is to be moved to.
  1227. If escape sequences and other special commands, such as tab, work
  1228. while in the status line, the flag
  1229. X.B eslok
  1230. can be given.
  1231. A string which turns off the status line (or otherwise erases its
  1232. contents) should be given as
  1233. X.B dsl .
  1234. If the terminal has commands to save and restore the position of the cursor,
  1235. give them as
  1236. X.B sc
  1237. and
  1238. X.BR rc .
  1239. The status line is normally assumed to be the same width as the rest
  1240. of the screen, e.g.
  1241. X.B cols .
  1242. If the status line is a different width (possibly because the terminal
  1243. does not allow an entire line to be loaded) the width, in columns,
  1244. can be indicated with the numeric parameter
  1245. X.B wsl .
  1246. X.PP
  1247. If the terminal can move up or down half a line,
  1248. this can be indicated with
  1249. X.B hu
  1250. (half line up)
  1251. and
  1252. X.B hd
  1253. (half line down).
  1254. This is primarily useful for superscripts and subscripts on hardcopy terminals.
  1255. If a hardcopy terminal can eject to the next page (form feed), give this as
  1256. X.B ff
  1257. (usually control L).
  1258. X.PP
  1259. If there is a command to repeat a given character a given number of
  1260. times (to save time transmitting a large number of identical characters)
  1261. this can be indicated with the parameterized string
  1262. X.BR rep .
  1263. The first parameter is the character to be repeated and the second
  1264. is the number of times to repeat it.
  1265. Thus, tparm(repeat_char, 'x', 10) is the same as `xxxxxxxxxx'.
  1266. X.PP
  1267. If the terminal has a settable command character, such as the Tektronix 4025,
  1268. this can be indicated with
  1269. X.BR CC .
  1270. A prototype command character is chosen which is used in all capabilities.
  1271. This character is given in the
  1272. X.B CC
  1273. capability to identify it.
  1274. The following convention is supported on some UNIX systems:
  1275. The environment is to be searched for a
  1276. X.B CC
  1277. variable, and if found, all
  1278. occurrances of the prototype character are replaced with the character
  1279. in the environment variable.
  1280. X.PP
  1281. Terminal descriptions that do not represent a specific kind of known
  1282. terminal, such as
  1283. X.IR switch ,
  1284. X.IR dialup ,
  1285. X.IR patch ,
  1286. and
  1287. X.IR network ,
  1288. should include the
  1289. X.B gn
  1290. (generic) capability so that programs can complain that they don't know
  1291. how to talk to the terminal.
  1292. (This capability does not apply to
  1293. X.I virtual
  1294. terminal descriptions for which the escape sequences are known.)
  1295. X.PP
  1296. If the terminal uses xon/xoff handshaking for flow control, give
  1297. X.BR xon .
  1298. Padding information should still be included so that routines can
  1299. make better decisions about costs, but actual pad characters may
  1300. not be transmitted.
  1301. X.PP
  1302. If the terminal has a ``meta key'' which acts as a shift key,
  1303. setting the 8th bit of any character transmitted, this fact can
  1304. be indicated with
  1305. X.BR km .
  1306. Otherwise, software will assume that the 8th bit is parity and it
  1307. will usually be cleared.
  1308. If strings exist to turn this ``meta mode'' on and off, they
  1309. can be given as
  1310. X.B smm
  1311. and
  1312. X.BR rmm .
  1313. X.PP
  1314. If the terminal has more lines of memory than will fit on the screen
  1315. at once, the number of lines of memory can be indicated with
  1316. X.BR lm .
  1317. A value of 0 indicates that the number of lines is not fixed,
  1318. but that there is still more memory than fits on the screen.
  1319. X.PP
  1320. If the terminal is one of those supported by the CB-UNIX virtual
  1321. terminal protocol, the terminal number can be given as
  1322. X.BR vt .
  1323. X.PP
  1324. Media copy
  1325. strings which control an auxillary printer connected to the terminal
  1326. can be given as
  1327. X.BR mc0 :
  1328. print the contents of the screen,
  1329. X.BR mc4 :
  1330. turn on the printer, and
  1331. X.BR mc5 :
  1332. turn off the printer.
  1333. When the printer is on, all text sent to the terminal will be sent
  1334. to the printer.
  1335. It is undefined whether the text is also displayed on the terminal screen
  1336. when the printer is on.
  1337. X.PP
  1338. Strings to program function keys can be given as
  1339. X.BR pfkey ,
  1340. X.BR pfloc ,
  1341. and
  1342. X.BR pfx .
  1343. Each of these strings takes two parameters: the function key number to
  1344. program (from 0 to 10) and the string to program it with.
  1345. XFunction key numbers out of this range may program undefined keys in
  1346. a terminal dependent manner.
  1347. The difference between the capabilities is that
  1348. X.B pfkey
  1349. causes pressing the given key to be the same as the user typing the
  1350. given string,
  1351. X.B pfloc
  1352. causes the string to be executed by the terminal in local, and
  1353. X.B pfx
  1354. causes the string to be transmitted to the computer.
  1355. X.PP
  1356. X.B Glitches and Braindamage
  1357. X.PP
  1358. Hazeltine terminals, which don't allow `~' characters to be displayed should
  1359. indicate \fBhz\fR.
  1360. X.PP
  1361. Terminals which ignore a linefeed immediately after an \fBam\fR wrap,
  1362. such as the Concept and vt100,
  1363. should indicate \fBxenl\fR.
  1364. X.PP
  1365. If
  1366. X.B el
  1367. is required to get rid of standout
  1368. (instead of merely writing normal text on top of it),
  1369. \fBxhp\fP should be given.
  1370. X.PP
  1371. Teleray terminals, where tabs turn all characters moved over to blanks,
  1372. should indicate \fBxt\fR (destructive tabs).
  1373. This glitch is also taken to mean that it is not possible to position
  1374. the cursor on top of a ``magic cookie'',
  1375. that to erase standout mode it is instead necessary to use
  1376. delete and insert line.
  1377. X.PP
  1378. The Beehive Superbee, which is unable to correctly transmit the escape
  1379. or control C characters, has
  1380. X.BR xsb ,
  1381. indicating that the f1 key is used for escape and f2 for control C.
  1382. (Only certain superbees have this problem, depending on the ROM.)
  1383. X.PP
  1384. Other specific terminal problems may be corrected by adding more
  1385. capabilities of the form \fBx\fIx\fR.
  1386. X.PP
  1387. X.B Similar Terminals
  1388. X.PP
  1389. If there are two very similar terminals,
  1390. one can be defined as being just like the other with certain exceptions.
  1391. The string capability \fBuse\fR can be given
  1392. with the name of the similar terminal.
  1393. The capabilities given before
  1394. X.B use
  1395. override those in the terminal type invoked by
  1396. X.BR use .
  1397. A capability can be cancelled with \fBxx@\fR where xx is the capability.
  1398. XFor example, the entry
  1399. X.PP
  1400.     2621-nl, smkx@, rmkx@, use=2621,
  1401. X.PP
  1402. defines a 2621-nl that does not have the \fBsmkx\fR or \fBrmkx\fR capabilities,
  1403. and hence does not turn on the function key labels when in visual mode.
  1404. This is useful for different modes for a terminal, or for different
  1405. user preferences.  An terminal may have as many \fBuse\fR entries as needed.
  1406. They are handled in the order given in the description, that is, later
  1407. X.BR use 's
  1408. will not overwrite capabilities defined earlier in the entry.
  1409. X.SH FILES
  1410. X.DT
  1411. X/etc/terminfo    file containing terminal descriptions
  1412. X.br
  1413. X/etc/term/?/*    directories containing compiled descriptions
  1414. X.SH SEE ALSO
  1415. ex(1), curses(3), tset(1), vi(1), ul(1), more(1)
  1416. X.SH AUTHOR
  1417. Pavel Curtis
  1418. //go.sysin dd *
  1419. exit
  1420.