From 5e30b818258271882158cf69da6f3efe9379a720 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 11 May 2017 11:38:49 +0000 Subject: [PATCH 1/2] Need to redraw out to cellsize (total cells used in a line) rather than cellused (only non-space cells) because there may be cells with a nondefault background. --- tty.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tty.c b/tty.c index ba7a5158..6dd6b490 100644 --- a/tty.c +++ b/tty.c @@ -778,9 +778,13 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp, tty_region_off(tty); tty_margin_off(tty); + /* + * Clamp the width to cellsize - note this is not cellused, because + * there may be empty background cells after it (from BCE). + */ sx = screen_size_x(s); - if (sx > s->grid->linedata[s->grid->hsize + py].cellused) - sx = s->grid->linedata[s->grid->hsize + py].cellused; + if (sx > s->grid->linedata[s->grid->hsize + py].cellsize) + sx = s->grid->linedata[s->grid->hsize + py].cellsize; if (sx > tty->sx) sx = tty->sx; From 69df38f8d8dee6363a173c0afd9dd5013c2a5ab9 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 11 May 2017 11:39:30 +0000 Subject: [PATCH 2/2] Clear to start of screen needs to use background colour. --- screen-write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screen-write.c b/screen-write.c index 14cbd4d5..6631ab56 100644 --- a/screen-write.c +++ b/screen-write.c @@ -943,9 +943,9 @@ screen_write_clearstartofscreen(struct screen_write_ctx *ctx, u_int bg) if (s->cy > 0) grid_view_clear(s->grid, 0, 0, sx, s->cy, bg); if (s->cx > sx - 1) - grid_view_clear(s->grid, 0, s->cy, sx, 1, 8); + grid_view_clear(s->grid, 0, s->cy, sx, 1, bg); else - grid_view_clear(s->grid, 0, s->cy, s->cx + 1, 1, 8); + grid_view_clear(s->grid, 0, s->cy, s->cx + 1, 1, bg); screen_write_collect_clear(ctx, 0, s->cy); screen_write_collect_flush(ctx, 0);