ANSI Attribute commands are used to control the presentation of the characters written to the terminal display. After a terminal reset all draw attributes are disabled and the font draw color and background color are set to the terminal reset values assigned in the terminal setup. Each attribute can be set/cleared using a single attribute parameter in the "Set Draw Attributes" escape control sequence. By passing multiple parameters a number of draw attributes may be changed at once. I have also include the character repeat command in this section as it does not fit into any other command group.
As an example the "invert" ANSI control sequence causes all subsequent characters to be displayed in reverse colors from normal. Character color and font set are also controlled by various attribute commands.
For more information about the general syntax of the PropTerm ANSI control sequences see the ANSI Protocol page
The symbol "CSI" will be used to indicate that either a seven bit or eight bit ANSI start sequence may be used.
The "n"symbol indicates a numeric parameter which is sent to the terminal as an ASCI decimal string.
Attribute Control Sequences
Repeat Last Character: CSI n b
The repeat last character command writes the last displayable character sent to the terminal "n" times. The repeated characters are written as though they where sent from the host. Thus word wrap, and draw attributes will be applied. The cursor will be moved to the next screen write position after each repeated character is written to the screen.
Set Draw Attributes: CSI n1;n2;n3.....;n12 m
The set draw attributes escape control sequence is use to set and clear character draw attributes. This command can take a number of parameters which set or clear specific character draw attributes. When this command is received by the terminal the draw attributes are processed in the order the command's parameters are received. If no parameters are supplied a single parameter of zero is assumed, this command clears all attributes.
The following table list the values required to change draw attributes. Any attribute proceeded by a "*" is a PropTerm only attribute.
Value | Attributes Effected |
0 | Clear all draw attributes. |
1 | Set font color to bright version of current font color. Set the dim attribute off. |
2 | Set font color to dim version of current font color. Set the bright attribute off. |
7 | Set invert on, font and background colors are reversed. |
10 | Use the current font's normal character set. This attribute value is used to disable the attribute 11 function that enables the alternate font glyphs for the current font. Selecting the normal font characters will have no effect on characters already present on the terminal display that where draw using the alternate font characters. |
11 | Use the current font's alternate character set. PropTerm supports a font set with 255 glyph patterns. Normally an ANSI terminal can only display characters in the range of 32...127, and 160..255 the remaining 64 character codes are reserved as control characters. When the alternate font is enable a value of 32 is subtracted from any displayable character value received from the host. This allows access to the font glyphs in positions 0..31, and 128..159 in the font table. Selecting the alternate font characters will have no effect on characters already present on the terminal display that where draw using the normal font characters. |
22 | Disable bright and dim attributes setting the font draw color to normal. |
27 | Disable invert draw attribute if it is enabled, setting font and background colors to normal. |
30 | Set the normal font color to Black. |
31 | Set the normal font color to Red. |
32 | Set the normal font color to Green. |
33 | Set the normal font color to Yellow. |
34 | Set the normal font color to Blue. |
35 | Set the normal font color to Magenta. |
36 | Set the normal font color to Cyan. |
37 | Set the normal font color to White. |
39 | Set the normal font color to the terminal reset font color. |
40 | Set the background color to Black. |
41 | Set the background color to Red. |
42 | Set the background color to Green. |
43 | Set the background color to Yellow. |
44 | Set the background color to Blue. |
45 | Set the background color to Magenta. |
46 | Set the background color to Cyan. |
47 | Set the background color to White. |
49 | Set the background color to the terminal reset font color. |
* 50 | Set the normal font color to Black. Set the dim attribute on. |
* 51 | Set the normal font color to Red. Set the dim attribute on. |
* 52 | Set the normal font color to Green. Set the dim attribute on. |
* 53 | Set the normal font color to Yellow. Set the dim attribute on. |
* 54 | Set the normal font color to Blue. Set the dim attribute on. |
* 55 | Set the normal font color to Magenta. Set the dim attribute on. |
* 56 | Set the normal font color to Cyan. Set the dim attribute on. |
* 57 | Set the normal font color to White. Set the dim attribute on. |
* 60 | Set the background color to Black. |
* 61 | Set the background color to dark Red, Maroon. |
* 62 | Set the background color to dark Green. |
* 63 | Set the background color to dark Yellow, Olive. |
* 64 | Set the background color to dark Blue, Navy. |
* 65 | Set the background color to dark Magenta, Purple. |
* 66 | Set the background color to dark Cyan, Teal. |
* 67 | Set the background color to dark White, Gray. |
* 129..191 | Set direct font color and disable dim/bright attributes. Direct colors are base on a six bit RGB. To create a direct font color the eight bit value in binary form is "10RRGGBB" MSb listed first. This allows the selection of any of the sixty-four possible colors as the current font color. When a direct color is applied as the font color the dim/bright attributes are disabled and should not be used until a normal font color is selected by codes 30..37 or 50..57. |
* 192..255 | Set font direct background color. Direct colors are base on a six bit RGB. To create a direct background color the eight bit value in binary form is "11RRGGBB" MSb listed first. This allows the selection of any of the sixty-four possible colors as the current background color. |