diff options
author | Dan McGregor <dan.mcgregor@usask.ca> | 2015-06-26 10:14:45 -0600 |
---|---|---|
committer | Dan McGregor <dan.mcgregor@usask.ca> | 2015-11-16 10:53:15 -0600 |
commit | 7db4215f7241f3970177f9afcdaff91a1c2e91ef (patch) | |
tree | 3d0082926112cf049d6d4fc82a42b29bf62ab3e2 | |
parent | 6f98c39418c60b7c0b25b30983d2e5257158a6a4 (diff) | |
download | openembedded-core-contrib-7db4215f7241f3970177f9afcdaff91a1c2e91ef.tar.gz |
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 <dan.mcgregor@usask.ca>
-rw-r--r-- | meta/lib/oe/terminal.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 52a891388a..9ca94f4fe2 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<height>\d+) 1.*',r'\g<height>', out, flags = re.DOTALL)) except OSError as exc: import errno if exc.errno == errno.ENOENT: |