src: Make sure clients connect from a TTY

Fixes #3159
This commit is contained in:
Frank LENORMAND 2019-11-05 20:24:08 +01:00
parent 294a5b72e6
commit 3816f1fa43

View File

@ -1104,6 +1104,9 @@ int main(int argc, char* argv[])
for (auto name : files) for (auto name : files)
new_files += format("edit '{}';", escape(real_path(name), "'", '\\')); 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); return run_client(*server_session, {}, new_files + client_init, init_coord, ui_type, false);
} }
else else