From a2b6149f50d38ef20128014e59486a2bd8e7293b Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 31 Aug 2023 14:55:40 +0200 Subject: [PATCH] wind: Make sure stdin is always a TTY --- wind/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wind/main.cpp b/wind/main.cpp index 1ec70451..3986a90e 100644 --- a/wind/main.cpp +++ b/wind/main.cpp @@ -74,6 +74,12 @@ Result luna_main(int argc, char** argv) return 1; } + if (!isatty(STDIN_FILENO)) + { + os::eprintln("error: wind must be run from a TTY!"); + return 1; + } + auto mouse = TRY(os::File::open("/dev/mouse", os::File::ReadOnly)); mouse->set_buffer(os::File::NotBuffered); mouse->set_close_on_exec();