⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 terminfo.tail

📁 ncurses 库 可能有用酒用 没用就算了 我觉得还可以用
💻 TAIL
📖 第 1 页 / 共 4 页
字号:
.PPThe argument values of \fBsetf\fR/\fBsetb\fR historically correspond toa different mapping, i.e.,.TS Hcenter;l c c cl l n l.\fBColor	#define 	Value	RGB\fRblack	\fBCOLOR_BLACK\fR	0	0, 0, 0blue	\fBCOLOR_BLUE\fR	1	0,0,maxgreen	\fBCOLOR_GREEN\fR	2	0,max,0cyan	\fBCOLOR_CYAN\fR	3	0,max,maxred	\fBCOLOR_RED\ \fR	4	max,0,0magenta	\fBCOLOR_MAGENTA\fR	5	max,0,maxyellow	\fBCOLOR_YELLOW\fR	6	max,max,0white	\fBCOLOR_WHITE\fR	7	max,max,max.TEIt is important to not confuse the two sets of color capabilities;otherwise red/blue will be interchanged on the display..PPOn an HP-like terminal, use \fBscp\fR with a color-pair number parameter to setwhich color pair is current..PPOn a Tektronix-like terminal, the capability \fBccc\fR may be present toindicate that colors can be modified.If so, the \fBinitc\fR capability willtake a color number (0 to \fBcolors\fR - 1)and three more parameters whichdescribe the color.These three parameters default to being interpreted as RGB(Red, Green, Blue) values.If the boolean capability \fBhls\fR is present,they are instead as HLS (Hue, Lightness, Saturation) indices.The ranges areterminal-dependent..PPOn an HP-like terminal, \fBinitp\fR may give a capability for changing acolor-pair value.It will take seven parameters; a color-pair number (0 to\fBmax_pairs\fR - 1), and two triples describing first background and thenforeground colors.These parameters must be (Red, Green, Blue) or(Hue, Lightness, Saturation) depending on \fBhls\fR..PPOn some color terminals, colors collide with highlights.You can registerthese collisions with the \fBncv\fR capability.This is a bit-mask ofattributes not to be used when colors are enabled.The correspondence with theattributes understood by \fBcurses\fR is as follows:.PP.TScenter;l c clw25 lw2 lw10.\fBAttribute	Bit	Decimal\fRA_STANDOUT	0	1A_UNDERLINE	1	2A_REVERSE	2	4A_BLINK   	3	8A_DIM      	4	16A_BOLD    	5	32A_INVIS   	6	64A_PROTECT	7	128A_ALTCHARSET	8	256.TE.PPFor example, on many IBM PC consoles, the underline attribute collides with theforeground color blue and is not available in color mode.These should havean \fBncv\fR capability of 2..PPSVr4 curses does nothing with \fBncv\fR, ncurses recognizes it and optimizesthe output in favor of colors..PP.SS MiscellaneousIf the terminal requires other than a null (zero) character as a pad, then thiscan be given as pad.Only the first character of the pad string is used.If the terminal does not have a pad character, specify npc.Note that ncurses implements the termcap-compatible \fBPC\fR variable;though the application may set this value to something other thana null, ncurses will test \fBnpc\fR first and use napms if the terminalhas no pad character..PPIf the terminal can move up or down half a line,this can be indicated with.B hu(half-line up)and.B hd(half-line down).This is primarily useful for superscripts and subscripts on hard-copy terminals.If a hard-copy terminal can eject to the next page (form feed), give this as.B ff(usually control L)..PPIf there is a command to repeat a given character a given number oftimes (to save time transmitting a large number of identical characters)this can be indicated with the parameterized string.BR rep .The first parameter is the character to be repeated and the secondis the number of times to repeat it.Thus, tparm(repeat_char, 'x', 10) is the same as `xxxxxxxxxx'..PPIf the terminal has a settable command character, such as the \s-1TEKTRONIX\s+1 4025,this can be indicated with.BR cmdch .A prototype command character is chosen which is used in all capabilities.This character is given in the.B cmdchcapability to identify it.The following convention is supported on some UNIX systems:The environment is to be searched for a.B CCvariable, and if found, alloccurrences of the prototype character are replaced with the characterin the environment variable..PPTerminal descriptions that do not represent a specific kind of knownterminal, such as.IR switch ,.IR dialup ,.IR patch ,and.IR network ,should include the.B gn(generic) capability so that programs can complain that they do not knowhow to talk to the terminal.(This capability does not apply to.I virtualterminal descriptions for which the escape sequences are known.).PPIf the terminal has a ``meta key'' which acts as a shift key,setting the 8th bit of any character transmitted, this fact canbe indicated with.BR km .Otherwise, software will assume that the 8th bit is parity and itwill usually be cleared.If strings exist to turn this ``meta mode'' on and off, theycan be given as.B smmand.BR rmm ..PPIf the terminal has more lines of memory than will fit on the screenat once, the number of lines of memory can be indicated with.BR lm .A value of.BR lm #0indicates that the number of lines is not fixed,but that there is still more memory than fits on the screen..PPIf the terminal is one of those supported by the \s-1UNIX\s+1 virtualterminal protocol, the terminal number can be given as.BR vt ..PPMedia copystrings which control an auxiliary printer connected to the terminalcan be given as.BR mc0 :print the contents of the screen,.BR mc4 :turn off the printer, and.BR mc5 :turn on the printer.When the printer is on, all text sent to the terminal will be sentto the printer.It is undefined whether the text is also displayed on the terminal screenwhen the printer is on.A variation.B mc5ptakes one parameter, and leaves the printer on for as many charactersas the value of the parameter, then turns the printer off.The parameter should not exceed 255.All text, including.BR mc4 ,is transparently passed to the printer while an.B mc5pis in effect..PP.SS Glitches and Braindamage.PPHazeltine terminals, which do not allow `~' characters to be displayed shouldindicate \fBhz\fR..PPTerminals which ignore a line-feed immediately after an \fBam\fR wrap,such as the Concept and vt100,should indicate \fBxenl\fR..PPIf.B elis required to get rid of standout(instead of merely writing normal text on top of it),\fBxhp\fP should be given..PPTeleray terminals, where tabs turn all characters moved over to blanks,should indicate \fBxt\fR (destructive tabs).Note: the variable indicating this is now `dest_tabs_magic_smso'; inolder versions, it was teleray_glitch.This glitch is also taken to mean that it is not possible to positionthe cursor on top of a ``magic cookie'',that to erase standout mode it is instead necessary to usedelete and insert line.The ncurses implementation ignores this glitch..PPThe Beehive Superbee, which is unable to correctly transmit the escapeor control C characters, has.BR xsb ,indicating that the f1 key is used for escape and f2 for control C.(Only certain Superbees have this problem, depending on the ROM.)Note that in older terminfo versions, this capability was called`beehive_glitch'; it is now `no_esc_ctl_c'..PPOther specific terminal problems may be corrected by adding morecapabilities of the form \fBx\fR\fIx\fR..PP.SS Similar Terminals.PPIf there are two very similar terminals, one (the variant) can be defined asbeing just like the other (the base) with certain exceptions.In thedefinition of the variant, the string capability \fBuse\fR can be given withthe name of the base terminal.The capabilities given before.B useoverride those in the base type named by.BR use .If there are multiple \fBuse\fR capabilities, they are merged in reverse order.That is, the rightmost \fBuse\fR reference is processed first, then the one toits left, and so forth.Capabilities given explicitly in the entry overridethose brought in by \fBuse\fR references..PPA capability can be canceled by placing \fBxx@\fR to the left of theuse reference that imports it, where \fIxx\fP is the capability.For example, the entry.PP	2621-nl, smkx@, rmkx@, use=2621,.PPdefines a 2621-nl that does not have the \fBsmkx\fR or \fBrmkx\fR capabilities,and hence does not turn on the function key labels when in visual mode.This is useful for different modes for a terminal, or for differentuser preferences..PP.SS Pitfalls of Long Entries.PPLong terminfo entries are unlikely to be a problem; to date, no entry has evenapproached terminfo's 4096-byte string-table maximum.Unfortunately, the termcaptranslations are much more strictly limited (to 1023 bytes), thus termcap translationsof long terminfo entries can cause problems..PPThe man pages for 4.3BSD and older versions of \fBtgetent()\fP instruct the user toallocate a 1024-byte buffer for the termcap entry.The entry gets null-terminated bythe termcap library, so that makes the maximum safe length for a termcap entry1k-1 (1023) bytes.Depending on what the application and the termcap librarybeing used does, and where in the termcap file the terminal type that \fBtgetent()\fPis searching for is, several bad things can happen..PPSome termcap libraries print a warning message or exit if they find anentry that's longer than 1023 bytes; others do not; others truncate theentries to 1023 bytes.Some application programs allocate more thanthe recommended 1K for the termcap entry; others do not..PPEach termcap entry has two important sizes associated with it: before"tc" expansion, and after "tc" expansion."tc" is the capability thattacks on another termcap entry to the end of the current one, to addon its capabilities.If a termcap entry does not use the "tc"capability, then of course the two lengths are the same..PPThe "before tc expansion" length is the most important one, because itaffects more than just users of that particular terminal.This is thelength of the entry as it exists in /etc/termcap, minus thebackslash-newline pairs, which \fBtgetent()\fP strips out while reading it.Some termcap libraries strip off the final newline, too (GNU termcap does not).Now suppose:.TP 5*a termcap entry before expansion is more than 1023 bytes long,.TP 5*and the application has only allocated a 1k buffer,.TP 5*and the termcap library (like the one in BSD/OS 1.1 and GNU) readsthe whole entry into the buffer, no matter what its length, to seeif it's the entry it wants,.TP 5*and \fBtgetent()\fP is searching for a terminal type that either is thelong entry, appears in the termcap file after the long entry, ordoes not appear in the file at all (so that \fBtgetent()\fP has to searchthe whole termcap file)..PPThen \fBtgetent()\fP will overwrite memory, perhaps its stack, and probably core dumpthe program.Programs like telnet are particularly vulnerable; modern telnetspass along values like the terminal type automatically.The results are almostas undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, thatprints warning messages when it reads an overly long termcap entry.If atermcap library truncates long entries, like OSF/1 3.0, it is immune to dyinghere but will return incorrect data for the terminal..PPThe "after tc expansion" length will have a similar effect to theabove, but only for people who actually set TERM to that terminaltype, since \fBtgetent()\fP only does "tc" expansion once it's found theterminal type it was looking for, not while searching..PPIn summary, a termcap entry that is longer than 1023 bytes can cause,on various combinations of termcap libraries and applications, a coredump, warnings, or incorrect operation.If it's too long even before"tc" expansion, it will have this effect even for users of some otherterminal types and users whose TERM variable does not have a termcapentry..PPWhen in -C (translate to termcap) mode, the \fBncurses\fR implementation of\fBtic\fR(1) issues warning messages when the pre-tc length of a termcaptranslation is too long.The -c (check) option also checks resolved (after tcexpansion) lengths..SS Binary CompatibilityIt is not wise to count on portability of binary terminfo entries betweencommercial UNIX versions.The problem is that there are at least two versionsof terminfo (under HP-UX and AIX) which diverged from System V terminfo afterSVr1, and have added extension capabilities to the string table that (in thebinary format) collide with System V and XSI Curses extensions..SH EXTENSIONSSome SVr4 \fBcurses\fR implementations, and all previous to SVr4, do notinterpret the %A and %O operators in parameter strings..PPSVr4/XPG4 do not specify whether \fBmsgr\fR licenses movement while inan alternate-character-set mode (such modes may, among other things, mapCR and NL to characters that do not trigger local motions).The \fBncurses\fR implementation ignores \fBmsgr\fR in \fBALTCHARSET\fRmode.This raises the possibility that an XPG4implementation making the opposite interpretation may need terminfoentries made for \fBncurses\fR to have \fBmsgr\fR turned off..PPThe \fBncurses\fR library handles insert-character and insert-character modesin a slightly non-standard way to get better update efficiency.Seethe \fBInsert/Delete Character\fR subsection above..PPThe parameter substitutions for \fBset_clock\fR and \fBdisplay_clock\fR arenot documented in SVr4 or the XSI Curses standard.They are deduced from thedocumentation for the AT&T 505 terminal..PPBe careful assigning the \fBkmous\fR capability.The \fBncurses\fR wants tointerpret it as \fBKEY_MOUSE\fR, for use by terminals and emulators like xtermthat can return mouse-tracking information in the keyboard-input stream..PPDifferent commercial ports of terminfo and curses support different subsets ofthe XSI Curses standard and (in some cases) different extension sets.Hereis a summary, accurate as of October 1995:.PP\fBSVR4, Solaris, ncurses\fR --These support all SVr4 capabilities..PP\fBSGI\fR --Supports the SVr4 set, adds one undocumented extended stringcapability (\fBset_pglen\fR)..PP\fBSVr1, Ultrix\fR --These support a restricted subset of terminfo capabilities.The booleansend with \fBxon_xoff\fR; the numerics with \fBwidth_status_line\fR; and thestrings with \fBprtr_non\fR..PP\fBHP/UX\fR --Supports the SVr1 subset, plus the SVr[234] numerics \fBnum_labels\fR,\fBlabel_height\fR, \fBlabel_width\fR, plus function keys 11 through 63, plus\fBplab_norm\fR, \fBlabel_on\fR, and \fBlabel_off\fR, plus some incompatibleextensions in the string table..PP\fBAIX\fR --Supports the SVr1 subset, plus function keys 11 through 63, plus a numberof incompatible string table extensions..PP\fBOSF\fR --Supports both the SVr4 set and the AIX extensions..SH FILES.TP 25\*d/?/*files containing terminal descriptions.SH SEE ALSO\fBtic\fR(1M),\fBinfocmp\fR(1M),\fBcurses\fR(3X),\fBprintf\fR(3S),\fBterm\fR(\*n)..SH AUTHORSZeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.Based on pcurses by Pavel Curtis..\"#.\"# The following sets edit modes for GNU EMACS.\"# Local Variables:.\"# mode:nroff.\"# fill-column:79.\"# End:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -