terminfo.5
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 5 代码 · 共 1,365 行 · 第 1/4 页
5
1,365 行
if a true.B edis not available..PP.B Insert/delete line.PPIf the terminal can open a new blank line before the line where the cursoris, this should be given as \fBil1\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 that the cursor is on, thisshould be given as \fBdl1\fR; this is done only from the first position onthe line to be deleted.Versions of.B il1and.B dl1that take a single parameter and insert or delete that many lines canbe given as.B iland.BR dl .If the terminal has a settable scrolling region (like the VT100),the command to set this can be described with the.B csrcapability, which takes two parameters:the top and bottom lines of the scrolling region.The cursor position is undefined after using this command.It is possible to get the effect of insert or delete line usingthis command. The.B scand.B rc(save and restore cursor) commands are also useful.Inserting lines at the top or bottom of the screen can also bedone using.B rior.B indon many terminals without a true insert/delete line,and this is often faster even on terminals with those features..PPIf the terminal has the ability to define a window as part ofmemory, which all commands affect,it should be given as the parameterized string.BR wind .The four parameters are the starting and ending lines in memoryand the starting and ending columns in memory, in that order..PPIf the terminal can retain display memory above, then the\fBda\fR capability should be given; if display memory can be retainedbelow, then \fBdb\fR should be given. These indicatethat deleting a line or scrolling may bring nonblank lines up from belowor that scrolling back with \fBri\fR may bring down nonblank lines..PP.B Insert/Delete Character.PPThere are two basic kinds of intelligent terminals with respect toinsert/delete character that can be described using.PN terminfo .The most common insert/delete character operations affect only the characterson the current line and shift characters 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 that iseither eliminated or expanded to two untyped blanks. You can determine thekind of terminal you have by clearing the screen and typingtext separated by cursor motions. Type ``abc\ \ \ \ def'', using localcursor motions (not spaces) between the abc and the def.Then, position the cursor before the abc and put the terminal in insertmode. If typing characters causes the rest of the line to shiftrigidly and characters fall off the end, then your terminal doesnot distinguish between blanks and untyped positions. If the abcshifts over to the def which then move together around the end of thecurrent line and onto the next as you insert, you have the second type ofterminal. You should give the capability \fBin\fR, which stands for``insert null''.While these are two logically separate attributes (one line, as opposed to multilineinsert mode, and special treatment of untyped spaces)every terminal's insert mode can be described with the single attribute..PPTerminfo can describe both terminals that have an insert mode and terminalsthat send a simple sequence to open a blank position on the current line.Give as \fBsmir\fR the sequence to get into insert mode.Give as \fBrmir\fR the sequence to leave insert mode.Then, give as \fBich1\fR any sequence needed to be sent just before sendingthe character to be inserted. Most terminals with a true insert modewill not give \fBich1\fR; terminals that send a sequence to open a screenposition should give it here..NTIf your terminal has both, insert mode is usually preferable to \fBich1\fP.Do not give both, unless the terminal actually requires bothto be used in combination..NEIf post insert padding is needed, give this as a number of millisecondsin \fBip\fR (a string option). Any other sequence that may need to besent after an insert of a single character may also be given in \fBip\fR.If your terminal needs both to be placed into an insert mode anda special code to precede each inserted character, both.BR smir / rmirand.B ich1can be given, and both will be used.The.B ichcapability, with one parameter,.IR n ,will repeat the effects of.B ich1.I ntimes..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 \fBmir\fR to speed up inserting.Omitting \fBmir\fR affects only speed. Some terminals(notably Datamedia's) must not have \fBmir\fR because of the way theirinsert mode works..PPFinally, you can specify.B dch1to delete a single character,.BR dch ,with one parameter,.IR n ,to delete.I n characters,and delete mode by giving \fBsmdc\fR and \fBrmdc\fRto enter and exit delete mode (any mode the terminal needs to be placedin for.B dch1to work)..PPA command to erase.I ncharacters (equivalent to outputting.I nblanks, without moving the cursor)can be given as.B echwith one parameter..PP.B "Highlighting, Underlining, and Visible Bells".PPIf your terminal has one or more kinds of display attributes,these can be represented in a number of different ways.You should choose one display form asstandout mode,representing a good, high contrast, easy to read,format for highlighting error messages and other important information.If you have a choice, reverse video plus half-bright is good,or reverse video alone.The sequences to enter and exit standout modeare given as \fBsmso\fR and \fBrmso\fR, respectively.If the code to change into or out of standoutmode leaves one or even two blank spaces on the screen,as the TVI 912 and Teleray 1061 do,then \fBxmc\fR should be given to tell how many spaces are left..PPCodes to begin underlining and end underlining can be given as \fBsmul\fRand \fBrmul\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 \fBuc\fR..PPOther capabilities to enter various highlighting modes include.B blink(blinking),.B bold(bold or extra bright),.B dim(dim or half-bright),.B invis(blanking or invisible text),.B prot(protected),.B rev(reverse video),.B sgr0(turn off.I allattribute modes),.B smacs(enter alternate character set mode),and.B rmacs(exit alternate character set mode).Turning on any of these modes singly may or may not turn off other modes..PPIf there is a sequence to set arbitrary combinations of modes,this should be given as.B sgr(set attributes),taking nine parameters.Each parameter is either 0 or 1, as the corresponding attribute is on or off.The nine parameters are, in order:standout, underline, reverse, blink, dim, bold, blank, protect, and alternate character set.Not all modes need be supported by.BR sgr ,only those for which corresponding separate attribute commands exist..PPTerminals with the ``magic cookie glitch''.RB ( xmc )deposit special cookies when they receive mode-setting sequences,which affect the display algorithm rather than having extra bits foreach character.Some 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,unless the.B msgrcapability, asserting that it is safe to move in standout mode, is present..PPIf the terminal hasa way of flashing the screen to indicate an error quietly (a bell replacement),this can be given as \fBflash\fR; however, it must not move the cursor..PPIf the cursor needs to be made more visible than normal when it isnot on the bottom line (to make, for example, a non-blinking underline into aneasier to find block or blinking underline),give this sequence as.BR cvvis .If you wish to make the cursor completely invisible, give that as.BR civis .The capability.BR cnormshould be given which undoes the effects of both of these modes..PPIf the terminal needs to be in a special mode when runninga program that uses these capabilities,the codes to enter and exit this mode can be given as \fBsmcup\fR and \fBrmcup\fR.This arises, for example, from terminals like the Concept-100 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.This is also used for the \s-1TEKTRONIX\s+1 4025,where.B smcupsets the command character to be the one used by terminfo..PPIf your terminal correctly generates underlined characters(with no special codes needed)even though it does not overstrike,you should give the capability \fBul\fR.If overstrikes are erasable with a blank,this should be indicated by giving \fBeo\fR..PP.B Keypad.PPIf the terminal has a keypad that transmits codes when the keys are pressed,give this information. Note that it is not possible to handleterminals where the keypad only works 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 \fBsmkx\fR and \fBrmkx\fR.Otherwise, the keypad is always assumed to transmit.The codes sent by the left arrow, right arrow, up arrow, down arrow,and home keys can be given as \fBkcub1, kcuf1, kcuu1, kcud1,\fRand\fB khome\fR, respectively.If there are function keys such as f0, f1, ... f10, the codes they sendcan be given as \fBkf0, kf1, ... kf10\fR.If these keys have labels other than the default f0 through f10, the labelscan be given as \fBlf0, lf1, ... lf10\fR.The codes transmitted by certain other special keys can be given:.B kll(home down),.B kbs(backspace),.B ktbc(clear all tabs),.B kctab(clear the tab stop in this column),.B kclr(clear screen or erase key),.B kdch1(delete character),.B kdl1(delete line),.B krmir(exit insert mode),.B kel(clear to end of line),.B ked(clear to end of screen),.B kich1(insert character or enter insert mode),.B kil1(insert line),.B knp(next page),.B kpp(previous page),.B kind(scroll forward/down),.B kri(scroll backward/up),.B khts(set a tab stop in this column).In addition, if the keypad has a 3 by 3 array of keys including the fourarrow keys, the other five keys can be given as.BR ka1 ,.BR ka3 ,.BR kb2 ,.BR kc1 ,and.BR kc3 .These keys are useful when the effects of a 3 by 3 directional pad are needed..PP.B Tabs and Initialization.PPIf the terminal has hardware tabs, the command to advance to the nexttab stop can be given as.B ht(usually CTRL I).A backtab command which moves leftward to the next tab stop canbe given as.BR cbt .By convention, if the teletype modes indicate that tabs are beingexpanded by the computer rather than being sent to the terminal,programs should not use.B htor.B cbt,even if they are present, since the user may not have the tab stopsproperly set.If the terminal has hardware tabs that are initially set every.I nspaces when the terminal is powered up,the numeric parameter.B itis given, showing the number of spaces the tabs are set to.This is normally used by the.PN tsetcommand to determine whether to set the mode for hardware tab expansion
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?