GUACAMOLE-280: Add support for faint (low) intensity SGR.
This commit is contained in:
parent
6d2cfdabf8
commit
2146200dfd
@ -128,6 +128,13 @@ int __guac_terminal_set_colors(guac_terminal_display* display,
|
|||||||
display->glyph_foreground = *foreground;
|
display->glyph_foreground = *foreground;
|
||||||
display->glyph_background = *background;
|
display->glyph_background = *background;
|
||||||
|
|
||||||
|
/* Modify color if half-bright (low intensity) */
|
||||||
|
if (attributes->half_bright) {
|
||||||
|
display->glyph_foreground.red /= 2;
|
||||||
|
display->glyph_foreground.green /= 2;
|
||||||
|
display->glyph_foreground.blue /= 2;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -299,6 +299,7 @@ guac_terminal* guac_terminal_create(guac_client* client,
|
|||||||
.foreground = guac_terminal_palette[default_foreground],
|
.foreground = guac_terminal_palette[default_foreground],
|
||||||
.background = guac_terminal_palette[default_background],
|
.background = guac_terminal_palette[default_background],
|
||||||
.bold = false,
|
.bold = false,
|
||||||
|
.half_bright = false,
|
||||||
.reverse = false,
|
.reverse = false,
|
||||||
.underscore = false
|
.underscore = false
|
||||||
},
|
},
|
||||||
|
@ -46,6 +46,12 @@ typedef struct guac_terminal_attributes {
|
|||||||
*/
|
*/
|
||||||
bool bold;
|
bool bold;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the character should be rendered with half brightness (faint
|
||||||
|
* or low intensity).
|
||||||
|
*/
|
||||||
|
bool half_bright;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the character should be rendered with reversed colors
|
* Whether the character should be rendered with reversed colors
|
||||||
* (background becomes foreground and vice-versa).
|
* (background becomes foreground and vice-versa).
|
||||||
|
@ -897,6 +897,10 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) {
|
|||||||
else if (value == 1)
|
else if (value == 1)
|
||||||
term->current_attributes.bold = true;
|
term->current_attributes.bold = true;
|
||||||
|
|
||||||
|
/* Faint (low intensity) */
|
||||||
|
else if (value == 2)
|
||||||
|
term->current_attributes.half_bright = true;
|
||||||
|
|
||||||
/* Underscore on */
|
/* Underscore on */
|
||||||
else if (value == 4)
|
else if (value == 4)
|
||||||
term->current_attributes.underscore = true;
|
term->current_attributes.underscore = true;
|
||||||
@ -906,8 +910,10 @@ int guac_terminal_csi(guac_terminal* term, unsigned char c) {
|
|||||||
term->current_attributes.reverse = true;
|
term->current_attributes.reverse = true;
|
||||||
|
|
||||||
/* Normal intensity (not bold) */
|
/* Normal intensity (not bold) */
|
||||||
else if (value == 21 || value == 22)
|
else if (value == 21 || value == 22) {
|
||||||
term->current_attributes.bold = false;
|
term->current_attributes.bold = false;
|
||||||
|
term->current_attributes.half_bright = false;
|
||||||
|
}
|
||||||
|
|
||||||
/* Reset underscore */
|
/* Reset underscore */
|
||||||
else if (value == 24)
|
else if (value == 24)
|
||||||
|
Loading…
Reference in New Issue
Block a user