Merge bd63531d3f0079788b368ed29a5435b25eb99c0a into a4ed3959d8adece59c31e08fd75758cb4cd4d987

This commit is contained in:
Marcin Kulik 2013-09-05 13:18:12 -07:00
commit 669e6654bc
2 changed files with 12 additions and 0 deletions

View File

@ -90,6 +90,7 @@ struct tsm_screen_attr {
unsigned int underline : 1; /* underlined character */
unsigned int inverse : 1; /* inverse colors */
unsigned int protect : 1; /* cannot be erased */
unsigned int blink : 1; /* blinking character */
};
typedef int (*tsm_screen_prepare_cb) (struct tsm_screen *con,

View File

@ -335,6 +335,9 @@ static void to_rgb(struct tsm_vte *vte, struct tsm_screen_attr *attr)
code = attr->bccode;
if (code >= 0) {
/* blink causes light colors */
if (attr->blink && code < 8)
code += 8;
if (code >= COLOR_NUM)
code = COLOR_BACKGROUND;
@ -550,6 +553,7 @@ static void reset_state(struct tsm_vte *vte)
vte->saved_state.cattr.underline = 0;
vte->saved_state.cattr.inverse = 0;
vte->saved_state.cattr.protect = 0;
vte->saved_state.cattr.blink = 0;
}
static void save_state(struct tsm_vte *vte)
@ -1039,6 +1043,7 @@ static void csi_attribute(struct tsm_vte *vte)
vte->cattr.bold = 0;
vte->cattr.underline = 0;
vte->cattr.inverse = 0;
vte->cattr.blink = 0;
break;
case 1:
vte->cattr.bold = 1;
@ -1046,6 +1051,9 @@ static void csi_attribute(struct tsm_vte *vte)
case 4:
vte->cattr.underline = 1;
break;
case 5:
vte->cattr.blink = 1;
break;
case 7:
vte->cattr.inverse = 1;
break;
@ -1055,6 +1063,9 @@ static void csi_attribute(struct tsm_vte *vte)
case 24:
vte->cattr.underline = 0;
break;
case 25:
vte->cattr.blink = 0;
break;
case 27:
vte->cattr.inverse = 0;
break;