aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2017-05-31 10:29:15 +0000
committernicm <nicm>2017-05-31 10:29:15 +0000
commitea6428a5d2c3c753c3123b3ecace7357e97eae50 (patch)
treef0c99d2984c95ee5198b0f2a4b4c2d75dd645eb1 /tty.c
parent80c6b487dc05662efd675695b7db93563e582f7c (diff)
downloadrtmux-ea6428a5d2c3c753c3123b3ecace7357e97eae50.tar.gz
rtmux-ea6428a5d2c3c753c3123b3ecace7357e97eae50.tar.bz2
rtmux-ea6428a5d2c3c753c3123b3ecace7357e97eae50.zip
It is not OK to ignore SIGWINCH if SIOCGWINSZ reports the size has
unchanged, because it may have changed and changed back in the time between us getting the signal and calling ioctl(). Always redraw when we see SIGWINCH.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/tty.c b/tty.c
index 9de1f50a..72453821 100644
--- a/tty.c
+++ b/tty.c
@@ -120,7 +120,7 @@ tty_init(struct tty *tty, struct client *c, int fd, char *term)
return (0);
}
-int
+void
tty_resize(struct tty *tty)
{
struct client *c = tty->client;
@@ -139,21 +139,15 @@ tty_resize(struct tty *tty)
sy = 24;
}
log_debug("%s: %s now %ux%u", __func__, c->name, sx, sy);
-
- if (!tty_set_size(tty, sx, sy))
- return (0);
+ tty_set_size(tty, sx, sy);
tty_invalidate(tty);
- return (1);
}
-int
+void
tty_set_size(struct tty *tty, u_int sx, u_int sy)
{
- if (sx == tty->sx && sy == tty->sy)
- return (0);
tty->sx = sx;
tty->sy = sy;
- return (1);
}
static void