From f1dbb9622d7f4f3b18fcb61654fb6843e2f66b7b Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 24 Jul 2021 22:21:21 +0530 Subject: [PATCH] Open controlling terminal only as stdin --- src/nnn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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