=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.394 retrieving revision 1.395 diff -u -r1.394 -r1.395 --- src/usr.bin/tmux/tty.c 2021/08/05 09:43:51 1.394 +++ src/usr.bin/tmux/tty.c 2021/08/06 03:13:05 1.395 @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.394 2021/08/05 09:43:51 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.395 2021/08/06 03:13:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1349,7 +1349,7 @@ struct grid_line *gl; struct client *c = tty->client; u_int i, j, ux, sx, width; - int flags, cleared = 0, wrapped = 0; + int flags, cleared = 0, wrapped = 0, hidden; char buf[512]; size_t len; u_int cellsize; @@ -1449,17 +1449,24 @@ screen_select_cell(s, &last, gcp); else memcpy(&last, gcp, sizeof last); - if (!tty_check_overlay(tty, atx + ux, aty)) { - if (~gcp->flags & GRID_FLAG_PADDING) - ux += gcp->data.width; - } else if (ux + gcp->data.width > nx) { - tty_attributes(tty, &last, defaults, palette); - tty_cursor(tty, atx + ux, aty); - for (j = 0; j < gcp->data.width; j++) { - if (ux + j > nx) - break; - tty_putc(tty, ' '); - ux++; + + hidden = 0; + for (j = 0; j < gcp->data.width; j++) { + if (!tty_check_overlay(tty, atx + ux + j, aty)) { + hidden = 1; + break; + } + } + if (hidden || ux + gcp->data.width > nx) { + if (~gcp->flags & GRID_FLAG_PADDING) { + tty_attributes(tty, &last, defaults, palette); + tty_cursor(tty, atx + ux, aty); + for (j = 0; j < gcp->data.width; j++) { + if (ux + j > nx) + break; + tty_putc(tty, ' '); + ux++; + } } } else if (gcp->attr & GRID_ATTR_CHARSET) { tty_attributes(tty, &last, defaults, palette);