📄 termcap.5
字号:
The Microterm 2ACT-IV needs the current row and column sentpreceded by a ^T, with the row and column simply encoded in binary,``cm=^T%.%.''.Terminals that use ``%.'' need to be able tobackspace the cursor (\f(CWbs\fR or \f(CWbc\fR),and to move the cursor upone line on the screen (\f(CWup\fR introduced in the following section).This is necessarybecause it is not always safe to transmit \f(CW\et\fR, \f(CW\en\fR\f(CW^D\fR, and \f(CW\er\fR, as the system may change or discard them..PPA final example is the LSI ADM-3a, which uses row and columnoffset by a blank character; thus \*(lqcm=\eE=%+ %+ \*(rq..PP.B Cursor Motions.PPIf the terminal can move the cursor one position to the right, leavingthe character at the current position unchanged,this sequence shouldbe given as \f(CWnd\fR (non-destructive space). If it can move the cursorup a lineon the screen in the same column, this should be given as \f(CWup\fR.If the terminal has no cursor addressing capability,but can home the cursor(to very upper left corner of screen), this can be given as\f(CWho\fR. Similarly a fast way of getting to the lower left hand cornercan be given as \f(CWll\fR. This may involve going up with \f(CWup\fRfrom the home position,but the editor will never dothis itself, unless \f(CWll\fR does, because itmakes no assumption about the effect ofmoving up from the home position..PP.B Area Clears.PPIf the terminal can clear from the current position to the end of theline, leaving the cursor where it is, this should be given as \f(CWce\fR.If the terminal can clear from the current position to the end of thedisplay, this should be given as \f(CWcd\fR.The editor only uses\f(CWcd\fR from the first column of a line..PP.B Insert/Delete Line.PPIf the terminal can open a newblank line before the line where the cursoris, this should be given as \f(CWal\fR; this is done only from the firstposition of a line.The cursor must then appear on the newly blank line.If the terminal can delete the line which the cursor is on, thisshould be given as \f(CWdl\fR.This is done only from the first position onthe line to be deleted.If the terminal can scrollthe screen backwards, this can be given as\f(CWsb\fR, but just \f(CWal\fR suffices.If the terminal can retain display memory above, the\f(CWda\fR capability should be given; if display memory can be retainedbelow, \f(CWdb\fR should be given. These let the editor understandthat deleting a line on thescreen may bring nonblank lines up from belowor that scrolling back with \f(CWsb\fR may bring down nonblank lines..PP.B Insert/Delete Character.PPThere are two basic kinds of intelligent terminals with respect tothe insert/delete character that can be described using.PN termcap .The most common insert/delete characteroperations affect only the characterson the current line and shiftcharacters off the end of the line rigidly.Other terminals, such as the Concept 100 and the Perkin Elmer Owl, makea distinction between typed and untyped blanks on the screen, shiftingupon an insert or delete only to an untyped blank on the screen which iseither eliminated, or expanded to 2 untyped blanks. You can find outwhich kind of terminal you have by clearing the screen and typingtext separated by cursor motions.Type \*(lqabc\ \ \ \ def\*(rq using localcursor motions (not spaces) betweenthe \*(lqabc\*(rq and the \*(lqdef\*(rq.Then, position the cursor beforethe \*(lqabc\*(rq and put the terminal in insertmode. If typing characters causes the rest of the line to shiftrigidly and characters to fall off the end, your terminal doesnot distinguish between blanks and untypedpositions. If the \*(lqabc\*(rqshifts over to the \*(lqdef\*(rqand then moves with it around the end of thecurrent line and ontothe next line as you insert, you have the second type ofterminal, and should give the capability \f(CWin\fR, which stands for\*(lqinsert null\*(rq.If your terminal does something different and unusual,you may have to modify the editor to get it to use the insertmode your terminal defines.Virtually all terminals that have an insertmode fall into one of these two classes..PPThe editor can handle both terminals that have an insert mode and terminalsthat send a simple sequenceto open a blank position on the current line.Give as \f(CWim\fR the sequence to get into insert mode, or give it anempty value if your terminal uses a sequence to insert a blank position.Give as \f(CWei\fR the sequence to leave insert mode (give this withan empty value also, if you gave \f(CWim\fR so).Give as \f(CWic\fR any sequence needed to be sent just before sendingthe character to be inserted. Most terminals with a true insert modewill not give \f(CWic\fR. Terminals that send a sequence to open a screenposition should give it here.(Insert mode is preferable to the sequenceto open a position on the screen, if your terminal has both.)If post insert padding is needed, give this as a number of millisecondsin \f(CWip\fR (a string option). Any other sequence that may need to besent after an insert of a singlecharacter can also be given in \f(CWip\fR..PPIt is occasionally necessary to move around while in insert modeto delete characters on the same line (for example, if there is a tab afterthe insertion position). If your terminal allows motion while ininsert mode, you can give the capability \f(CWmi\fR to speed up insertingin this case.Omitting \f(CWmi\fR affects only speed. Some terminals(notably Datamedia's) must not have \f(CWmi\fR because of the way theirinsert mode works..PPFinally, you can specify delete mode by giving \f(CWdm\fR and \f(CWed\fRto enter and exit delete mode, and \f(CWdc\fR to delete a single characterwhile in delete mode..PP.B "Highlighting, Underlining, and Visible Bells".PPIf your terminal has sequences to enter and exit standout mode, thesecan be given as \f(CWso\fR and \f(CWse\fR, respectively.If there are several kinds of standout mode,such as inverse video, blinking, or underlining.Half-bright is not usually an acceptable \*(lqstandout\*(rq mode,unless the terminal is in inverse video mode constantly.The preferred mode is inverse video by itself.If the code to change into or out of standoutmode leaves 1 or even 2 blank spaces on the screen,as the TVI 912 and Teleray 1061 do,\f(CWug\fR should be given to tell how many spaces are left..PPCodes to begin underlining and end underlining can be given as \f(CWus\fRand \f(CWue\fR, respectively.If the terminal has a code to underline the current character and movethe cursor one space to the right, such as the Microterm Mime,this can be given as \f(CWuc\fR.(If the underline code does not move the cursor to the right,give the code followed by a nondestructive space.).PPMany terminals, such as the HP 2621, automatically leave standoutmode when they move to a new line or the cursor is addressed.Programs using standout mode should exit standout mode beforemoving the cursor or sending a newline..PPIf the terminal hasa way of flashing the screen to indicatean error quietly (a bell replacement),this can be given as \f(CWvb\fR; it must not move the cursor.If the terminal should be placed in a different mode duringopen and visual modes of.PN ex ,this can be given as\f(CWvs\fR and \f(CWve\fR, sent at the start and end of these modesrespectively. These can be used to change, for example, from an underlineto a block cursor and back..PPIf the terminal needs to be in a special mode when runninga program that addresses the cursor,the codes to enter and exitthis mode can be given as \f(CWti\fR and \f(CWte\fR.This arises, for example, from terminals like the Concept with more thanone page of memory.If the terminal has only memory-relative cursor addressing and not screen-relative cursor addressing, a one-screen sized window must be fixed intothe terminal for cursor addressing to work properly..PPIf your terminal correctly generates underlined characters,with no special codes needed,even though it does not overstrike,you should give the capability \f(CWul\fR.If overstrikes are erasable with a blank,this should be indicated by giving \f(CWeo\fR..PP.B Keypad.PPIf the terminal has a keypad thattransmits codes when the keys are pressed,this information can be given. Note that it is not possible to handleterminals where the keypad onlyworks in local (this applies, for example,to the unshifted HP 2621 keys).If the keypad can be set to transmit or not transmit,give these codes as \f(CWks\fR and \f(CWke\fR.Otherwise, the keypad is assumed to always transmit.The codes sent by the left arrow, right arrow, up arrow, down arrow,and home keys can be given as\f(CWkl\fR, \f(CWkr\fR, \f(CWku\fR, \f(CWkd\fR, and \f(CWkh\fR,respectively.If there are function keys such as f0, f1, ..., f9, the codes they sendcan be given as \f(CWk0\fR, \f(CWk1\fR, ..., \f(CWk9\fR.If these keys have labels other thanthe default f0 through f9, the labelscan be given as \f(CWl0\fR, \f(CWl1\fR, ..., \f(CWl9\fR.If there are other keys thattransmit the same code as the terminal expectsfor the corresponding function, such as clear screen, the .PN termcapP2-letter codes can be given in the \f(CWko\fR capability,for example, \*(lq:ko=cl,ll,sf,sb:\*(rq,which says that the terminal hasclear, home down, scroll down, and scroll up keys that transmitthe same thing as the .PN cl , .PN ll , .PN sf , and .PN sb entries..PPThe.PN maentry is also used to indicate arrow keys on terminals that havesingle-character arrow keys. It is obsolete, but still in use inVersion 2 of .PN vi ,which must be run on some minicomputers due tomemory limitations.This field is redundant with\f(CWkl\fR, \f(CWkr\fR, \f(CWku\fR, \f(CWkd\fR, and \f(CWkh\fR.It consists of groups of 2 characters.In each group, the first character is what an arrow key sends; thesecond character is the corresponding.PN vi command.These commands are.PN hfor.PN kl ,.PN jfor.PN kd ,.PN kfor.PN ku ,.PN lfor.PN kr ,and.PN Hfor.PN kh .For example, the Microterm Mime would be ``ma=^Kj^Zk^Xl:''indicating arrow keys left (^H), down (^K), up (^Z), and right (^X).(There is no home key on the Mime.).PP.B Miscellaneous.PPIf the terminal requires other than a null (zero) character as a pad,this can be given as \f(CWpc\fR..PPIf tabs on the terminal require padding, or if the terminal uses acharacter other than \f(CW^I\fR to tab,this can be given as \f(CWta\fR..PPHazeltine terminals, which do not allow tildes (~)to be printed, should indicate \f(CWhz\fR.Datamedia terminals, which echocarriage-return linefeed for a carriage returnand then ignore a following linefeed, should indicate \f(CWnc\fR.Early Concept terminals,which ignore a linefeed immediately after an \f(CWam\fRwrap, should indicate \f(CWxn\fR.If an erase-eol is required to get rid of standout(instead of merely writing on top of it),\f(CWxs\fP should be given.Teleray terminals, where tabs turn all characters moved over to blanks,should indicate \f(CWxt\fR.Other specific terminal problems may be corrected by adding morecapabilities of the form \f(CWx\fIx\fR..PPOther capabilitiesinclude \f(CWis\fR, an initialization string for the terminal,and \f(CWif\fR, the name of a file containing long initialization strings.These strings are expected to properly clear and then set the tabson the terminal, if the terminal has settable tabs.If both are given, \f(CWis\fR is printed before \f(CWif\fR.This is useful where \f(CWif\fR is.PN /usr/lib/tabset/stdbut \f(CWis\fRclears the tabs first..PP.B Similar Terminals.PPIf there are two very similar terminals,one can be defined as being just like the other with certain exceptions.The string capability \f(CWtc\fR can be givenwith the name of the similar terminal.This capability must be \fIlast\fP andthe combined length of the two entriesmust not exceed 1024. Since.PN termlibroutines search the entry from left to right,and since the tc capability isreplaced by the corresponding entry, the capabilities given at the leftoverride the ones in the similar terminal.A capability can be canceled with \f(CWxx@\fR, where xx is the capability.For example, the following entrydefines a 2621nl that does not have the\f(CWks\fR or \f(CWke\fR capabilities,and hence does not turn on the function key labels when in visual mode:.EXhn\||\|2621nl:ks@:ke@:tc=2621:.EE.PPThis is useful for different modes for a terminal or for differentuser preferences..SH RestrictionsThe.PN viand.PN excommandsallow only 256 characters for string capabilities, and the routinesin .MS termcap 3xdo not check for overflow of this buffer.The total length of a single entry (excluding only escaped newlines)cannot exceed 1024..PPThe.PN ma ,.PN vs ,and.PN veentries are specific to the .PN viprogram..SH Files.TP 20.PN /etc/termcapFile containing terminal descriptions.SH See Alsoex(1), more(1), tset(1), ul(1), vi(1), curses(3x), termcap(3x).NXE "termcap file" "format".NXE "terminal" "creating capability data base"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -