summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-09-03 08:48:57 +0000
committerNicholas Marriott <nicm@openbsd.org>2012-09-03 08:48:57 +0000
commit2e43372d0b2932f7abf5b16544faec3ecf214433 (patch)
tree935cbe37a1c8ec6e4e79b737b5941383c5d3a824 /client.c
parent473911fb731eb740d1c468350eda334638902d94 (diff)
If stdin in the client is enable immediately, tmux will eat anything
sent to stdin before it is needed, which can be inconvenient (eg pasting commands). Instead, start with stdin disabled and reuse MSG_STDIN from server->client to mean that stdin should be enabled. Based on a diff from Chris Johnsen.
Diffstat (limited to 'client.c')
-rw-r--r--client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/client.c b/client.c
index cb546c40..90993057 100644
--- a/client.c
+++ b/client.c
@@ -281,7 +281,6 @@ client_main(int argc, char **argv, int flags)
/* Set the event and dispatch. */
client_update_event();
- event_add (&client_stdin, NULL);
event_dispatch();
/* Print the exit message, if any, and exit. */
@@ -516,6 +515,12 @@ client_dispatch_wait(void *data)
event_del(&client_stdin);
client_attached = 1;
break;
+ case MSG_STDIN:
+ if (datalen != 0)
+ fatalx("bad MSG_STDIN size");
+
+ event_add(&client_stdin, NULL);
+ break;
case MSG_STDOUT:
if (datalen != sizeof stdoutdata)
fatalx("bad MSG_STDOUT");