From a29a8a9243e01d3fca67c4b3eb3dfb3ecdeb71e7 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Wed, 30 Mar 2011 00:48:21 +0200 Subject: play: determine term size with curses not stty Though very portable, stty was not optimal, ie. very fast terminal resize could break it. --- play.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'play.py') 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() -- cgit v1.2.3