TERMCAP.5
资源名称:os_source.zip [点击查看]
上传用户:datang2001
上传日期:2007-02-01
资源大小:53269k
文件大小:54k
源码类别:
操作系统开发
开发平台:
C/C++
- TERMCAP(5) Minix Programmer's Manual TERMCAP(5)
- NAME
- termcap - terminal capability data base
- SYNOPSIS
- /etc/termcap
- DESCRIPTION
- Termcap is a data base describing terminals, used, e.g., by vi(1) and
- curses(3). Terminals are described in termcap by giving a set of
- capabilities that they have and by describing how operations are
- performed. Padding requirements and initialization sequences are
- included in termcap.
- Entries in termcap consist of a number of `:'-separated fields. The
- first entry for each terminal gives the names that are known for the
- terminal, separated by `|' characters. The first name is always two
- characters long and is used by older systems which store the terminal
- type in a 16-bit word in a system-wide data base. The second name given
- is the most common abbreviation for the terminal, the last name given
- should be a long name fully identifying the terminal, and all others are
- understood as synonyms for the terminal name. All names but the first
- and last should be in lower case and contain no blanks; the last name may
- well contain upper case and blanks for readability.
- Terminal names (except for the last, verbose entry) should be chosen
- using the following conventions. The particular piece of hardware making
- up the terminal should have a root name chosen, thus "hp2621". This name
- should not contain hyphens. Modes that the hardware can be in or user
- preferences should be indicated by appending a hyphen and an indicator of
- the mode. Therefore, a "vt100" in 132-column mode would be "vt100-w".
- The following suffixes should be used where possible:
- Suffix Meaning Example
- -w Wide mode (more than 80 columns) vt100-w
- -am With automatic margins (usually default) vt100-am
- -nam Without automatic margins vt100-nam
- -n Number of lines on the screen aaa-60
- -na No arrow keys (leave them in local) concept100-na
- -np Number of pages of memory concept100-4p
- -rv Reverse video concept100-rv
- CAPABILITIES
- The characters in the Notes field in the table have the following
- meanings (more than one may apply to a capability):
- N indicates numeric parameter(s)
- P indicates that padding may be specified
- * indicates that padding may be based on the number of lines
- affected
- BSD 1 November 1985 1
- TERMCAP(5) Minix Programmer's Manual TERMCAP(5)
- o indicates capability is obsolete
- "Obsolete" capabilities have no terminfo equivalents, since they were
- considered useless, or are subsumed by other capabilities. New software
- should not rely on them at all.
- Name Type Notes Description
- ae str (P) End alternate character set
- AL str (NP*) Add n new blank lines
- al str (P*) Add new blank line
- am bool Terminal has automatic margins
- as str (P) Start alternate character set
- bc str (o) Backspace if not ^H
- bl str (P) Audible signal (bell)
- bs bool (o) Terminal can backspace with ^H
- bt str (P) Back tab
- bw bool le (backspace) wraps from column 0 to last column
- CC str Terminal settable command character in prototype
- cd str (P*) Clear to end of display
- ce str (P) Clear to end of line
- ch str (NP) Set cursor column (horizontal position)
- cl str (P*) Clear screen and home cursor
- CM str (NP) Memory-relative cursor addressing
- cm str (NP) Screen-relative cursor motion
- co num Number of columns in a line (See BUGS section below)
- cr str (P) Carriage return
- cs str (NP) Change scrolling region (VT100)
- ct str (P) Clear all tab stops
- cv str (NP) Set cursor row (vertical position)
- da bool Display may be retained above the screen
- dB num (o) Milliseconds of bs delay needed (default 0)
- db bool Display may be retained below the screen
- DC str (NP*) Delete n characters
- dC num (o) Milliseconds of cr delay needed (default 0)
- dc str (P*) Delete character
- dF num (o) Milliseconds of ff delay needed (default 0)
- DL str (NP*) Delete n lines
- dl str (P*) Delete line
- dm str Enter delete mode
- dN num (o) Milliseconds of nl delay needed (default 0)
- DO str (NP*) Move cursor down n lines
- do str Down one line
- ds str Disable status line
- dT num (o) Milliseconds of horizontal tab delay needed (default
- 0)
- dV num (o) Milliseconds of vertical tab delay needed (default 0)
- ec str (NP) Erase n characters
- ed str End delete mode
- ei str End insert mode
- eo bool Can erase overstrikes with a blank
- BSD 1 November 1985 2
- TERMCAP(5) Minix Programmer's Manual TERMCAP(5)
- EP bool (o) Even parity
- es bool Escape can be used on the status line
- ff str (P*) Hardcopy terminal page eject
- fs str Return from status line
- gn bool Generic line type (e.g. dialup, switch)
- hc bool Hardcopy terminal
- HD bool (o) Half-duplex
- hd str Half-line down (forward 1/2 linefeed)
- ho str (P) Home cursor
- hs bool Has extra "status line"
- hu str Half-line up (reverse 1/2 linefeed)
- hz bool Cannot print ~s (Hazeltine)
- i1-i3 str Terminal initialization strings (terminfo only)
- IC str (NP*) Insert n blank characters
- ic str (P*) Insert character
- if str Name of file containing initialization string
- im str Enter insert mode
- in bool Insert mode distinguishes nulls
- iP str Pathname of program for initialization (terminfo only)
- ip str (P*) Insert pad after character inserted
- is str Terminal initialization string (termcap only)
- it num Tabs initially every n positions
- K1 str Sent by keypad upper left
- K2 str Sent by keypad upper right
- K3 str Sent by keypad center
- K4 str Sent by keypad lower left
- K5 str Sent by keypad lower right
- k0-k9 str Sent by function keys 0-9
- kA str Sent by insert-line key
- ka str Sent by clear-all-tabs key
- kb str Sent by backspace key
- kC str Sent by clear-screen or erase key
- kD str Sent by delete-character key
- kd str Sent by down-arrow key
- kE str Sent by clear-to-end-of-line key
- ke str Out of "keypad transmit" mode
- kF str Sent by scroll-forward/down key
- kH str Sent by home-down key
- kh str Sent by home key
- kI str Sent by insert-character or enter-insert-mode key
- kL str Sent by delete-line key
- kl str Sent by left-arrow key
- kM str Sent by insert key while in insert mode
- km bool Has a "meta" key (shift, sets parity bit)
- kN str Sent by next-page key
- kn num (o) Number of function (k0-k9) keys (default 0)
- ko str (o) Termcap entries for other non-function keys
- kP str Sent by previous-page key
- kR str Sent by scroll-backward/up key
- kr str Sent by right-arrow key
- BSD 1 November 1985 3
- TERMCAP(5) Minix Programmer's Manual TERMCAP(5)
- kS str Sent by clear-to-end-of-screen key
- ks str Put terminal in "keypad transmit" mode
- kT str Sent by set-tab key
- kt str Sent by clear-tab key
- ku str Sent by up-arrow key
- l0-l9 str Labels on function keys if not "fn"
- LC bool (o) Lower-case only
- LE str (NP) Move cursor left n positions
- le str (P) Move cursor left one position
- li num Number of lines on screen or page (See BUGS section
- below)
- ll str Last line, first column
- lm num Lines of memory if > li (0 means varies)
- ma str (o) Arrow key map (used by vi version 2 only)
- mb str Turn on blinking attribute
- md str Turn on bold (extra bright) attribute
- me str Turn off all attributes
- mh str Turn on half-bright attribute
- mi bool Safe to move while in insert mode
- mk str Turn on blank attribute (characters invisible)
- ml str (o) Memory lock on above cursor
- mm str Turn on "meta mode" (8th bit)
- mo str Turn off "meta mode"
- mp str Turn on protected attribute
- mr str Turn on reverse-video attibute
- ms bool Safe to move in standout modes
- mu str (o) Memory unlock (turn off memory lock)
- nc bool (o) No correctly-working cr (Datamedia 2500, Hazeltine
- 2000)
- nd str Non-destructive space (cursor right)
- NL bool (o) n is newline, not line feed
- nl str (o) Newline character if not n
- ns bool (o) Terminal is a CRT but doesn't scroll
- nw str (P) Newline (behaves like cr followed by do)
- OP bool (o) Odd parity
- os bool Terminal overstrikes
- pb num Lowest baud where delays are required
- pc str Pad character (default NUL)
- pf str Turn off the printer
- pk str Program function key n to type string s (terminfo
- only)
- pl str Program function key n to execute string s (terminfo
- only)
- pO str (N) Turn on the printer for n bytes
- po str Turn on the printer
- ps str Print contents of the screen
- pt bool (o) Has hardware tabs (may need to be set with is)
- px str Program function key n to transmit string s (terminfo
- only)
- r1-r3 str Reset terminal completely to sane modes (terminfo
- BSD 1 November 1985 4
- TERMCAP(5) Minix Programmer's Manual TERMCAP(5)
- only)
- rc str (P) Restore cursor to position of last sc
- rf str Name of file containing reset codes
- RI str (NP) Move cursor right n positions
- rp str (NP*) Repeat character c n times
- rs str Reset terminal completely to sane modes (termcap only)
- sa str (NP) Define the video attributes
- sc str (P) Save cursor position
- se str End standout mode
- SF str (NP*) Scroll forward n lines
- sf str (P) Scroll text up
- sg num Number of garbage chars left by so or se (default 0)
- so str Begin standout mode
- SR str (NP*) Scroll backward n lines
- sr str (P) Scroll text down
- st str Set a tab in all rows, current column
- ta str (P) Tab to next 8-position hardware tab stop
- tc str Entry of similar terminal - must be last
- te str String to end programs that use termcap
- ti str String to begin programs that use termcap
- ts str (N) Go to status line, column n
- UC bool (o) Upper-case only
- uc str Underscore one character and move past it
- ue str End underscore mode
- ug num Number of garbage chars left by us or ue (default 0)
- ul bool Underline character overstrikes
- UP str (NP*) Move cursor up n lines
- up str Upline (cursor up)
- us str Start underscore mode
- vb str Visible bell (must not move cursor)
- ve str Make cursor appear normal (undo vs/vi)
- vi str Make cursor invisible
- vs str Make cursor very visible
- vt num Virtual terminal number (not supported on all systems)
- wi str (N) Set current window
- ws num Number of columns in status line
- xb bool Beehive (f1=ESC, f2=^C)
- xn bool Newline ignored after 80 cols (Concept)
- xo bool Terminal uses xoff/xon (DC3/DC1) handshaking
- xr bool (o) Return acts like ce cr nl (Delta Data)
- xs bool Standout not erased by overwriting (Hewlett-Packard)
- xt bool Tabs ruin, magic so char (Teleray 1061)
- xx bool (o) Tektronix 4025 insert-line
- A Sample Entry
- The following entry, which describes the Concept-100, is among the more
- complex entries in the termcap file as of this writing.
- BSD 1 November 1985 5
- TERMCAP(5) Minix Programmer's Manual TERMCAP(5)
- ca|concept100|c100|concept|c104|concept100-4p|HDS Concept-100:
- :al=3*E^R:am:bl=^G:cd=16*E^C:ce=16E^U:cl=2*^L:cm=Ea%+ %+ :
- :co#80:.cr=9^M:db:dc=16E^A:dl=3*E^B:do=^J:ei=E200:eo:im=E^P:in:
- :ip=16*:is=EUEfE7E5E8ElENHEKE200Eo&200Eo47E:k1=E5:
- :k2=E6:k3=E7:kb=^h:kd=E<:ke=Ex:kh=E?:kl=E>:kr=E=:ks=EX:
- :ku=E;:le=^H:li#24:mb=EC:me=EN200:mh=EE:mi:mk=EH:mp=EI:
- :mr=ED:nd=E=:pb#9600:rp=0.2*Er%.%+ :se=EdEe:sf=^J:so=EEED:
- :.ta=8t:te=Ev 200200200200200200Eprn:
- :ti=EUEv 8pEpr:ue=Eg:ul:up=E;:us=EG:
- :vb=Ek200200200200200200200200200200200200200200EK:
- :ve=Ew:vs=EW:vt#8:xn:
- :bs:cr=^M:dC#9:dT#8:nl=^J:ta=^I:pt:
- Entries may continue onto multiple lines by giving a as the last
- character of a line, and empty fields may be included for readability
- (here between the last field on a line and the first field on the next).
- Comments may be included on lines beginning with "#".
- Types of Capabilities
- Capabilities in termcap are of three types: Boolean capabilities, which
- indicate particular features that the terminal has; numeric capabilities,
- giving the size of the display or the size of other attributes; and
- string capabilities, which give character sequences that can be used to
- perform particular terminal operations. All capabilities have two-letter
- codes. For instance, the fact that the Concept has automatic margins
- (i.e., an automatic return and linefeed when the end of a line is
- reached) is indicated by the Boolean capability am. Hence the
- description of the Concept includes am.
- Numeric capabilities are followed by the character `#' then the value.
- In the example above co, which indicates the number of columns the
- display has, gives the value `80' for the Concept.
- Finally, string-valued capabilities, such as ce (clear-to-end-of-line
- sequence) are given by the two-letter code, an `=', then a string ending
- at the next following `:'. A delay in milliseconds may appear after the
- `=' in such a capability, which causes padding characters to be supplied
- by tputs after the remainder of the string is sent to provide this delay.
- The delay can be either a number, e.g. `20', or a number followed by an
- `*', i.e., `3*'. An `*' indicates that the padding required is
- proportional to the number of lines affected by the operation, and the
- amount given is the per-affected-line padding required. (In the case of
- insert-character, the factor is still the number of lines affected; this
- is always 1 unless the terminal has in and the software uses it.) When
- an `*' is specified, it is sometimes useful to give a delay of the form
- `3.5' to specify a delay per line to tenths of milliseconds. (Only one
- decimal place is allowed.)
- BSD 1 November 1985 6
- TERMCAP(5) Minix Programmer's Manual TERMCAP(5)
- A number of escape sequences are provided in the string-valued
- capabilities for easy encoding of control characters there. E maps to
- an ESC character, ^X maps to a control-X for any appropriate X, and the
- sequences n r t b f map to linefeed, return, tab, backspace, and
- formfeed, respectively. Finally, characters may be given as three octal
- digits after a , and the characters ^ and may be given as ^ and \.
- If it is necessary to place a : in a capability it must be escaped in
- octal as