📄 termcap.5
字号:
.\" SCCSID: @(#)termcap.5 R2.4 7/10/87.tr ||.TH termcap 5.SH Nametermcap \- terminal capability data base.SH Syntax/etc/termcap.SH Description.NXB "termcap file" "format".NXB "terminal" "creating capability data base".NXA "termcap file" "printcap file".NXA "termcap file" "gettytab file"The.PN termcapfile is a data base describing terminals used,for example, by .MS vi 1and.MS curses 3x .Terminals are described in.PN termcapby giving a set of capabilities which they have and by describinghow operations are performed.Padding requirements and initialization sequencesare included in.PN termcap ..PPEntries in.PN termcapconsist of a number of fields separated by colons (:).The first entry for each terminal givesthe names which are known for theterminal, separated by vertical bars (|).The first name is always 2 characterslong and is used by older Version 6systems, which store the terminal typein a 16-bit word in a system-wide data base.The second name given is the mostcommon abbreviation for the terminal, and thelast name given should be a long name fully identifying the terminal.The second name should contain no blanks. The last name may containblanks for readability..SH Capabilities.nf(P) indicates padding is commonly needed for these strings.(P*) indicates that padding may be based on the number of lines affected..ta \w'k0-k9 'u +\w'Type 'u +\w'Pad? 'u\fBName Type Pad? Description\fR.spae str (P) End alternate character set.al str (P*) Add new blank line.am bool Terminal has automatic margins.as str (P) Start alternate character set.bc str Backspace, if not CTRL/H.bl str Audible bell character.bs bool Terminal can backspace with CTRL/H.bt str (P) Back tab.bw bool Backspace wraps from column 0 to last column.CC str Command character in prototype, if terminal-settable.ca bool Cursor addressable.cd str (P*) Clear to end of display.ce str (P) Clear to end of line.ch str (P) Like \f(CWcm\fP, but horizontal motion only; line stays the same.cl str (P*) Clear screen.cm str (P) Cursor motion.co num Number of columns in a line.cr str (P*) Carriage return (default CTRL/M).cs str (P) Change scrolling region (VT100); like \f(CWcm\fP.ct str Clear all tab stops.cv str (P) Like \f(CWch\fP, but vertical only.da bool Display may be retained above.dB num Number of millisec of \f(CWbs\fP delay needed.db bool Display may be retained below.dC num Number of millisec of \f(CWcr\fP delay needed.dc str (P*) Delete character.dF num Number of millisec of \f(CWff\fP delay needed.dl str (P*) Delete line.dm str Delete mode (enter).dN num Number of millisec of \f(CWnl\fP delay needed.do str Move down one line.ds str Clear host writable status line.dT num Number of millisec of \f(CWta\fP delay needed.ed str End delete mode.ei str End insert mode; give ``:ei=:'' if \f(CWic\fP.eo str Can erase overstrikes with a blank.es bool Standout mode allowed on host writable status line.ff str (P*) Hard-copy terminal page eject (default CTRL/L).fs str Close host writable status line to writing.gt bool Gtty indicates tabs.hc bool Hard-copy terminal.hd str Half-line down (forward 1/2 linefeed).ho str Home cursor (if no \f(CWcm\fR).hs bool Host writable status line capabilities.hu str Half-line up (reverse 1/2 linefeed).hz str Hazeltine; cannot print tildes (~).ic str (P) Insert character.if str Name of file containing \f(CWis\fR.im str Insert mode (enter); give ``:im=:'' if \f(CWic\fR.in bool Insert mode distinguishes nulls on display.ip str (P*) Insert pad after character inserted.is str Terminal initialization string.k0-k9 str Sent by \*(lqother\*(rq function keys 0-9.kb str Sent by backspace key.kd str Sent by terminal down arrow key.ke str Out of \*(lqkeypad transmit\*(rq mode.kh str Sent by home key.kl str Sent by terminal left arrow key.kn num Number of \*(lqother\*(rq keys.ko str Termcap entries for other nonfunction keys.kr str Sent by terminal right arrow key.ks str Put terminal in \*(lqkeypad transmit\*(rq mode.ku str Sent by terminal up arrow key.l0-l9 str Labels on \*(lqother\*(rq function keys.le str Move cursor left one place.li num Number of lines on screen or page.ll str Last line, first column (if no \f(CWcm\fR).ma str Arrow key map, used by \f(CWvi\fP Version 2 only.mb str Turn on blinking.md str Enter bold (extra-bright) mode.me str Turn off all attributes, normal mode.mh str Enter dim (half-bright) mode.mi bool Safe to move while in insert mode.ml str Memory lock on above cursor.mr str Enter reverse mode.ms bool Safe to move while in standout and underline mode.mu str Memory unlock (turn off memory lock).nc bool No correctly working carriage return (DM2500,H2000).nd str Nondestructive space (cursor right).nl str (P*) Newline character (default \f(CW\en\fR).ns bool Terminal is a CRT, but does not scroll.os bool Terminal overstrikes.pc str Pad character (rather than null).pt bool Has hardware tabs (may need to be set with \f(CWis\fR).rc str Recover from last save cursor (\f(CWsc\fP).rf str Reset file, like initialization file (\f(CWif\fP) but for reset.rs str Reset string, like initialization string (\f(CWis\fP) but for reset.sc str Save cursor.se str End stand out mode.sf str (P) Scroll forwards.sg num Number of blank chars left by \f(CWso\fP or \f(CWse\fP.so str Begin stand out mode.sr str (P) Scroll reverse (backwards).st str Save cursor.ta str (P) Tab (other than CTRL/I or with padding).tc str Entry of similar terminal \- must be last.te str String to end programs that use \f(CWcm\fP.ti str String to begin programs that use \f(CWcm\fR.ts str Open host writable status line to writing.[jA.uc str Underscore one char and move past it.ue str End underscore mode.ug num Number of blank chars left by \f(CWus\fP or \f(CWue\fP.ul bool Terminal underlines even though it does not overstrike.up str Upline (cursor up).us str Start underscore mode.vb str Visible bell (may not move cursor).ve str Sequence to end open/visual mode.vs str Sequence to start open/visual mode.vt num Virtual terminal number.xb bool Beehive (f1=escape, f2=CTRL/C).xn bool A newline is ignored after a wrap (Concept).xr bool Return acts like \f(CWce\fP \er \en (Delta Data).xs bool Standout not erased by writing over it (HP 264?).xt bool Tabs are destructive, magic so char (Teleray 1061)..fi.PP.B A Sample Entry.PPThe following entry, which describes the Concept\-100, is among the morecomplex entries in the.PN termcapfile as of this writing.This particular `Concept' entry is outdatedand is used as an example only:.PP.EX 0c1\||\|c100\||\|concept100:is=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200:\e :al=3*\eE^R:am:bs:cd=16*\eE^C:ce=16\eE^S:cl=2*^L:cm=\eEa%+ %+:\e :co#80:dc=16\eE^A:dl=3*\eE^B:ei=\eE\e200:eo:im=\eE^P:in:\e :ip=16*:li#24:mi:nd=\eE=:se=\eEd\eEe:so=\eED\eEE:ta=8\et:\e :ul:up=\eE;:vb=\eEk\eEK:xn:.EE.PPEntries can continue onto multiple lines by giving a backslash (\\) as the lastcharacter of a line. Empty fieldscan be included for readability (here between the last field on a lineand the first field on the next)..PP.B Types of Capabilities.PPCapabilities in.PN termcapare of three types:Boolean capabilities that indicate that the terminal hassome particular feature; numeric capabilities givingthe size of the terminalor the size of particular delays; and stringcapabilities, which give a sequencethat can be used to perform particularterminal operations..PPAll capabilities have 2-letter codes. For instance, the fact thatthe Concept has \*(lqautomatic margins\*(rq (that is, an automatic return and linefeedwhen the end of a line is reached) is indicatedby the capability \f(CWam\fR.Hence, the description of the Concept includes \f(CWam\fR.Numeric capabilities are followed bythe number sign (#) and then the value.Thus, \f(CWco\fR, which indicates the number of columns the terminal has,gives the value `80' for the Concept..PPFinally, string-valued capabilities,such as \f(CWce\fR (clear to end-of-linesequence), are given by the 2-character code: an equal sign (=)and then a string ending at the next following colon (:).A delay in milliseconds may appear after the equal sign (=)in such a capability. Padding characters are supplied by theeditor after the remainder of the string is sent to provide this delay.The delay can be either an integer, for example, ``20'', or an integer followed by an asterisk (*), for example ``3*''. An asterisk (*)indicates that the padding required is proportionalto the number of lines affected by theoperation, and the amount given isthe per-affected-unit padding required.When an asterisk (*) is specified,it is sometimes useful to give a delay of the form ``3.5'' to specify a delay per unit to tenths of milliseconds..PPA number of escape sequences are providedin the string-valued capabilitiesfor easy encoding of characters there. A \f(CW\eE\fR maps to an ESCAPEcharacter, \f(CWO^x\fR maps to aCTRL/x for any appropriate x, and the sequences\f(CW\en \er \et \eb \ef\fR give a newline,return, tab, backspace and formfeed.Finally, characters may be given as three octal digits after a backslash (\\),and the characters circumflex (^) and backslash (\\) maybe given as \f(CW\e^\fR and \f(CW\e\e\fR.If it is necessary to place a colon (:) in acapability, it must be escaped inoctal as \f(CW\e072\fR.If it is necessary to place a null character in a string capability, itmust be encoded as \f(CW\e200\fR. The routines that deal with.PN termcapuse C strings and strip the high bits of the output very late so thata \f(CW\e200\fR comes out as a \f(CW\e000\fR would..br.ne 5.PP.B Preparing Descriptions.PPThis section outlines how to prepare descriptions of terminals.The most effective way to prepare a terminal description is by imitatingthe description of a similar terminal in.PN termcapand to build up a description gradually, using partial descriptionswith.PN exto check that they are correct.Be aware that a very unusual terminal may expose deficiencies inthe ability of the.PN termcapfile to describe itor bugs in.PN ex .To easily test a new terminal description,you can set the environment variableTERMCAP to a pathname of a filecontaining the description you are workingon and the editor will look there rather than in .PN /etc/termcap .TERMCAP can also be set to the termcap entry itselfto avoid reading the file when starting up the editor.This only works on Version 7 systems..PP.B Basic Capabilities.PPThe number of columns on each line for the terminal is given by the\f(CWco\fR numeric capability. If the terminal is a CRT, thenumber of lines on the screen is given by the \f(CWli\fR capability.If the terminal wraps around to the beginning of the next line whenit reaches the right margin, itshould have the \f(CWam\fR capability.If the terminal can clear its screen, this is given by the\f(CWcl\fR string capability. If the terminal can backspace, itshould have the \f(CWbs\fR capability, unless a backspace is accomplishedby a character other than ^H, in which case you should givethis character as the \f(CWbc\fR string capability. If it overstrikes,rather than clearing a position when a character is struck over,it should have the \f(CWos\fR capability..PPA very important point here is that the local cursor motions encodedin.PN termcapare undefined at the left and top edges of a CRT terminal.The editor will never attempt to backspace around the left edge, norwill it attempt to go up locally off the top. The editor assumes thatfeeding off the bottom of the screen will cause the screen to scroll up,and the \f(CWam\fR capability tells whether the cursor sticks at the rightedge of the screen.If the terminal has switch-selectable automatic margins,the.PN termcapfile usually assumes that this is on, that is, \f(CWam\fR..PPThese capabilities suffice to describehard-copy and \*(lqglass-tty\*(rq terminals.Thus, the model 33 teletype is described as:.EXt3\||\|33\||\|tty33:co#72:os.EE.PPThe Lear Siegler ADM\-3 is described as:.EXcl\||\|adm3|3|lsi adm3:am:bs:cl=^Z:li#24:co#80.EE.PP.B Cursor Addressing.PPCursor addressing in the terminal is described by a\f(CWcm\fR string capability, with .MS printf 3stypes of escapes such as \f(CW%x\fR in it.These substitute to encodings of the current line or column position,while other characters are passed through unchanged.If the \f(CWcm\fR string is thought of as being a function, itsarguments are the line and then the column to which motion is desired,and the \f(CW%\fR encodings have the following meanings:.PP.DT.nf%d As in \fIprintf\fR, 0 origin%2 Like %2d%3 Like %3d%. Like %c%+x Adds \fIx\fR to value, then %.%>xy If value > x adds y, no output.%r Reverses order of line and column, no output%i Increments line/column (for 1 origin)%% Gives a single %%n Exclusive or row and column with 0140 (DM2500)%B BCD (16*(x/10)) + (x%10), no output.%D Reverse coding (x-2*(x%16)), no output. (Delta Data)..fi.PPConsider the HP2645, which, to get to row 3 and column 12, needsto be sent \eE&a12c03Y padded for 6 milliseconds. Note that the orderof the rows and columns is inverted here, and that the row and columnare printed as 2 digits.Thus, its \f(CWcm\fR capability is ``cm=6\eE&%r%2c%2Y''.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -