From 3816f1fa43cbab05b292e062f0d35a121154e0cc Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Tue, 5 Nov 2019 20:24:08 +0100 Subject: [PATCH] src: Make sure clients connect from a TTY Fixes #3159 --- src/main.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cc b/src/main.cc index 5cc39286..1a9c38a4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1104,6 +1104,9 @@ int main(int argc, char* argv[]) for (auto name : files) new_files += format("edit '{}';", escape(real_path(name), "'", '\\')); + if (not isatty(1)) + throw startup_error("stdout is not a tty"); + return run_client(*server_session, {}, new_files + client_init, init_coord, ui_type, false); } else