all repos — dmenu @ 11a65377da8fc198d15cf041dbbbb9718e5798cd

my build of dmenu

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.
dok dok@grehack.fr
Sat, 26 Jan 2019 15:49:15 +0100
commit

11a65377da8fc198d15cf041dbbbb9718e5798cd

parent

bbc464dc80225b8cf9390f14fac6c682f63940d2

1 files changed, 1 insertions(+), 3 deletions(-)

jump to
M dmenu.cdmenu.c

@@ -6,9 +6,7 @@ #include <stdlib.h>

#include <string.h> #include <strings.h> #include <time.h> -#ifdef __OpenBSD__ #include <unistd.h> -#endif #include <X11/Xlib.h> #include <X11/Xatom.h>

@@ -754,7 +752,7 @@ if (pledge("stdio rpath", NULL) == -1)

die("pledge"); #endif - if (fast) { + if (fast && !isatty(0)) { grabkeyboard(); readstdin(); } else {