From: dok Date: Sat, 26 Jan 2019 14:49:15 +0000 (+0100) Subject: Use slow path if stdin is a tty X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=11a65377da8fc198d15cf041dbbbb9718e5798cd;p=dmenu.git Use slow path if stdin is a tty If stdin is a tty and dmenu is ran with the fast option then it's impossible to close stdin because the keyboard is already grabbed. --- diff --git a/dmenu.c b/dmenu.c index 5c835dd..6b8f51b 100644 --- a/dmenu.c +++ b/dmenu.c @@ -6,9 +6,7 @@ #include #include #include -#ifdef __OpenBSD__ #include -#endif #include #include @@ -754,7 +752,7 @@ main(int argc, char *argv[]) die("pledge"); #endif - if (fast) { + if (fast && !isatty(0)) { grabkeyboard(); readstdin(); } else {