diff options
-rw-r--r-- | meta/lib/oe/terminal.py | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 54e3ffc1e8..01c0ccc334 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py | |||
@@ -55,6 +55,14 @@ class Gnome(XTerminal): | |||
55 | command = 'gnome-terminal -t "{title}" --disable-factory -x {command}' | 55 | command = 'gnome-terminal -t "{title}" --disable-factory -x {command}' |
56 | priority = 2 | 56 | priority = 2 |
57 | 57 | ||
58 | def __init__(self, sh_cmd, title=None, env=None, d=None): | ||
59 | # Check version | ||
60 | (major, minor) = check_terminal_version("gnome-terminal") | ||
61 | if major >= 3 and minor >= 10: | ||
62 | logger.warn(1, 'Gnome-Terminal >3.10 does not support --disable-factory') | ||
63 | self.command = 'gnome-terminal -t "{title}" -x {command}' | ||
64 | XTerminal.__init__(self, sh_cmd, title, env, d) | ||
65 | |||
58 | class Mate(XTerminal): | 66 | class Mate(XTerminal): |
59 | command = 'mate-terminal -t "{title}" -x {command}' | 67 | command = 'mate-terminal -t "{title}" -x {command}' |
60 | priority = 2 | 68 | priority = 2 |
@@ -73,11 +81,10 @@ class Konsole(XTerminal): | |||
73 | 81 | ||
74 | def __init__(self, sh_cmd, title=None, env=None, d=None): | 82 | def __init__(self, sh_cmd, title=None, env=None, d=None): |
75 | # Check version | 83 | # Check version |
76 | vernum = check_konsole_version("konsole") | 84 | (major, minor) = check_terminal_version("konsole") |
77 | if vernum: | 85 | if major == 2: |
78 | if vernum.split('.')[0] == "2": | 86 | logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping') |
79 | logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping') | 87 | raise UnsupportedTerminal(self.name) |
80 | raise UnsupportedTerminal(self.name) | ||
81 | XTerminal.__init__(self, sh_cmd, title, env, d) | 88 | XTerminal.__init__(self, sh_cmd, title, env, d) |
82 | 89 | ||
83 | class XTerm(XTerminal): | 90 | class XTerm(XTerminal): |
@@ -219,10 +226,10 @@ def check_tmux_pane_size(tmux): | |||
219 | return True | 226 | return True |
220 | return False | 227 | return False |
221 | 228 | ||
222 | def check_konsole_version(konsole): | 229 | def check_terminal_version(terminalName): |
223 | import subprocess as sub | 230 | import subprocess as sub |
224 | try: | 231 | try: |
225 | p = sub.Popen(['sh', '-c', '%s --version' % konsole],stdout=sub.PIPE,stderr=sub.PIPE) | 232 | p = sub.Popen(['sh', '-c', '%s --version' % terminalName],stdout=sub.PIPE,stderr=sub.PIPE) |
226 | out, err = p.communicate() | 233 | out, err = p.communicate() |
227 | ver_info = out.rstrip().split('\n') | 234 | ver_info = out.rstrip().split('\n') |
228 | except OSError as exc: | 235 | except OSError as exc: |
@@ -232,10 +239,17 @@ def check_konsole_version(konsole): | |||
232 | else: | 239 | else: |
233 | raise | 240 | raise |
234 | vernum = None | 241 | vernum = None |
242 | major = int(0) | ||
243 | minor = int(0) | ||
235 | for ver in ver_info: | 244 | for ver in ver_info: |
236 | if ver.startswith('Konsole'): | 245 | if ver.startswith('Konsole'): |
237 | vernum = ver.split(' ')[-1] | 246 | vernum = ver.split(' ')[-1] |
238 | return vernum | 247 | if ver.startswith('GNOME Terminal'): |
248 | vernum = ver.split(' ')[-1] | ||
249 | if vernum: | ||
250 | major = int(vernum.split('.')[0]) | ||
251 | minor = int(vernum.split('.')[1]) | ||
252 | return major, minor | ||
239 | 253 | ||
240 | def distro_name(): | 254 | def distro_name(): |
241 | try: | 255 | try: |