summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2010-06-06 00:30:34 +0000
committerTiago Cunha <tcunha@gmx.com>2010-06-06 00:30:34 +0000
commit650320718508881ab2f518ae289e1dfd8fcc0c8b (patch)
treed806554a296e7eff113968f86206abd35f83bf9b /client.c
parent3bba40160931bdad2ad8cd5168a42239477cbe99 (diff)
Sync OpenBSD patchset 716:
Fix problems with window sizing seen by Raghavendra D Prabhu when starting tmux from .xinitrc. One of the very few things the server relies on the client for now is to pass through a message on SIGWINCH, but there is a condition where potentially a SIGWINCH may be lost during the transition from unattached (main.c) to attached (client.c). So trigger a size change immediately after the client installs its SIGWINCH handler. Also, when the terminal is resized, reset the scroll region and cursor position. Previously, we were clearing our saved idea of these, but in fact some terminals do not reset them on resize, so this caused problems during redraw. While here make a resize to the same size not cause a redraw and rename the tmux.out output log file to include the tmux PID.
Diffstat (limited to 'client.c')
-rw-r--r--client.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/client.c b/client.c
index a51b200c..54932d43 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.93 2010-06-06 00:25:47 tcunha Exp $ */
+/* $Id: client.c,v 1.94 2010-06-06 00:30:34 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -180,6 +180,13 @@ client_main(void)
set_signals(client_signal);
/*
+ * Send a resize message immediately in case the terminal size has
+ * changed between the identify message to the server and the MSG_READY
+ * telling us to move into the client code.
+ */
+ client_write_server(MSG_RESIZE, NULL, 0);
+
+ /*
* imsg_read in the first client poll loop (before the terminal has
* been initialised) may have read messages into the buffer after the
* MSG_READY switched to here. Process anything outstanding now to