Terminfo source files




















Media copy strings which control an auxiliary printer connected to the terminal can be given as mc0 : print the contents of the screen, mc4 : turn off the printer, and mc5 : turn on the printer. When the printer is on, all text sent to the terminal will be sent to the printer.

A variation, mc5p , takes one parameter, and leaves the printer on for as many characters as the value of the parameter, then turns the printer off. The parameter should not exceed If the text is not displayed on the terminal screen when the printer is on, specify mc5i silent printer.

All text, including mc4 , is transparently passed to the printer while an mc5p is in effect. The working model used by terminfo fits most terminals reasonably well. However, some terminals do not completely match that model, requiring special support by terminfo. These are not meant to be construed as deficiencies in the terminals; they are just differences between the working model and the actual hardware.

They may be unusual devices or, for some reason, do not have all the features of the terminfo model implemented. Terminals that ignore a linefeed immediately after an am wrap, such as the Concept , should indicate xenl. Those terminals whose cursor remains on the right-most column until another character has been received, rather than wrapping immediately upon receiving the right-most character, such as the VT, should also indicate xenl.

If el is required to get rid of standout instead of writing normal text on top of it , xhp should be given. Those Teleray terminals whose tabs turn all characters moved over to blanks, should indicate xt destructive tabs. If there are two very similar terminals, one can be defined as being just like the other with certain exceptions. The string capability use can be given with the name of the similar terminal. The capabilities given before use override those in the terminal type invoked by use.

A capability can be canceled by placing xx to the left of the capability definition, where xx is the capability. For example, the entry. This is useful for different modes for a terminal, or for different user preferences. More than one use capability may be given. The terminfo database allows you to define capabilities of printers as well as terminals. Because parameterized string capabilities work only with integer values, we recommend that terminfo designers create strings that expect numeric values that have been rounded.

Application designers should note this and should always round values to the nearest integer before using them with a parameterized string capability. A printer's resolution is defined to be the smallest spacing of characters it can achieve. In general printers have independent resolution horizontally and vertically. Thus the vertical resolution of a printer can be determined by measuring the smallest achievable distance between consecutive printing baselines, while the horizontal resolution can be determined by measuring the smallest achievable distance between the left-most edges of consecutive printed, identical, characters.

All printers are assumed to be capable of printing with a uniform horizontal and vertical resolution. The cell size can be changed as will be seen later.

Thus printed characters can be spaced apart a distance that is an integral multiple of the smallest distance, up to the length or width of a single page. Thus the old lines capability would give the length of a page in lines, and the cols capability would give the width of a page in columns. With some printers the micro mode may be concomitant with normal mode, so that all the capabilities work at the same time. The printing resolution of a printer is given in several ways. Each specifies the resolution as the number of smallest steps per distance:.

When printing in normal mode, each character printed causes movement to the next column, except in special cases described later; the distance moved is the same as the per-column resolution. Some printers cause an automatic movement to the next line when a character is printed in the rightmost position; the distance moved vertically is the same as the per-line resolution. When printing in micro mode, these distances can be different, and may be zero for some printers. Some printers are capable of printing wide characters.

The distance moved when a wide character is printed in normal mode may be different from when a regular width character is printed. This doesn't mean the normal character distance is necessarily the same as the wide character distance, just that the distances don't change with a change in normal to micro mode. There may be control sequences to change the number of columns per inch the character pitch and to change the number of lines per inch the line pitch.

If these are used, the resolution of the printer changes, but the type of change depends on the printer:. The cpi and lpi string capabilities are each used with a single argument, the pitch in columns or characters and lines per inch, respectively. The chr and cvr string capabilities are each used with a single argument, the number of steps per column and line, respectively. Using any of the control sequences in these strings will imply a change in some of the values of orc , orhi , orl , and orvi.

Also, the distance moved when a wide character is printed, widcs , changes in relation to orc. Other printers have different equivalents. In general, the current position is where a character would be displayed if printed.

It also has equivalent string capabilities for control sequences that cause movement a number of smallest steps. Sometimes the motion is limited to less than the width or length of a page. Also, some printers don't accept absolute motion to the left of the current position. A boolean is available for those printers where using a carriage return causes an automatic return to normal mode.

The movement made when a character is printed in the rightmost position varies among printers. Some make no movement, some move to the beginning of the next line, others move to the beginning of the same line.

Some printers can be put in a mode where the normal direction of motion is reversed. This mode can be especially useful when there are no capabilities for leftward or upward motion, because those capabilities can be built from the motion reversal capability and the rightward or downward motion capabilities. It is best to leave it up to an application to build the leftward or upward capabilities, though, and not enter them in the terminfo database.

This allows several reverse motions to be strung together without intervening wasted steps that leave and reenter reverse mode. The reverse motion modes should not affect the mvpa and mhpa absolute motion capabilities. Thus printers that have the standard terminfo capability am defined should experience motion to the beginning of the previous line when a character is printed in the right-most position under reverse vertical motion mode.

The action when any other motion capabilities are used in reverse motion modes is not defined; thus, programs must exit reverse motion modes before using other motion capabilities. Two miscellaneous capabilities complete the list of new motion capabilities.

The other is used for the capability of suspending the motion that normally occurs after printing a character. Printers, however, have two additional margins, for the top and bottom margins of each page. Furthermore, some printers require not using motion strings to move the current position to a margin and then fixing the margin there, but require the specification of where a margin should be regardless of the current position.

Therefore terminfo offers six additional strings for defining margins with printers. The last four strings are used with one or more arguments that give the position of the margin or margins to set. If both of smglp and smgrp are set, each is used with a single argument, N, that gives the column number of the left and right margin, respectively.

If both of smgtp and smgbp are set, each is used to set the top and bottom margin, respectively: smgtp is used with a single argument, N, the line number of the top margin; however, smgbp is used with two arguments, N and M, that give the line number of the bottom margin, the first counting from the top of the page and the second counting from the bottom.

This accommodates the two styles of specifying the bottom margin in different manufacturers' printers. When coding a terminfo entry for a printer that has a settable bottom margin, only the first or second parameter should be used, depending on the printer.

When writing an application that uses smgbp to set the bottom margin, both arguments must be given. If only one of smglp and smgrp is set, then it is used with two arguments, the column number of the left and right margins, in that order. Likewise, if only one of smgtp and smgbp is set, then it is used with two arguments that give the top and bottom margins, in that order, counting from the top of the page.

Thus when coding a terminfo entry for a printer that requires setting both left and right or top and bottom margins simultaneously, only one of smglp and smgrp or smgtp and smgbp should be defined; the other should be left blank.

When writing an application that uses these string capabilities, the pairs should be first checked to see if each in the pair is set or only one is set, and should then be used accordingly. In counting lines or columns, line zero is the top line and column zero is the left-most column.

A zero value for the second argument with smgbp means the bottom line of the page. If a printer requires the sshm control sequence before every character to be shadow-printed, the rshm string is left blank. Thus programs that find a control sequence in sshm but none in rshm should use the sshm control sequence before every character to be shadow-printed; otherwise, the sshm control sequence should be used once before the set of characters to be shadow-printed, followed by rshm.

Note that terminfo also has a capability for printing emboldened text bold. Generally, emboldened printing is done by overstriking the same character one or more times. It is assumed that enhanced printing modes are independent modes, so that it would be possible, for instance, to shadow print italicized subscripts. As mentioned earlier, the amount of motion automatically made after printing a wide character should be given in widcs.

If only a subset of the printable ASCII characters can be printed as superscripts or subscripts, they should be listed in supcs or subcs strings, respectively. If the ssupm or ssubm strings contain control sequences, but the corresponding supcs or subcs strings are empty, it is assumed that all printable ASCII characters are available as superscripts or subscripts. Automatic motion made after printing a superscript or subscript is assumed to be the same as for regular characters.

Thus, for example, printing any of the following three examples will result in equivalent motion:. Conversely, if msgr is not set, a program should end these modes before attempting any motion. In addition to allowing you to define line graphics described in Section , terminfo lets you define alternate character sets. The following capabilities cover printers and terminals with multiple selectable or definable character sets.

The scs , rcsd , and csnm strings are used with a single argument, N , a number from 0 to 63 that identifies the character set. The scsd string is also used with the argument N and another, M , that gives the number of characters in the set.

Character set 0 is the default character set present after the printer has been initialized. Not every printer has 64 character sets, of course; using scs with an argument that doesn't select an available character set should cause a null result from tparm. If a character set has to be defined before it can be used, the scsd control sequence is to be used before defining the character set, and the rcsd is to be used after. They should also cause a null result from tparm when used with an argument N that doesn't apply.

If a character set still has to be selected after being defined, the scs control sequence should follow the rcsd control sequence. By examining the results of using each of the scs , scsd , and rcsd strings with a character set number in a call to tparm , a program can determine which of the three are needed.

Between use of the scsd and rcsd strings, the defc string should be used to define each character. The width of the character in dots also indicates the number of image-data bytes that will follow the defc string. It's easiest for the creator of terminfo entries to refer to each character set by number; however, these numbers will be meaningless to the application developer. The csnm string alleviates this problem by providing names for each number. When used with a character set number in a call to tparm , the csnm string will produce the equivalent name.

These names should be used as a reference only. No naming convention is implied, although anyone who creates a terminfo entry for a printer should use names consistent with the names found in user documents for the printer. Application developers should allow a user to specify a character set by number leaving it up to the user to examine the csnm string to determine the correct number , or by name, where the application examines the csnm string to determine the corresponding character set number.

These capabilities are likely to be used only with dot-matrix printers. If they are not available, the strings should not be defined. For printers that have manually changed print-wheels or font cartridges, the boolean daisy is set. Star 4. Library for parsing standard and extended terminfo files MIT License. Branches Tags. Could not load branches.

Could not load tags. Latest commit. Git stats 79 commits. Thus if such feature were not in the termcap or terminfo file, no one complained. Also, writing termcaps was often done by volunteers who were in short supply. Today, programs such as vim use "context highlighting" and minicom uses the terminal's graphics character set.

These often need more definitions to be added to the old termcap. This may or may not have already been done. Most terminals had hardware bugs in their firmware and sometimes these were "fixed" by modifying the termcap. Then the manufacturer might send out replacement chips which would fix the bug. Not all owners would bother to get the replacement chips. Thus there may be 2 or more terminfos for your terminal, depending on what firmware chips it has in it.

This situation was often not noted in the termcap and only one of these termcaps may be supplied with Linux.

Some hardware bugs which existed for features that were almost never used in the past likely never did get fixed. Also, some reported hardware bugs may never have been fixed since they were not of much significance at the time or because the terminal manufacturing company went out of business, etc.

To do this you need a manual for your terminal showing what escape sequences it uses. Newer manuals from the 's often don't show this. You also need a terminfo manual the man page "terminfo" is one. After you edit the terminfo source file you compile it using "tic". If you would like to find a better terminfo entry for a certain terminal than the one supplied, you might try searching the Internet but what you find could be worse.

If your new terminfo entry is better than the old one and it seems stable you've used it for a while with no problems then you should send a copy to the maintainer of terminfo as noted at the start of the source file for terminfo or termcap. Included in the terminfo are often a couple of initialization strings which may be sent to the terminal to initialize it. No initialization string is automatically sent to the terminal to initialize it. One might expect that the getty program should do this.

Could not load tags. This branch is up to date with master. This branch is not ahead of the upstream master. Open pull request. Latest commit. Git stats commits. Failed to load latest commit information. View code.

About terminfo Installing Using. About terminfo Package terminfo provides a pure-Go implementation of reading information from the terminfo database.

LoadFromEnv if err!



0コメント

  • 1000 / 1000