summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@gmail.com>2019-04-10 12:23:09 +0000
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-04-10 12:23:09 +0000
commita618137bc2736d88eed97387efcabb960cb6caf1 (patch)
tree54e7bbd5794f0ec6c4591922d4bcde14805f0061
parentfbdc8f75d078a4077b9d0c9f737864833e6d953b (diff)
keep the original PS1 info from host env
Closes #138
-rw-r--r--cerbero/utils/shell.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py
index 06a39a42..2b76704b 100644
--- a/cerbero/utils/shell.py
+++ b/cerbero/utils/shell.py
@@ -548,7 +548,7 @@ if [ -e ~/.bashrc ]; then
source ~/.bashrc
fi
%s
-PS1='\[\033[01;32m\][cerbero-%s-%s]\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
+PS1='\[\033[01;32m\][cerbero-%s-%s]\[\033[00m\]%s'
'''
MSYSBAT = '''
start bash.exe --rcfile %s
@@ -570,10 +570,10 @@ start bash.exe --rcfile %s
# We should remove the temporary directory
# but there is a race with the bash process
else:
+ ps1 = os.environ.get('PS1', '')
bashrc = tempfile.NamedTemporaryFile()
- bashrc.write((BASHRC % (sourcedirsh, platform, arch)).encode())
+ bashrc.write((BASHRC % (sourcedirsh, platform, arch, ps1)).encode())
bashrc.flush()
-
shell = os.environ.get('SHELL', '/bin/bash')
if os.system("%s --rcfile %s -c echo 'test' > /dev/null 2>&1" % (shell, bashrc.name)) == 0:
os.execlp(shell, shell, '--rcfile', bashrc.name)