From: Dan McGregor Date: Fri, 26 Jun 2015 16:14:45 +0000 (-0600) Subject: terminal.py: fix tmux 1.8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7db4215f7241f3970177f9afcdaff91a1c2e91ef;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git terminal.py: fix tmux 1.8 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 --- diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 52a891388af..9ca94f4fe24 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py @@ -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\d+) 1.*',r'\g', out, flags = re.DOTALL)) except OSError as exc: import errno if exc.errno == errno.ENOENT: