mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Open controlling terminal only as stdin
This commit is contained in:
parent
0db988b9b2
commit
f1dbb9622d
|
@ -8226,8 +8226,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* We return to tty */
|
/* We return to tty */
|
||||||
if (!isatty(STDOUT_FILENO)) {
|
if (!isatty(STDOUT_FILENO)) {
|
||||||
fd = open(ctermid(NULL), O_RDWR, 0400);
|
fd = open(ctermid(NULL), O_RDONLY, 0400);
|
||||||
dup2(fd, STDOUT_FILENO);
|
|
||||||
dup2(fd, STDIN_FILENO);
|
dup2(fd, STDIN_FILENO);
|
||||||
close(fd);
|
close(fd);
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in a new issue