summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 11:37:00 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 11:37:00 +0000
commit6cf2159771745114c9d534583802c52eedfb0a76 (patch)
tree492322d6c3e3b6af3492be68fd12785f0b5acd84 /usr.bin/tmux
parenta4893e0d7360cf5584bb9247dfdb52b9ab8b6cbe (diff)
Use single stdout and stderr for control clients.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/server-client.c7
-rw-r--r--usr.bin/tmux/server-fn.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index a38d98c5d3e..0048cbdcb2c 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.96 2013/03/25 10:03:24 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.97 2013/03/25 11:36:59 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -154,7 +154,8 @@ server_client_lost(struct client *c)
evbuffer_free (c->stdin_data);
evbuffer_free (c->stdout_data);
- evbuffer_free (c->stderr_data);
+ if (c->stderr_data != c->stdout_data)
+ evbuffer_free (c->stderr_data);
status_free_jobs(&c->status_new);
status_free_jobs(&c->status_old);
@@ -956,6 +957,8 @@ server_client_msg_identify(
if (data->flags & IDENTIFY_CONTROL) {
c->stdin_callback = control_callback;
+ evbuffer_free(c->stderr_data);
+ c->stderr_data = c->stdout_data;
c->flags |= CLIENT_CONTROL;
if (data->flags & IDENTIFY_TERMIOS)
evbuffer_add_printf(c->stdout_data, "\033P1000p");
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c
index 1a6901541c7..c7d3951b9a0 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.67 2013/03/25 10:11:45 nicm Exp $ */
+/* $OpenBSD: server-fn.c,v 1.68 2013/03/25 11:36:59 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -546,6 +546,10 @@ server_push_stderr(struct client *c)
struct msg_stderr_data data;
size_t size;
+ if (c->stderr_data == c->stdout_data) {
+ server_push_stdout(c);
+ return;
+ }
size = EVBUFFER_LENGTH(c->stderr_data);
if (size == 0)
return;