Patchwork [1/1] terminal.bbclass: do not export PS1

login
register
mail settings
Submitter Anders Darander
Date Jan. 10, 2014, 2:59 p.m.
Message ID <8da3468e95268dad80132de5e8398c7491cc7b71.1389365909.git.anders@chargestorm.se>
Download mbox | patch
Permalink /patch/64535/
State New
Headers show

Comments

Anders Darander - Jan. 10, 2014, 2:59 p.m.
With a complex PS1 setup, PS1 might not have all characters correctly escaped
when terminal.bbclass writes the export. This caused the run.do_terminal.PID to
terminate, making it impossible to use the devshell.

As the spawned shell will parse e.g. .bashrc (or whatever rc-file is being
used), PS1 will be reset in the devshell.

Signed-off-by: Anders Darander <anders@chargestorm.se>
---
 meta/classes/terminal.bbclass | 4 ++++
 1 file changed, 4 insertions(+)
Enrico Scholz - Jan. 10, 2014, 3:26 p.m.
Anders Darander <anders-7UjN0b3lYz2SbKU13Z4Etw@public.gmane.org> writes:

> With a complex PS1 setup, PS1 might not have all characters correctly
> escaped

I think, this must be solved in other layers (bitbake?).  Using
'pipes.quote()' seems to be a proper way to escape things correctly.


Enrico

Patch

diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
index 774f055..e577c6d 100644
--- a/meta/classes/terminal.bbclass
+++ b/meta/classes/terminal.bbclass
@@ -64,6 +64,10 @@  def oe_terminal(command, title, d):
             envdata.setVar(key, str(value))
             envdata.setVarFlag(key, 'export', 1)
 
+    # A complex PS1 might need more escaping of chars.
+    # Lets not export PS1 instead.
+    envdata.delVar("PS1")
+
     # Replace command with an executable wrapper script
     command = emit_terminal_func(command, envdata, d)