summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-08-13 12:15:46 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-08-13 12:15:46 +0000
commit278e136b0571eef6b9c083ed9840da4a76b01f2e (patch)
tree791c779bbda37ad23e54a8a607db810f03f88b05 /usr.bin
parent16ec2d3df07e1722f916875d00971cd025e9e7aa (diff)
If the client passes zero for the window size in the identify message (which it
can, for example on serial terminals), reset it to 80x25, same as for resize messages. Problem reported by kettenis@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/server-msg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tmux/server-msg.c b/usr.bin/tmux/server-msg.c
index 23e51c8bebb..a317971b287 100644
--- a/usr.bin/tmux/server-msg.c
+++ b/usr.bin/tmux/server-msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-msg.c,v 1.13 2009/08/11 21:28:11 nicm Exp $ */
+/* $OpenBSD: server-msg.c,v 1.14 2009/08/13 12:15:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -238,7 +238,11 @@ void
server_msg_identify(struct client *c, struct msg_identify_data *data, int fd)
{
c->tty.sx = data->sx;
+ if (c->tty.sx == 0)
+ c->tty.sx = 80;
c->tty.sy = data->sy;
+ if (c->tty.sy == 0)
+ c->tty.sy = 25;
c->cwd = NULL;
data->cwd[(sizeof data->cwd) - 1] = '\0';