From 8bdd4b2e2aa4e5170fd4f0c61ca7c91900f1469f Mon Sep 17 00:00:00 2001
From: KlzXS <klzx+github@klzx.cf>
Date: Wed, 17 Feb 2021 09:01:26 +0000
Subject: [PATCH] Use the fix you just implemented

---
 src/nnn.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c
index 4e5685c7..3f352697 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -215,7 +215,7 @@
 #define F_NORMAL  0x08  /* spawn child process in non-curses regular CLI mode */
 #define F_CONFIRM 0x10  /* run command - show results before exit (must have F_NORMAL) */
 #define F_CHKRTN  0x20  /* wait for user prompt if cmd returns failure status */
-#define F_ALLNULL 0x44  /* stdin, stdout and stderr mapped to /dev/null */
+#define F_NOSTDIN 0x40  /* suppress stdin */
 #define F_CLI     (F_NORMAL | F_MULTI)
 #define F_SILENT  (F_CLI | F_NOTRACE)
 
@@ -1911,7 +1911,7 @@ static int spawn(char *file, char *arg1, char *arg2, uchar_t flag)
 		if (flag & F_NOTRACE) {
 			int fd = open("/dev/null", O_WRONLY, 0200);
 
-			if (flag & F_ALLNULL)
+			if (flag & F_NOSTDIN)
 				dup2(fd, 0);
 			dup2(fd, 1);
 			dup2(fd, 2);
@@ -5870,7 +5870,7 @@ static bool browse(char *ipath, const char *session, int pkey)
 	enum action sel;
 	struct stat sb;
 	int r = -1, presel, selstartid = 0, selendid = 0;
-	const uchar_t opener_flags = (cfg.cliopener ? F_CLI : (F_NOTRACE | F_NOWAIT));
+	const uchar_t opener_flags = (cfg.cliopener ? F_CLI : (F_NOTRACE | F_NOSTDIN | F_NOWAIT));
 	bool watch = FALSE;
 
 #ifndef NOMOUSE
-- 
2.51.0