Keep stdin (file descriptor 0) open in the pager's child process.
authorW. Trevor King <wking@drexel.edu>
Sat, 25 Feb 2012 20:05:04 +0000 (15:05 -0500)
committerW. Trevor King <wking@drexel.edu>
Sat, 25 Feb 2012 20:05:08 +0000 (15:05 -0500)
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.

libbe/ui/util/pager.py

index 08b10249567389edf26a6ec04d2ba820f5f7204e..e6e6d1bd8fb4f54d5f5a102f6d5d2a5916b71b32 100644 (file)
@@ -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: