diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-08-14 21:23:20 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-08-14 21:23:20 +0000 |
commit | e2a18894b34e3651feecba1dd43c4f05c9566509 (patch) | |
tree | a15c5d4ff41e637982452222ede90d433dbc10a6 /server-msg.c | |
parent | 0714e411488e01273729bc0801e197a8f64d5540 (diff) | |
download | rtmux-e2a18894b34e3651feecba1dd43c4f05c9566509.tar.gz rtmux-e2a18894b34e3651feecba1dd43c4f05c9566509.tar.bz2 rtmux-e2a18894b34e3651feecba1dd43c4f05c9566509.zip |
Sync OpenBSD patchset 246:
Have the client pass its stdin fd to the server when identifying itself and
have the server use that rather than reopening the tty. If the fd isn't given,
use the old behaviour (so no need for a version change).
This allows tmux to be used as the shell, so also change so that when working
out the command to execute if default-command is empty (the default), tmux will
try not execute itself.
Diffstat (limited to 'server-msg.c')
-rw-r--r-- | server-msg.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server-msg.c b/server-msg.c index a2b144c5..2499140b 100644 --- a/server-msg.c +++ b/server-msg.c @@ -1,4 +1,4 @@ -/* $Id: server-msg.c,v 1.79 2009-08-14 21:17:54 tcunha Exp $ */ +/* $Id: server-msg.c,v 1.80 2009-08-14 21:23:20 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -27,7 +27,7 @@ #include "tmux.h" void server_msg_command(struct client *, struct msg_command_data *); -void server_msg_identify(struct client *, struct msg_identify_data *); +void server_msg_identify(struct client *, struct msg_identify_data *, int); void server_msg_resize(struct client *, struct msg_resize_data *); void printflike2 server_msg_command_error(struct cmd_ctx *, const char *, ...); @@ -76,7 +76,7 @@ server_msg_dispatch(struct client *c) fatalx("bad MSG_IDENTIFY size"); memcpy(&identifydata, imsg.data, sizeof identifydata); - server_msg_identify(c, &identifydata); + server_msg_identify(c, &identifydata, imsg.fd); break; case MSG_RESIZE: if (datalen != sizeof resizedata) @@ -235,7 +235,7 @@ error: } void -server_msg_identify(struct client *c, struct msg_identify_data *data) +server_msg_identify(struct client *c, struct msg_identify_data *data, int fd) { c->tty.sx = data->sx; c->tty.sy = data->sy; @@ -247,7 +247,7 @@ server_msg_identify(struct client *c, struct msg_identify_data *data) data->tty[(sizeof data->tty) - 1] = '\0'; data->term[(sizeof data->term) - 1] = '\0'; - tty_init(&c->tty, data->tty, data->term); + tty_init(&c->tty, fd, data->tty, data->term); if (data->flags & IDENTIFY_UTF8) c->tty.flags |= TTY_UTF8; if (data->flags & IDENTIFY_256COLOURS) |