summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server-fn.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-09-03 08:48:58 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-09-03 08:48:58 +0000
commit8541c9752590e9b6dba2f0258d47bfc964b121bb (patch)
tree9948dd80b7a192b38f846b0b5b7e6193bd293bad /usr.bin/tmux/server-fn.c
parent6e8857878433f6785419f808b8036f0b1941776a (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 'usr.bin/tmux/server-fn.c')
-rw-r--r--usr.bin/tmux/server-fn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c
index 6eba98075cc..67ebb9ae654 100644
--- a/usr.bin/tmux/server-fn.c
+++ b/usr.bin/tmux/server-fn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-fn.c,v 1.60 2012/07/10 11:53:01 nicm Exp $ */
+/* $OpenBSD: server-fn.c,v 1.61 2012/09/03 08:48:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -581,5 +581,8 @@ server_set_stdin_callback(struct client *c, void (*cb)(struct client *, int,
if (c->stdin_closed)
c->stdin_callback (c, 1, c->stdin_callback_data);
+
+ server_write_client(c, MSG_STDIN, NULL, 0);
+
return (0);
}