Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranishmangal2002 <anishmangal2002@gmail.com>2010-05-20 16:26:10 (GMT)
committer anishmangal2002 <anishmangal2002@gmail.com>2010-05-20 16:26:10 (GMT)
commit63fb95d74e7c5da39f46b764f6404d518786798b (patch)
tree0aa5ec5d182304308aff66f9a8d199399a14c574
parentc0e1917cf0d4900abd5013a385d6af6f05895e07 (diff)
Revert "Parse additional output for xterm size reporting (#843)"
This reverts commit ca98a02d4858114ac55ba841784e9ce3bc75fe9d.
-rw-r--r--library/pippy/console.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/library/pippy/console.py b/library/pippy/console.py
index c185ce9..29ef2d5 100644
--- a/library/pippy/console.py
+++ b/library/pippy/console.py
@@ -26,16 +26,8 @@ def size():
os.write(fd, '\x1B[18t') # write the 'query screen size' command
read_to_delimit('\x1b') # parse response.
read_to_delimit('[')
- size = read_to_delimit('t')
- # Output can be '8;rows;cols' or 'rows;cols' depending on vte version.
- # (SL #843)
- values = size.split(';')
- if len(values) == 3:
- rows = int(values[1])
- cols = int(values[2])
- else:
- rows = int(values[0])
- cols = int(values[1])
+ rows = int(read_to_delimit(';'))
+ cols = int(read_to_delimit('t'))
termios.tcsetattr(fd, termios.TCSANOW, oldattr) # reset tty
return cols, rows