summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMehdi Sadeghi <mehdi@mehdix.org>2021-07-31 09:36:51 +0200
committerMehdi Sadeghi <mehdi@mehdix.org>2021-07-31 09:36:51 +0200
commit8eb348c48faf03dd6a0980d9e84393058d47853c (patch)
tree78ebb29c7598ff781837346fe4eb2679cdaddcfc
parenta32311fd58f5874e4cdcd8dd0b5059e01c92cd19 (diff)
Quote pwd in prompt.
-rwxr-xr-x.local/bin/prompt2
1 files changed, 1 insertions, 1 deletions
diff --git a/.local/bin/prompt b/.local/bin/prompt
index 0344618..f9b3836 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 -n "$BRANCH" && echo "($BRANCH)")
-PROMPT="$USER@$(hostname):$( test $PWD = $HOME && echo '~' || echo "$PWD")$BRANCH"
+PROMPT="$USER@$(hostname):$( test "$PWD" = $HOME && echo '~' || echo "$PWD")$BRANCH"
case $(id -u) in
0) echo "$PROMPT# " ;;
*) echo "$PROMPT$ " ;;