From 81a30bc600e230a5e2eb77ee7315ee9dda6b5a00 Mon Sep 17 00:00:00 2001 From: Claudius Heine Date: Mon, 19 Jun 2017 10:11:36 +0200 Subject: [PATCH] Added SHELL and TERM to environment whitelist and start $SHELL if set Currently the shell provided via the 'shell' command is always '/bin/sh' and does not have a TERM variable set. This is a rather spartan shell experience. With this patch we add the TERM variable to the whitelist, so that pagers work better and made the shell binary dependent from the SHELL environment variable. If no such variable is set, we fall back to using '/bin/sh'. Signed-off-by: Claudius Heine --- kas/libkas.py | 3 ++- kas/shell.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kas/libkas.py b/kas/libkas.py index 8392102..7b2f14d 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -170,7 +170,8 @@ def get_oe_environ(config, build_dir): ew = env['BB_ENV_EXTRAWHITE'] + ' '.join(vars) env.update({'BB_ENV_EXTRAWHITE': ew}) - vars.extend(['SSH_AGENT_PID', 'SSH_AUTH_SOCK']) + vars.extend(['SSH_AGENT_PID', 'SSH_AUTH_SOCK', + 'SHELL', 'TERM']) for v in vars: if v in os.environ: diff --git a/kas/shell.py b/kas/shell.py index 5120d69..688ab91 100644 --- a/kas/shell.py +++ b/kas/shell.py @@ -73,7 +73,7 @@ class ShellCommand(Command): return 'shell' def execute(self, config): - cmd = ['/bin/sh'] + cmd = [config.environ.get('SHELL', '/bin/sh')] if self.cmd: cmd.append('-c') cmd.append(self.cmd)