diff options
author | 2017-05-12 23:06:43 +0000 | |
---|---|---|
committer | 2017-05-12 23:06:43 +0000 | |
commit | fc4035c1fa3beba3a97f1b755844601a6292527e (patch) | |
tree | 388e7819309552b8bfc5249885ced01649be03c5 | |
parent | IPsec packets were passed through ip_input() a second time after (diff) | |
download | wireguard-openbsd-fc4035c1fa3beba3a97f1b755844601a6292527e.tar.xz wireguard-openbsd-fc4035c1fa3beba3a97f1b755844601a6292527e.zip |
Can scroll away full lines to clear them too.
-rw-r--r-- | usr.bin/tmux/tty.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 619dcb6027d..a63cd7424ec 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.279 2017/05/12 14:13:54 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.280 2017/05/12 23:06:43 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -830,12 +830,25 @@ tty_clear_area(struct tty *tty, const struct window_pane *wp, u_int py, return; } + /* Full lines can be scrolled away to clear them. */ + if (px == 0 && + px + nx > tty->sx && + ny > 2 && + tty_term_has(tty->term, TTYC_CSR) && + tty_term_has(tty->term, TTYC_INDN)) { + tty_region(tty, py, py + ny - 1); + tty_margin_off(tty); + tty_putcode1(tty, TTYC_INDN, ny); + return; + } + /* * If margins are supported, can just scroll the area off to * clear it. */ if (nx > 2 && ny > 2 && + tty_term_has(tty->term, TTYC_CSR) && tty_use_margin(tty) && tty_term_has(tty->term, TTYC_INDN)) { tty_region(tty, py, py + ny - 1); |