From e5d85c6c3c7f81ad9744b7306fd0cb1f7d12ebad Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 16 Apr 2014 08:02:31 +0000 Subject: [PATCH] Because we pass the file descriptor from client to server, tmux can't usefully work if stdin is /dev/tty. Complain about it more clearly. --- server-client.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server-client.c b/server-client.c index 35df7531..0f4d39d6 100644 --- a/server-client.c +++ b/server-client.c @@ -119,6 +119,11 @@ server_client_open(struct client *c, char **cause) if (c->flags & CLIENT_CONTROL) return (0); + if (strcmp(c->ttyname, "/dev/tty") == 0) { + *cause = xstrdup("can't use /dev/tty"); + return (-1); + } + if (!(c->flags & CLIENT_TERMINAL)) { *cause = xstrdup("not a terminal"); return (-1);