summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2010-06-05 16:47:11 +0000
committernicm <nicm@openbsd.org>2010-06-05 16:47:11 +0000
commitb6912786a8430ea6ff4606e1506ac14d41ee1651 (patch)
tree6665861ed53965af7db513cc7f6d98bcc3f19803 /usr.bin/tmux/client.c
parentSupport the status_replace # replacement sequences in the pipe-pane (diff)
downloadwireguard-openbsd-b6912786a8430ea6ff4606e1506ac14d41ee1651.tar.xz
wireguard-openbsd-b6912786a8430ea6ff4606e1506ac14d41ee1651.zip
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 'usr.bin/tmux/client.c')
-rw-r--r--usr.bin/tmux/client.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c
index 8fd03ac6f49..66a85dcd8f8 100644
--- a/usr.bin/tmux/client.c
+++ b/usr.bin/tmux/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.40 2010/06/05 16:29:45 nicm Exp $ */
+/* $OpenBSD: client.c,v 1.41 2010/06/05 16:47:11 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -176,6 +176,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