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.
This commit is contained in:
Nicholas Marriott
2009-08-11 21:28:11 +00:00
parent 4ec8ade11c
commit 4310282a4c
5 changed files with 31 additions and 15 deletions

View File

@ -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);