summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvery Pennarun <apenwarr@gmail.com>2011-01-22 16:42:32 -0800
committerAvery Pennarun <apenwarr@gmail.com>2011-01-22 16:42:32 -0800
commit415be935d4e2ba5cfbcf245a3e5d6ffcaeddbfd6 (patch)
treeac81e5ad18764d5b6990668bcfcb7356f1589c68
parentd4c9d3106841f01b5c16915bf44075b0ee6ee7ab (diff)
options.py: don't die if tty width is set to 0.
This sometimes happens if weird people, such as myself, open a pty without setting the width field correctly.
-rw-r--r--options.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/options.py b/options.py
index 5ff2a85..25322fb 100644
--- a/options.py
+++ b/options.py
@@ -60,7 +60,7 @@ def _tty_width():
except (IOError, ImportError):
return _atoi(os.environ.get('WIDTH')) or 70
(ysize,xsize,ypix,xpix) = struct.unpack('HHHH', s)
- return xsize
+ return xsize or 70
class Options: