summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2011-03-29 22:48:21 (GMT)
committerAdrian C. (anrxc) <anrxc@sysphere.org>2011-03-29 22:48:21 (GMT)
commita29a8a9243e01d3fca67c4b3eb3dfb3ecdeb71e7 (patch)
tree105a7a011a8e6074ac12c0db69b3b8c0f237f509
parent812683927cb25cad1a0c4000a7be1f71bf5a35a6 (diff)
downloadplay-a29a8a9243e01d3fca67c4b3eb3dfb3ecdeb71e7.tar.xz
play: determine term size with curses not stty
Though very portable, stty was not optimal, ie. very fast terminal resize could break it.
-rwxr-xr-xplay.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/play.py b/play.py
index aa8e044..107c525 100755
--- a/play.py
+++ b/play.py
@@ -145,9 +145,7 @@ class Window:
except AttributeError: self.w.attr_off(attr)
def newwin(self):
- # http://mail.python.org/pipermail/python-list/2000-May/033180.html
- self.prc = os.popen('%s size' % which('stty'), 'r').read().split()
- return curses.newwin(int(self.prc[0]), int(self.prc[1]), 0, 0)
+ return curses.newwin(curses.tigetnum('lines'), curses.tigetnum('cols'), 0, 0)
def resize(self):
self.w = self.newwin()