summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-08-11 21:28:12 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-08-11 21:28:12 +0000
commite997d8c0270e98dc081ec35fd3b27a142181bb35 (patch)
tree5f051609240ad5d1e07addc2b7448b7a6cc95d49 /usr.bin/tmux/client.c
parent23dbb4e2c8eb65db51f5c4d1a8030edf6c5f52c1 (diff)
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 'usr.bin/tmux/client.c')
-rw-r--r--usr.bin/tmux/client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c
index e2606684090..669783624c5 100644
--- a/usr.bin/tmux/client.c
+++ b/usr.bin/tmux/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.12 2009/08/11 17:18:35 nicm Exp $ */
+/* $OpenBSD: client.c,v 1.13 2009/08/11 21:28:11 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -119,7 +119,8 @@ server_started:
if (strlcpy(data.tty, name, sizeof data.tty) >= sizeof data.tty)
fatalx("ttyname failed");
- client_write_server(cctx, MSG_IDENTIFY, &data, sizeof data);
+ imsg_compose(&cctx->ibuf, MSG_IDENTIFY,
+ PROTOCOL_VERSION, -1, STDIN_FILENO, &data, sizeof data);
}
return (0);