diff options
Diffstat (limited to 'csi.c')
| -rw-r--r-- | csi.c | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -126,7 +126,7 @@ csi_sgr(struct terminal *term) case 35: case 36: case 37: - term->vt.attrs.foreground = 1 << 31 | term->colors.regular[param - 30]; + term->vt.attrs.foreground = 1 << 30 | term->colors.regular[param - 30]; break; case 38: { @@ -141,7 +141,7 @@ csi_sgr(struct terminal *term) color = term->colors.bright[idx - 8]; else color = colors256[idx]; - term->vt.attrs.foreground = 1 << 31 | color; + term->vt.attrs.foreground = 1 << 30 | color; i += 2; } @@ -152,7 +152,7 @@ csi_sgr(struct terminal *term) uint8_t r = term->vt.params.v[i + 2].value; uint8_t g = term->vt.params.v[i + 3].value; uint8_t b = term->vt.params.v[i + 4].value; - term->vt.attrs.foreground = 1 << 31 | r << 16 | g << 8 | b; + term->vt.attrs.foreground = 1 << 30 | r << 16 | g << 8 | b; i += 4; } @@ -168,7 +168,7 @@ csi_sgr(struct terminal *term) /* 6 - CS tolerance */ /* 7 - color space associated with tolerance */ - term->vt.attrs.foreground = 1 << 31 | r << 16 | g << 8 | b; + term->vt.attrs.foreground = 1 << 30 | r << 16 | g << 8 | b; } else { LOG_ERR("invalid CSI SGR sequence"); abort(); @@ -195,7 +195,7 @@ csi_sgr(struct terminal *term) case 45: case 46: case 47: - term->vt.attrs.background = 1 << 31 | term->colors.regular[param - 40]; + term->vt.attrs.background = 1 << 30 | term->colors.regular[param - 40]; break; case 48: { @@ -211,7 +211,7 @@ csi_sgr(struct terminal *term) color = term->colors.bright[idx - 8]; else color = colors256[idx]; - term->vt.attrs.background = 1 << 31 | color; + term->vt.attrs.background = 1 << 30 | color; i += 2; } @@ -221,7 +221,7 @@ csi_sgr(struct terminal *term) uint8_t r = term->vt.params.v[i + 2].value; uint8_t g = term->vt.params.v[i + 3].value; uint8_t b = term->vt.params.v[i + 4].value; - term->vt.attrs.background = 1 << 31 | r << 16 | g << 8 | b; + term->vt.attrs.background = 1 << 30 | r << 16 | g << 8 | b; i += 4; } @@ -238,7 +238,7 @@ csi_sgr(struct terminal *term) /* 6 - CS tolerance */ /* 7 - color space associated with tolerance */ - term->vt.attrs.background = 1 << 31 | r << 16 | g << 8 | b; + term->vt.attrs.background = 1 << 30 | r << 16 | g << 8 | b; } else { LOG_ERR("invalid CSI SGR sequence"); abort(); @@ -265,7 +265,7 @@ csi_sgr(struct terminal *term) case 95: case 96: case 97: - term->vt.attrs.foreground = 1 << 31 | term->colors.bright[param - 90]; + term->vt.attrs.foreground = 1 << 30 | term->colors.bright[param - 90]; break; /* Regular background colors */ @@ -277,7 +277,7 @@ csi_sgr(struct terminal *term) case 105: case 106: case 107: - term->vt.attrs.background = 1 << 31 | term->colors.bright[param - 100]; + term->vt.attrs.background = 1 << 30 | term->colors.bright[param - 100]; break; default: @@ -487,6 +487,9 @@ csi_dispatch(struct terminal *term, uint8_t final) memmove(&term->grid->cur_row->cells[term->cursor.col], &term->grid->cur_row->cells[term->cursor.col + count], remaining * sizeof(term->grid->cur_row->cells[0])); + + for (size_t c = 0; c < remaining; c++) + term->grid->cur_row->cells[term->cursor.col + c].attrs.clean = 0; term->grid->cur_row->dirty = true; /* Erase the remainder of the line */ @@ -511,6 +514,8 @@ csi_dispatch(struct terminal *term, uint8_t final) memmove(&term->grid->cur_row->cells[term->cursor.col + count], &term->grid->cur_row->cells[term->cursor.col], remaining * sizeof(term->grid->cur_row->cells[0])); + for (size_t c = 0; c < remaining; c++) + term->grid->cur_row->cells[term->cursor.col + count + c].attrs.clean = 0; term->grid->cur_row->dirty = true; /* Erase (insert space characters) */ |
