Handle get_terminal_size() returning 0 (fixes #106)
This commit is contained in:
parent
b2fdc13feb
commit
fbd2ac2246
1 changed files with 4 additions and 1 deletions
|
@ -127,7 +127,10 @@ class Output(object):
|
||||||
if not self.is_tty:
|
if not self.is_tty:
|
||||||
return self.DEFAULT_WIDTH
|
return self.DEFAULT_WIDTH
|
||||||
try:
|
try:
|
||||||
return get_terminal_size().columns
|
w = get_terminal_size().columns
|
||||||
|
if w <= 0:
|
||||||
|
return self.DEFAULT_WIDTH
|
||||||
|
return w
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return self.DEFAULT_WIDTH
|
return self.DEFAULT_WIDTH
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue