aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2017-05-12 23:06:43 +0000
committernicm <nicm>2017-05-12 23:06:43 +0000
commit0264ef094a79c828e72e03052b9969cd80b28d16 (patch)
tree2454c74bb012df9834fc31f4144713635c7fcde4 /tty.c
parentf688653710857e8e345f073bf530278f6072d34e (diff)
downloadrtmux-0264ef094a79c828e72e03052b9969cd80b28d16.tar.gz
rtmux-0264ef094a79c828e72e03052b9969cd80b28d16.tar.bz2
rtmux-0264ef094a79c828e72e03052b9969cd80b28d16.zip
Can scroll away full lines to clear them too.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tty.c b/tty.c
index 58a4028c..a03e9a0d 100644
--- a/tty.c
+++ b/tty.c
@@ -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);