aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2017-05-12 16:16:16 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2017-05-12 16:16:16 +0100
commit2bff5e7867b4849019df04d77ecade300c6e3dce (patch)
treee1f2724b716ff060ba7782cb763aaf056ec9bbd3
parent90f2a417af1d6a15435571e6512d75b7ab373c58 (diff)
downloadrtmux-2bff5e7867b4849019df04d77ecade300c6e3dce.tar.gz
rtmux-2bff5e7867b4849019df04d77ecade300c6e3dce.tar.bz2
rtmux-2bff5e7867b4849019df04d77ecade300c6e3dce.zip
ECH needs to use background colour.
-rw-r--r--CHANGES4
-rw-r--r--grid.c2
-rw-r--r--input.c3
-rw-r--r--screen-write.c5
-rw-r--r--tmux.h2
-rw-r--r--tty.c2
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);