Comments
Patch
@@ -4,6 +4,7 @@ OE_TERMINAL[choices] = 'auto none \
${@" ".join(o.name \
for o in oe.terminal.prioritized())}'
+OE_TERMINAL_PREFERRED ?= "auto"
OE_TERMINAL_EXPORTS = 'XAUTHORITY SHELL DBUS_SESSION_BUS_ADDRESS DISPLAY EXTRA_OEMAKE SCREENDIR'
OE_TERMINAL_EXPORTS[type] = 'list'
@@ -34,7 +35,7 @@ def oe_terminal(command, title, d):
bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
try:
- oe.terminal.spawn_preferred(command, title)
+ oe.terminal.spawn_preferred(d.getVar('OE_TERMINAL_PREFERRED', True), command, title)
except oe.terminal.NoSupportedTerminals:
bb.fatal('No valid terminal found, unable to open devshell')
except oe.terminal.ExecutionError as exc:
@@ -111,11 +111,13 @@ class Screen(Terminal):
def prioritized():
return Registry.prioritized()
-def spawn_preferred(command, title=None, env=None):
+def spawn_preferred(priorityList, command, title=None, env=None):
"""Spawn the first supported terminal, by priority"""
- for terminal in prioritized():
+ if priorityList == "auto":
+ priorityList = ' '.join(o.name for o in prioritized())
+ for terminal in priorityList.split():
try:
- spawn(terminal.name, command, title, env)
+ spawn(terminal, command, title, env)
break
except UnsupportedTerminal:
continue
With the addition of two different modes for the use of screen, an end user may prefer to set specific fall back order for an X vs tty environment. This patch modifies the terminal.bbclass and terminal.py to allow the variable OE_TERMINAL_PREFERRED to control the order of trying the various supported OE_TERMINAL's. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> --- meta/classes/terminal.bbclass | 3 ++- meta/lib/oe/terminal.py | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-)