1
0
mirror of https://github.com/tmux/tmux.git synced 2025-04-01 21:41:44 +00:00

ECH needs to use background colour.

This commit is contained in:
Nicholas Marriott 2017-05-12 16:16:16 +01:00
parent 90f2a417af
commit 2bff5e7867
6 changed files with 12 additions and 6 deletions

View File

@ -1,5 +1,9 @@
CHANGES FROM 2.4 to 2.5 09 May 2017 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 * Fix send-keys and send-prefix in copy-mode (so C-b C-b works). GitHub issue
905. 905.

2
grid.c
View File

@ -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; gd->linedata[yy].cellsize = px;
continue; 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++) for (xx = px; xx < px + nx; xx++)
grid_clear_cell(gd, xx, yy, bg); grid_clear_cell(gd, xx, yy, bg);
} }

View File

@ -1308,7 +1308,8 @@ input_csi_dispatch(struct input_ctx *ictx)
} }
break; break;
case INPUT_CSI_ECH: 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; break;
case INPUT_CSI_DCH: case INPUT_CSI_DCH:
screen_write_deletecharacter(sctx, input_get(ictx, 0, 1, 1), screen_write_deletecharacter(sctx, input_get(ictx, 0, 1, 1),

View File

@ -608,7 +608,7 @@ screen_write_deletecharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg)
/* Clear nx characters. */ /* Clear nx characters. */
void 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 screen *s = ctx->s;
struct tty_ctx ttyctx; struct tty_ctx ttyctx;
@ -625,8 +625,9 @@ screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx)
return; return;
screen_write_initctx(ctx, &ttyctx); 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); screen_write_collect_flush(ctx, 0);
ttyctx.num = nx; ttyctx.num = nx;

2
tmux.h
View File

@ -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_alignmenttest(struct screen_write_ctx *);
void screen_write_insertcharacter(struct screen_write_ctx *, u_int, u_int); 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_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_insertline(struct screen_write_ctx *, u_int, u_int);
void screen_write_deleteline(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); void screen_write_clearline(struct screen_write_ctx *, u_int);

2
tty.c
View File

@ -961,7 +961,7 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
void void
tty_cmd_clearcharacter(struct tty *tty, const struct tty_ctx *ctx) 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); tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);