diff options
| author | Mehdi Sadeghi <mehdi@mehdix.org> | 2021-06-29 13:58:48 +0200 |
|---|---|---|
| committer | Mehdi Sadeghi <mehdi@mehdix.org> | 2021-06-29 13:58:48 +0200 |
| commit | da83541f68bf47ca1fc5b03848787123664270cc (patch) | |
| tree | 5925099402267656ad7d372fe14d91bad9c61adc /.local/bin/prompt | |
| parent | 052e42e23f4d7de0acb09f8f9ae966f627aebde9 (diff) | |
Fix the git prompt.
Diffstat (limited to '.local/bin/prompt')
| -rwxr-xr-x | .local/bin/prompt | 4 |
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$ " ;; |
