From 9d1582e31ace462d2254ff8b10d0a234989b03a9 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 21 Aug 2018 21:01:20 -0400 Subject: [PATCH] etc/profile: Add kallisti5's smiley-face $? indicator and use $ not >. An example of the new prompt line format is: ~/Desktop/haiku :) $ Or if the last command exited in failure: ~/Desktop/haiku :( $ The smiley-face will be either dark green or red, also depending on the command status. I realize this could be a tad controversial, especially for those used to the old prompt, but it seems to be a pretty useful feature to me (and of course kallisti5 came up with it.) But if the bikeshed turns out to be too large, we can revert it and deal with it after the beta. As for $ vs > -- BeOS R5 used $, most modern Linux uses $, and having > come after a space looks much stranger. --- data/etc/profile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/etc/profile b/data/etc/profile index 423dfd6a02..5885d01eb0 100644 --- a/data/etc/profile +++ b/data/etc/profile @@ -1,18 +1,21 @@ # # Administrative startup for /bin/sh -# Place user customizations in /.profile +# Place user customizations in ~/config/settings/profile # ARCH=`getarch 2>/dev/null` if [ "$ARCH" = "`getarch -p 2>/dev/null`" ] ; then echo -e "\nWelcome to the Haiku shell.\n" - export PS1="\w> " + PS1="\w " else echo -e "\nSwitching to architecture `getarch`\n" - export 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\]$ ' + export USER=`id -un` export GROUP=`id -gn`