Ignore error output of `stty size` when stdin is not a terminal.

Fixes #1876

Signed-off-by: Mihai Ciumeica <cmihai@email.com>
This commit is contained in:
Mihai 2016-05-05 13:39:12 +03:00
parent 67dc90ec0e
commit 790280ba72
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ from compose.cli import colors
def get_tty_width():
tty_size = os.popen('stty size', 'r').read().split()
tty_size = os.popen('stty size 2> /dev/null', 'r').read().split()
if len(tty_size) != 2:
return 0
_, width = tty_size