Change the prompt again.
As expected there was a lot of bikeshedding. Just change the color of the path, green on success, red on failure. Constraints taken into account: - Keep the > for now - Prompt should be as compact as possible for those of us using 80 column terminals. - Prompt should not change size between success and error cases Not taken into account: - The feature should be accessible to colorblind people (we could replace the > with another char but we couldn't find something that looks suitable)
This commit is contained in:
+4
-4
@@ -6,15 +6,15 @@
|
||||
ARCH=`getarch 2>/dev/null`
|
||||
if [ "$ARCH" = "`getarch -p 2>/dev/null`" ] ; then
|
||||
echo -e "\nWelcome to the Haiku shell.\n"
|
||||
PS1="\w "
|
||||
PS1="\w"
|
||||
else
|
||||
echo -e "\nSwitching to architecture `getarch`\n"
|
||||
PS1="[$ARCH] \w "
|
||||
PS1="[$ARCH] \w"
|
||||
fi
|
||||
unset ARCH
|
||||
|
||||
PS1="$PS1"'`if [ $? = 0 ]; then echo "\e[32m:)\e[0m\]"; else \
|
||||
echo "\e[31;1m\]:(\e[0m\]"; fi` \e[0m\]$ '
|
||||
PS1='`if [ $? = 0 ]; then echo "\e[32m";
|
||||
else echo "\e[31m\]"; fi`'"$PS1\e[0m\]> "
|
||||
|
||||
export USER=`id -un`
|
||||
export GROUP=`id -gn`
|
||||
|
||||
Reference in New Issue
Block a user