From 57ab322d674a58ddfa2c04fc8aa45b8171b2bf08 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 27 Oct 2018 14:03:44 -0400 Subject: [PATCH] profile: export PS1, don't just set it. Technically the profile is supposed to be sourced, but it seems that some scenarios / applications do not do this and instead run it. Before the recent changes to PS1, it was also exported, and now it is again. Should fix entering HaikuPorter chroots under the new profile. Also renamed "ARCH" to "_ARCH" to better accomodate those who are sourcing this file, in case they want to pass a variable named ARCH through. --- data/etc/profile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/etc/profile b/data/etc/profile index 5e9aad0b69..2ce95c7339 100644 --- a/data/etc/profile +++ b/data/etc/profile @@ -3,17 +3,17 @@ # Place user customizations in ~/config/settings/profile # -ARCH=`getarch 2>/dev/null` -if [ "$ARCH" = "`getarch -p 2>/dev/null`" ] ; then +_ARCH=`getarch 2>/dev/null` +if [ "$_ARCH" = "`getarch -p 2>/dev/null`" ] ; then echo -e "\nWelcome to the Haiku shell.\n" PS1="\w" else echo -e "\nSwitching to architecture `getarch`\n" - PS1="[$ARCH] \w" + PS1="[$_ARCH] \w" fi -unset ARCH +unset _ARCH -PS1="\["'`if [ $? = 0 ]; then echo "\e[32m"; +export PS1="\["'`if [ $? = 0 ]; then echo "\e[32m"; else echo "\e[31m"; fi`'"\]$PS1\[\e[0m\]> " export USER=`id -un`