diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-06-28 22:10:42 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-06-28 22:10:42 +0000 |
commit | 76bbdeb586ad93cfb16bd12db865b4c672a9168e (patch) | |
tree | 52ecf7ef2f819396844962ffaf1edbcb4e3bf6b1 /client.c | |
parent | 07a71fd432df5873515da82d2d620ec0d986b558 (diff) | |
download | rtmux-76bbdeb586ad93cfb16bd12db865b4c672a9168e.tar.gz rtmux-76bbdeb586ad93cfb16bd12db865b4c672a9168e.tar.bz2 rtmux-76bbdeb586ad93cfb16bd12db865b4c672a9168e.zip |
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.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -96,8 +96,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); @@ -131,6 +130,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 |