On 2020-05-21 2:41 p.m., Joe Slater wrote:
If a terminal fails to spawn() we should continue looking.
gnome-terminal, in particular can be present but not start.


Do you mean that it doesn't start on the first try but that
it may / usually does start on subsequent tries?

Since the user has set the  preferred terminal,
this change could confuse them and therefore seems wrong.
If we know of flaky terminal implementations, why not look
for specific versions, issue a warning and either retry
or tell the user to try again? In a few years, we can discard
the code when the flaky terminal version is no longer used.

Is there a bug open with gnome-terminal to track this?
What distro/gnome-terminal do you see this problem in?



Signed-off-by: Joe Slater <joe.sla...@windriver.com>
---
  meta/lib/oe/terminal.py | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index a1daa2bed6..eb10a6e33e 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -207,7 +207,10 @@ def spawn_preferred(sh_cmd, title=None, env=None, d=None):
              spawn(terminal.name, sh_cmd, title, env, d)
              break
          except UnsupportedTerminal:
-            continue
+            pass
+        except:
+            bb.warn("Terminal %s is supported but did not start" % 
(terminal.name))
+    # when we've run out of options
      else:
          raise NoSupportedTerminals(get_cmd_list())

The full function is:

def spawn_preferred(sh_cmd, title=None, env=None, d=None):
    """Spawn the first supported terminal, by priority"""
    for terminal in prioritized():
        try:
            spawn(terminal.name, sh_cmd, title, env, d)
            break
        except UnsupportedTerminal:
            continue
    else:
        raise NoSupportedTerminals(get_cmd_list())


so you'll need to change the doc string if you want to retry 3 times.


--
# Randy MacLeod
# Wind River Linux
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#138561): 
https://lists.openembedded.org/g/openembedded-core/message/138561
Mute This Topic: https://lists.openembedded.org/mt/74382353/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to