I have a working @ATTRTOVT (comments welcomed). It uses "extended" sequences (available in up-to-date CONHOSTs) ...
30-37 dark foreground colors
90-97 bright foreground colors
40-47 dark background
100-107 bright background
2/24 underscore on/off
7/27 reversed on/off
As far as I know those are the only things you can get from console attributes. For now, I don't put the escape character in the sequence so I can actually see the result. But putting the escape character in the sequence does work.
One small pain in the ### was that attributes use 1, 2, 4 for blue, green, red while VT sequences use 1, 2, 4 (plus 30, 40, 90, 100) for red, green, blue.
It'll take decimal numbers also.
Here are a few examples.
These are also among the attributes but I don't think they translate into VT sequences.
#define COMMON_LVB_LEADING_BYTE 0x0100 // Leading Byte of DBCS
#define COMMON_LVB_TRAILING_BYTE 0x0200 // Trailing Byte of DBCS
#define COMMON_LVB_GRID_HORIZONTAL 0x0400 // DBCS: Grid attribute: top horizontal.
#define COMMON_LVB_GRID_LVERTICAL 0x0800 // DBCS: Grid attribute: left vertical.
#define COMMON_LVB_GRID_RVERTICAL 0x1000 // DBCS: Grid attribute: right vertical.
30-37 dark foreground colors
90-97 bright foreground colors
40-47 dark background
100-107 bright background
2/24 underscore on/off
7/27 reversed on/off
As far as I know those are the only things you can get from console attributes. For now, I don't put the escape character in the sequence so I can actually see the result. But putting the escape character in the sequence does work.
One small pain in the ### was that attributes use 1, 2, 4 for blue, green, red while VT sequences use 1, 2, 4 (plus 30, 40, 90, 100) for red, green, blue.
It'll take decimal numbers also.
Here are a few examples.
These are also among the attributes but I don't think they translate into VT sequences.
#define COMMON_LVB_LEADING_BYTE 0x0100 // Leading Byte of DBCS
#define COMMON_LVB_TRAILING_BYTE 0x0200 // Trailing Byte of DBCS
#define COMMON_LVB_GRID_HORIZONTAL 0x0400 // DBCS: Grid attribute: top horizontal.
#define COMMON_LVB_GRID_LVERTICAL 0x0800 // DBCS: Grid attribute: left vertical.
#define COMMON_LVB_GRID_RVERTICAL 0x1000 // DBCS: Grid attribute: right vertical.