From: Jason Wessel Date: Mon, 17 Sep 2012 22:43:51 +0000 (-0500) Subject: terminal: Send LogExecTTY event to spawn screen X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86cf6daff907aed4d14e55b91d2033e6cb0b3925;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git terminal: Send LogExecTTY event to spawn screen Bitbake has the ability to request to run a command and if it is not possible fall back to emitting a log message. This can be used to start a screen client automatically on the controling tty if the UI has an interactive tty. (From OE-Core rev: 39193bdce698b6339c3d7643eb3c1fcd2246fd56) Signed-off-by: Jason Wessel Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index 352a28239ac..71d8a434101 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py @@ -96,9 +96,14 @@ class Screen(Terminal): def __init__(self, sh_cmd, title=None, env=None, d=None): s_id = "devshell_%i" % os.getpid() self.command = "screen -D -m -t \"{title}\" -S %s {command}" % s_id - Terminal.__init__(self, sh_cmd, title, env) - logger.warn('Screen started. Please connect in another terminal with ' - '"screen -r devshell %s"' % s_id) + Terminal.__init__(self, sh_cmd, title, env, d) + msg = 'Screen started. Please connect in another terminal with ' \ + '"screen -r %s"' % s_id + if (d): + bb.event.fire(bb.event.LogExecTTY(msg, "screen -r %s" % s_id, + 0.5, 10), d) + else: + logger.warn(msg) def prioritized():