diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2011-03-30 00:48:21 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2011-03-30 00:48:21 +0200 |
commit | a29a8a9243e01d3fca67c4b3eb3dfb3ecdeb71e7 (patch) | |
tree | 105a7a011a8e6074ac12c0db69b3b8c0f237f509 /play.py | |
parent | 812683927cb25cad1a0c4000a7be1f71bf5a35a6 (diff) | |
download | play-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.
Diffstat (limited to 'play.py')
-rwxr-xr-x | play.py | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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() |