From: W. Trevor King Date: Sat, 25 Feb 2012 20:05:04 +0000 (-0500) Subject: Keep stdin (file descriptor 0) open in the pager's child process. X-Git-Tag: 1.1.0~158 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1ccb0019b16b064dfde1e320b7921c82e8409f5b;p=be.git Keep stdin (file descriptor 0) open in the pager's child process. This fixes the underlying problem that we worked around in commit 2c9ae15f53aef57d28091b237c193c653c6e80dd. Now even $ echo 'some bug | be --paginate new - will work instead of raising IOError: [Errno 9] Bad file descriptor. --- diff --git a/libbe/ui/util/pager.py b/libbe/ui/util/pager.py index 08b1024..e6e6d1b 100644 --- a/libbe/ui/util/pager.py +++ b/libbe/ui/util/pager.py @@ -50,7 +50,6 @@ def run_pager(paginate='auto'): if os.fork() == 0: # child process os.close(read_fd) - os.close(0) os.dup2(write_fd, 1) os.close(write_fd) if hasattr(sys.stderr, 'isatty') and sys.stderr.isatty() == True: