All of lore.kernel.org
 help / color / mirror / Atom feed
* [oe-core][PATCH 1/1] terminal.py: do not stop searching for auto
@ 2020-05-21 18:41 Joe Slater
  2020-05-21 19:52 ` Randy MacLeod
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Slater @ 2020-05-21 18:41 UTC (permalink / raw)
  To: openembedded-core; +Cc: joe.slater, randy.macleod

If a terminal fails to spawn() we should continue looking.
gnome-terminal, in particular can be present but not start.

Signed-off-by: Joe Slater <joe.slater@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())
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [oe-core][PATCH 1/1] terminal.py: do not stop searching for auto
  2020-05-21 18:41 [oe-core][PATCH 1/1] terminal.py: do not stop searching for auto Joe Slater
@ 2020-05-21 19:52 ` Randy MacLeod
  2020-05-21 20:55   ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Randy MacLeod @ 2020-05-21 19:52 UTC (permalink / raw)
  To: Joe Slater, openembedded-core

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.slater@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [oe-core][PATCH 1/1] terminal.py: do not stop searching for auto
  2020-05-21 19:52 ` Randy MacLeod
@ 2020-05-21 20:55   ` Richard Purdie
  2020-05-22  0:36     ` Joe Slater
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2020-05-21 20:55 UTC (permalink / raw)
  To: Randy MacLeod, Joe Slater, openembedded-core

On Thu, 2020-05-21 at 15:52 -0400, Randy MacLeod wrote:
> 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?

I suspect the issue is more like gnome-terminal is present as a binary
but no X desktop is running...

Cheers,

Richard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [oe-core][PATCH 1/1] terminal.py: do not stop searching for auto
  2020-05-21 20:55   ` Richard Purdie
@ 2020-05-22  0:36     ` Joe Slater
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Slater @ 2020-05-22  0:36 UTC (permalink / raw)
  To: Richard Purdie, MacLeod, Randy, openembedded-core

Yes, I think it is what Richard says.  But, that's a specific case, and I think that, in general, it would be better to look for something that
does work.   Like my glorious leader says, "What have you got to lose?"

The change does print out a warning, so you can check out what the problem is, if you care to.

Joe

-----Original Message-----
From: Richard Purdie <richard.purdie@linuxfoundation.org> 
Sent: Thursday, May 21, 2020 1:55 PM
To: MacLeod, Randy <Randy.MacLeod@windriver.com>; Slater, Joseph <joe.slater@windriver.com>; openembedded-core@lists.openembedded.org
Subject: Re: [oe-core][PATCH 1/1] terminal.py: do not stop searching for auto

On Thu, 2020-05-21 at 15:52 -0400, Randy MacLeod wrote:
> 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?

I suspect the issue is more like gnome-terminal is present as a binary but no X desktop is running...

Cheers,

Richard


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-22  0:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 18:41 [oe-core][PATCH 1/1] terminal.py: do not stop searching for auto Joe Slater
2020-05-21 19:52 ` Randy MacLeod
2020-05-21 20:55   ` Richard Purdie
2020-05-22  0:36     ` Joe Slater

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.