summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pager.c b/pager.c
index 6b5c9e44b4..0b7e55f476 100644
--- a/pager.c
+++ b/pager.c
@@ -102,7 +102,8 @@ void setup_pager(void)
/* original process continues, but writes to the pipe */
dup2(pager_process.in, 1);
- dup2(pager_process.in, 2);
+ if (isatty(2))
+ dup2(pager_process.in, 2);
close(pager_process.in);
/* this makes sure that the parent terminates after the pager */