diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-05-12 11:19:25 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-05-12 11:19:25 +0000 |
commit | 88ccc62520203af46adcd9fb14d3093ce7db163f (patch) | |
tree | 55eb9d9b43be8d6498c59b50e3cbec32cbc8315a /usr.bin/tmux | |
parent | da93356f9c70182b960fe88f3e82f4491a0d6a41 (diff) |
Regions can't be smaller than 2 so don't try to clear them by scrolling if so.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/tty.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index b417ad06059..d2a79d7be07 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.276 2017/05/12 11:13:43 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.277 2017/05/12 11:19:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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); |