=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty.c,v retrieving revision 1.315 retrieving revision 1.316 diff -c -r1.315 -r1.316 *** src/usr.bin/tmux/tty.c 2019/03/12 23:21:45 1.315 --- src/usr.bin/tmux/tty.c 2019/03/13 22:01:22 1.316 *************** *** 1,4 **** ! /* $OpenBSD: tty.c,v 1.315 2019/03/12 23:21:45 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty.c,v 1.316 2019/03/13 22:01:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1281,1292 **** gcp->bg != last.bg || ux + width + gcp->data.width > nx || (sizeof buf) - len < gcp->data.size)) { if (last.flags & GRID_FLAG_CLEARED) { log_debug("%s: %zu cleared", __func__, len); tty_clear_line(tty, wp, aty, atx + ux, width, last.bg); } else { - tty_attributes(tty, &last, wp); tty_cursor(tty, atx + ux, aty); tty_putn(tty, buf, len, width); } --- 1281,1292 ---- gcp->bg != last.bg || ux + width + gcp->data.width > nx || (sizeof buf) - len < gcp->data.size)) { + tty_attributes(tty, &last, wp); if (last.flags & GRID_FLAG_CLEARED) { log_debug("%s: %zu cleared", __func__, len); tty_clear_line(tty, wp, aty, atx + ux, width, last.bg); } else { tty_cursor(tty, atx + ux, aty); tty_putn(tty, buf, len, width); } *************** *** 1322,1332 **** } } if (len != 0 && ((~last.flags & GRID_FLAG_CLEARED) || last.bg != 8)) { if (last.flags & GRID_FLAG_CLEARED) { log_debug("%s: %zu cleared (end)", __func__, len); tty_clear_line(tty, wp, aty, atx + ux, width, last.bg); } else { - tty_attributes(tty, &last, wp); tty_cursor(tty, atx + ux, aty); tty_putn(tty, buf, len, width); } --- 1322,1332 ---- } } if (len != 0 && ((~last.flags & GRID_FLAG_CLEARED) || last.bg != 8)) { + tty_attributes(tty, &last, wp); if (last.flags & GRID_FLAG_CLEARED) { log_debug("%s: %zu cleared (end)", __func__, len); tty_clear_line(tty, wp, aty, atx + ux, width, last.bg); } else { tty_cursor(tty, atx + ux, aty); tty_putn(tty, buf, len, width); }