summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2014-04-16 08:02:31 +0000
committernicm <nicm>2014-04-16 08:02:31 +0000
commite5d85c6c3c7f81ad9744b7306fd0cb1f7d12ebad (patch)
treea42cfa71f57ca2cb52184b204e985d7b1b8d4b79
parenta47d2397dfccfdebc26cfaca924cca8cff904235 (diff)
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.
-rw-r--r--server-client.c5
1 files changed, 5 insertions, 0 deletions
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);