termpty: correctly handle DECFRA wrt SGR 0

This commit is contained in:
Boris Faure 2017-06-26 23:36:23 +02:00
parent 7ac685b68c
commit b0226726f8
3 changed files with 28 additions and 1 deletions

View File

@ -1597,6 +1597,31 @@ termpty_cells_set_content(Termpty *ty, Termcell *cells,
}
}
void
termpty_cells_att_fill_preserve_colors(Termpty *ty, Termcell *cells,
Eina_Unicode codepoint, int count)
{
int i;
Termcell local = { .codepoint = codepoint, .att = ty->termstate.att};
for (i = 0; i < count; i++)
{
Termatt att = cells[i].att;
_handle_block_codepoint_overwrite(ty, cells[i].codepoint, codepoint);
cells[i] = local;
if (ty->termstate.att.fg == 0 && ty->termstate.att.bg == 0)
{
cells[i].att.fg = att.fg;
cells[i].att.fg256 = att.fg256;
cells[i].att.fgintense = att.fgintense;
cells[i].att.bg = att.bg;
cells[i].att.bg256 = att.bg256;
cells[i].att.bgintense = att.bgintense;
}
}
}
void
termpty_cell_codepoint_att_fill(Termpty *ty, Eina_Unicode codepoint,

View File

@ -907,7 +907,7 @@ _handle_esc_csi_decfra(Termpty *ty, Eina_Unicode **b)
for (; top <= bottom; top++)
{
Termcell *cells = &(TERMPTY_SCREEN(ty, left, top));
termpty_cells_fill(ty, c, cells, len);
termpty_cells_att_fill_preserve_colors(ty, cells, c, len);
}
}

View File

@ -12,6 +12,8 @@ void termpty_text_save_top(Termpty *ty, Termcell *cells, ssize_t w_max);
void termpty_cells_copy(Termpty *ty, Termcell *cells, Termcell *dest, int count);
void termpty_cells_fill(Termpty *ty, Eina_Unicode codepoint, Termcell *cells, int count);
void termpty_cells_clear(Termpty *ty, Termcell *cells, int count);
void termpty_cells_att_fill_preserve_colors(Termpty *ty, Termcell *cells,
Eina_Unicode codepoint, int count);
void termpty_text_scroll(Termpty *ty, Eina_Bool clear);
void termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear);
void termpty_text_scroll_test(Termpty *ty, Eina_Bool clear);