summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-04-16 20:32:15 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-04-16 20:32:15 +0000
commitda2b8188a582c4e463e639ddf254cd219b543092 (patch)
tree4578543b6f777e396b806f06267dfdb567760a88
parent6c8adb003df963d4f897c5a0133966146c3cd2d4 (diff)
Use EL1 to clear lines when redrawing the leftmost pane, rather than
spaces.
-rw-r--r--usr.bin/tmux/tty.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index dc50a8cb901..20fe7645cbd 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.258 2017/04/05 10:49:46 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.259 2017/04/16 20:32:14 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -693,10 +693,11 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
{
struct grid_cell gc, last;
u_int i, j, sx, width;
- int flags = (tty->flags & TTY_NOCURSOR);
+ int flags, cleared = 0;
char buf[512];
size_t len;
+ flags = (tty->flags & TTY_NOCURSOR);
tty->flags |= TTY_NOCURSOR;
tty_update_mode(tty, tty->mode, s);
@@ -709,6 +710,16 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
if (sx > tty->sx)
sx = tty->sx;
+ if (screen_size_x(s) < tty->sx &&
+ ox == 0 &&
+ sx != screen_size_x(s) &&
+ tty_term_has(tty->term, TTYC_EL1) &&
+ !tty_fake_bce(tty, wp, 8)) {
+ tty_default_attributes(tty, wp, 8);
+ tty_cursor(tty, screen_size_x(s) - 1, oy + py);
+ tty_putcode(tty, TTYC_EL1);
+ cleared = 1;
+ }
tty_cursor(tty, ox, oy + py);
memcpy(&last, &grid_default_cell, sizeof last);
@@ -763,7 +774,7 @@ tty_draw_line(struct tty *tty, const struct window_pane *wp,
tty_putn(tty, buf, len, width);
}
- if (sx < tty->sx) {
+ if (!cleared && sx < tty->sx) {
tty_default_attributes(tty, wp, 8);
tty_cursor(tty, ox + sx, oy + py);