]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
terminal.py: fix tmux 1.8
authorDan McGregor <dan.mcgregor@usask.ca>
Fri, 26 Jun 2015 16:14:45 +0000 (10:14 -0600)
committerDan McGregor <dan.mcgregor@usask.ca>
Mon, 16 Nov 2015 16:53:15 +0000 (10:53 -0600)
The list-panes command previously in use only worked for tmux 1.9
and later. Since tmux 1.8 is what's included in Ubuntu 14.04 and
CentOS 7, add support for it.

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
meta/lib/oe/terminal.py

index 52a891388af61f7375667ec23565cc57cd66b6f6..9ca94f4fe24a1993993fcb408ad6b14ee461d48e 100644 (file)
@@ -218,11 +218,12 @@ def spawn(name, sh_cmd, title=None, env=None, d=None):
 
 def check_tmux_pane_size(tmux):
     import subprocess as sub
+    import re
     try:
-        p = sub.Popen('%s list-panes -F "#{?pane_active,#{pane_height},}"' % tmux,
+        p = sub.Popen('%s list-panes -F "#{pane_height} #{pane_active}"' % tmux,
                 shell=True,stdout=sub.PIPE,stderr=sub.PIPE)
         out, err = p.communicate()
-        size = int(out.strip())
+        size = int(re.sub(r'.*?(?P<height>\d+) 1.*',r'\g<height>', out, flags = re.DOTALL))
     except OSError as exc:
         import errno
         if exc.errno == errno.ENOENT: