aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2017-05-12 11:19:24 +0000
committernicm <nicm>2017-05-12 11:19:24 +0000
commit60f7b05c0c9fbee371dac86229d888aed7b0e7f6 (patch)
tree3e21d86c65c77fb688103a6a13ba194917924987 /tty.c
parent7f626c89595abd5dae6716d6b6e21ea96e22a856 (diff)
downloadrtmux-60f7b05c0c9fbee371dac86229d888aed7b0e7f6.tar.gz
rtmux-60f7b05c0c9fbee371dac86229d888aed7b0e7f6.tar.bz2
rtmux-60f7b05c0c9fbee371dac86229d888aed7b0e7f6.zip
Regions can't be smaller than 2 so don't try to clear them by scrolling if so.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tty.c b/tty.c
index 720eb417..00460574 100644
--- a/tty.c
+++ b/tty.c
@@ -834,7 +834,10 @@ tty_clear_area(struct tty *tty, const struct window_pane *wp, u_int py,
* If margins are supported, can just scroll the area off to
* clear it.
*/
- if (tty_use_margin(tty) && tty_term_has(tty->term, TTYC_INDN)) {
+ if (nx > 2 &&
+ ny > 2 &&
+ tty_use_margin(tty) &&
+ tty_term_has(tty->term, TTYC_INDN)) {
tty_region(tty, py, py + ny - 1);
tty_margin(tty, px, px + nx - 1);
tty_putcode1(tty, TTYC_INDN, ny);