check also if stdin is a tty to enable the pager
This commit is contained in:
parent
01acc2c7d4
commit
6b25131bf5
1 changed files with 2 additions and 1 deletions
|
|
@ -53,7 +53,8 @@ class IFormatter(object):
|
|||
self.interactive = False
|
||||
self.print_lines = 0
|
||||
self.termrows = 0
|
||||
if os.isatty(sys.stdout.fileno()):
|
||||
# XXX if stdin is not a tty, it seems that the command fails.
|
||||
if os.isatty(sys.stdout.fileno()) and os.isatty(sys.stdin.fileno()):
|
||||
self.termrows = int(os.popen('stty size', 'r').read().split()[0])
|
||||
|
||||
def after_format(self, formatted):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue