summaryrefslogtreecommitdiff
path: root/.local/bin/prompt
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/prompt')
-rwxr-xr-x.local/bin/prompt4
1 files changed, 2 insertions, 2 deletions
diff --git a/.local/bin/prompt b/.local/bin/prompt
index 0118ae8..0344618 100755
--- a/.local/bin/prompt
+++ b/.local/bin/prompt
@@ -1,7 +1,7 @@
#!/bin/sh
BRANCH=$(git branch --show-current 2>/dev/null)
-BRANCH=$(test -d .git && test -n $BRANCH && echo "($BRANCH)")
-PROMPT="$USER@$(hostname):$( test $PWD = $HOME && echo '~' || basename "$PWD")$BRANCH"
+BRANCH=$(test -n "$BRANCH" && echo "($BRANCH)")
+PROMPT="$USER@$(hostname):$( test $PWD = $HOME && echo '~' || echo "$PWD")$BRANCH"
case $(id -u) in
0) echo "$PROMPT# " ;;
*) echo "$PROMPT$ " ;;