summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2010-07-02 02:52:13 +0000
committerTiago Cunha <tcunha@gmx.com>2010-07-02 02:52:13 +0000
commite4573de97b40a7aaebcdcd2a4b699b5f995fe506 (patch)
tree1aea2b2ab724c59657ca3b87d5b47dfbc400dd3b /client.c
parent63e76b555d8f3d40f9905fb65a58f6e7509d399d (diff)
Sync OpenBSD patchset 731:
Send all three of stdin, stdout, stderr from the client to the server, so that commands can directly make use of them. This means that load-buffer and save-buffer can have "-" as the file to read from stdin or write to stdout. This is a protocol version bump so the tmux server will need to be restarted after upgrade (or an older client used).
Diffstat (limited to 'client.c')
-rw-r--r--client.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/client.c b/client.c
index 54932d43..335fdfab 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.94 2010-06-06 00:30:34 tcunha Exp $ */
+/* $Id: client.c,v 1.95 2010-07-02 02:52:13 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -100,8 +100,7 @@ server_started:
if (cmdflags & CMD_SENDENVIRON)
client_send_environ();
- if (isatty(STDIN_FILENO))
- client_send_identify(flags);
+ client_send_identify(flags);
return (&client_ibuf);
@@ -135,6 +134,14 @@ client_send_identify(int flags)
fatal("dup failed");
imsg_compose(&client_ibuf,
MSG_IDENTIFY, PROTOCOL_VERSION, -1, fd, &data, sizeof data);
+
+ if ((fd = dup(STDOUT_FILENO)) == -1)
+ fatal("dup failed");
+ imsg_compose(&client_ibuf, MSG_STDOUT, PROTOCOL_VERSION, -1, fd, NULL, 0);
+
+ if ((fd = dup(STDERR_FILENO)) == -1)
+ fatal("dup failed");
+ imsg_compose(&client_ibuf, MSG_STDERR, PROTOCOL_VERSION, -1, fd, NULL, 0);
}
void