From: Arun Prakash Jana Date: Sat, 24 Jul 2021 16:51:21 +0000 (+0530) Subject: Open controlling terminal only as stdin X-Git-Tag: v4.3~75 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f1dbb9622d7f4f3b18fcb61654fb6843e2f66b7b;p=nnn.git Open controlling terminal only as stdin --- diff --git a/src/nnn.c b/src/nnn.c index e409d708..cae77ef8 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -8226,8 +8226,7 @@ int main(int argc, char *argv[]) /* We return to tty */ if (!isatty(STDOUT_FILENO)) { - fd = open(ctermid(NULL), O_RDWR, 0400); - dup2(fd, STDOUT_FILENO); + fd = open(ctermid(NULL), O_RDONLY, 0400); dup2(fd, STDIN_FILENO); close(fd); } else