mirror of
https://git.yoctoproject.org/poky
synced 2026-09-15 06:49:33 +02:00
terminal.py: No --disable-factory for gnome-terminal >= 3.10
--disable-factory has been disabled in earlier versions of gnome-terminal but from version 3.10 it raises an error and quits. This makes devshell unusable with gnome-terminal >= 3.10. This patch checks for the version and removes --disable-factory if you have the terminal version 3.10 or higher. (From OE-Core rev: 818c94f5b9882c2028ef9f056714a0a3c9045551) Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
9e9d6dfbd2
commit
43afafeffa
@@ -55,6 +55,14 @@ class Gnome(XTerminal):
|
|||||||
command = 'gnome-terminal -t "{title}" --disable-factory -x {command}'
|
command = 'gnome-terminal -t "{title}" --disable-factory -x {command}'
|
||||||
priority = 2
|
priority = 2
|
||||||
|
|
||||||
|
def __init__(self, sh_cmd, title=None, env=None, d=None):
|
||||||
|
# Check version
|
||||||
|
(major, minor) = check_terminal_version("gnome-terminal")
|
||||||
|
if major >= 3 and minor >= 10:
|
||||||
|
logger.warn(1, 'Gnome-Terminal >3.10 does not support --disable-factory')
|
||||||
|
self.command = 'gnome-terminal -t "{title}" -x {command}'
|
||||||
|
XTerminal.__init__(self, sh_cmd, title, env, d)
|
||||||
|
|
||||||
class Mate(XTerminal):
|
class Mate(XTerminal):
|
||||||
command = 'mate-terminal -t "{title}" -x {command}'
|
command = 'mate-terminal -t "{title}" -x {command}'
|
||||||
priority = 2
|
priority = 2
|
||||||
@@ -73,11 +81,10 @@ class Konsole(XTerminal):
|
|||||||
|
|
||||||
def __init__(self, sh_cmd, title=None, env=None, d=None):
|
def __init__(self, sh_cmd, title=None, env=None, d=None):
|
||||||
# Check version
|
# Check version
|
||||||
vernum = check_konsole_version("konsole")
|
(major, minor) = check_terminal_version("konsole")
|
||||||
if vernum:
|
if major == 2:
|
||||||
if vernum.split('.')[0] == "2":
|
logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping')
|
||||||
logger.debug(1, 'Konsole from KDE 4.x will not work as devshell, skipping')
|
raise UnsupportedTerminal(self.name)
|
||||||
raise UnsupportedTerminal(self.name)
|
|
||||||
XTerminal.__init__(self, sh_cmd, title, env, d)
|
XTerminal.__init__(self, sh_cmd, title, env, d)
|
||||||
|
|
||||||
class XTerm(XTerminal):
|
class XTerm(XTerminal):
|
||||||
@@ -219,10 +226,10 @@ def check_tmux_pane_size(tmux):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def check_konsole_version(konsole):
|
def check_terminal_version(terminalName):
|
||||||
import subprocess as sub
|
import subprocess as sub
|
||||||
try:
|
try:
|
||||||
p = sub.Popen(['sh', '-c', '%s --version' % konsole],stdout=sub.PIPE,stderr=sub.PIPE)
|
p = sub.Popen(['sh', '-c', '%s --version' % terminalName],stdout=sub.PIPE,stderr=sub.PIPE)
|
||||||
out, err = p.communicate()
|
out, err = p.communicate()
|
||||||
ver_info = out.rstrip().split('\n')
|
ver_info = out.rstrip().split('\n')
|
||||||
except OSError as exc:
|
except OSError as exc:
|
||||||
@@ -232,10 +239,17 @@ def check_konsole_version(konsole):
|
|||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
vernum = None
|
vernum = None
|
||||||
|
major = int(0)
|
||||||
|
minor = int(0)
|
||||||
for ver in ver_info:
|
for ver in ver_info:
|
||||||
if ver.startswith('Konsole'):
|
if ver.startswith('Konsole'):
|
||||||
vernum = ver.split(' ')[-1]
|
vernum = ver.split(' ')[-1]
|
||||||
return vernum
|
if ver.startswith('GNOME Terminal'):
|
||||||
|
vernum = ver.split(' ')[-1]
|
||||||
|
if vernum:
|
||||||
|
major = int(vernum.split('.')[0])
|
||||||
|
minor = int(vernum.split('.')[1])
|
||||||
|
return major, minor
|
||||||
|
|
||||||
def distro_name():
|
def distro_name():
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user