wind: Make sure stdin is always a TTY

This commit is contained in:
apio 2023-08-31 14:55:40 +02:00
parent fb40f5c9b2
commit 4a85f03d02
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -74,6 +74,12 @@ Result<int> 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();