From 2bff5e7867b4849019df04d77ecade300c6e3dce Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 12 May 2017 16:16:16 +0100 Subject: ECH needs to use background colour. --- CHANGES | 4 ++++ grid.c | 2 +- input.c | 3 ++- screen-write.c | 5 +++-- tmux.h | 2 +- tty.c | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 6c42184a..a3cf960a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ CHANGES FROM 2.4 to 2.5 09 May 2017 +* Fix ECH with a background colour. + +* Do not rely on the terminal not moving the cursor after DL or EL. + * Fix send-keys and send-prefix in copy-mode (so C-b C-b works). GitHub issue 905. diff --git a/grid.c b/grid.c index 25b0d016..3fa96d42 100644 --- a/grid.c +++ b/grid.c @@ -472,7 +472,7 @@ grid_clear(struct grid *gd, u_int px, u_int py, u_int nx, u_int ny, u_int bg) gd->linedata[yy].cellsize = px; continue; } - grid_expand_line(gd, yy, px + nx, bg); + grid_expand_line(gd, yy, px + nx, 8); /* default bg first */ for (xx = px; xx < px + nx; xx++) grid_clear_cell(gd, xx, yy, bg); } diff --git a/input.c b/input.c index 34fa7a9c..22dd1ee2 100644 --- a/input.c +++ b/input.c @@ -1308,7 +1308,8 @@ input_csi_dispatch(struct input_ctx *ictx) } break; case INPUT_CSI_ECH: - screen_write_clearcharacter(sctx, input_get(ictx, 0, 1, 1)); + screen_write_clearcharacter(sctx, input_get(ictx, 0, 1, 1), + ictx->cell.cell.bg); break; case INPUT_CSI_DCH: screen_write_deletecharacter(sctx, input_get(ictx, 0, 1, 1), diff --git a/screen-write.c b/screen-write.c index ab0d1341..0a63e1b6 100644 --- a/screen-write.c +++ b/screen-write.c @@ -608,7 +608,7 @@ screen_write_deletecharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg) /* Clear nx characters. */ void -screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx) +screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg) { struct screen *s = ctx->s; struct tty_ctx ttyctx; @@ -625,8 +625,9 @@ screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx) return; screen_write_initctx(ctx, &ttyctx); + ttyctx.bg = bg; - grid_view_clear(s->grid, s->cx, s->cy, nx, 1, 8); + grid_view_clear(s->grid, s->cx, s->cy, nx, 1, bg); screen_write_collect_flush(ctx, 0); ttyctx.num = nx; diff --git a/tmux.h b/tmux.h index e8ad55ff..40bc99fd 100644 --- a/tmux.h +++ b/tmux.h @@ -1999,7 +1999,7 @@ void screen_write_cursorleft(struct screen_write_ctx *, u_int); void screen_write_alignmenttest(struct screen_write_ctx *); void screen_write_insertcharacter(struct screen_write_ctx *, u_int, u_int); void screen_write_deletecharacter(struct screen_write_ctx *, u_int, u_int); -void screen_write_clearcharacter(struct screen_write_ctx *, u_int); +void screen_write_clearcharacter(struct screen_write_ctx *, u_int, u_int); void screen_write_insertline(struct screen_write_ctx *, u_int, u_int); void screen_write_deleteline(struct screen_write_ctx *, u_int, u_int); void screen_write_clearline(struct screen_write_ctx *, u_int); diff --git a/tty.c b/tty.c index 7998e26e..1c39fce4 100644 --- a/tty.c +++ b/tty.c @@ -961,7 +961,7 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx) void tty_cmd_clearcharacter(struct tty *tty, const struct tty_ctx *ctx) { - tty_attributes(tty, &grid_default_cell, ctx->wp); + tty_default_attributes(tty, ctx->wp, ctx->bg); tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); -- cgit