Skip to content

Commit 1d51c4f

Browse files
authored
make bash prompt more consistent;
* display λ in grey and bold * fix a bug where an uneeded colon would be prepended to the tab title (when MSYSTEM is unset)
1 parent aff4ad2 commit 1d51c4f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vendor/git-prompt.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ then
3838
. ~/.config/git/git-prompt.sh
3939
fi
4040
else
41-
# Taken from https://github.com/git-for-windows/build-extra/blob/main/git-extra/git-prompt.sh
42-
PS1='\[\033]0;$TITLEPREFIX:${PWD//[^[:ascii:]]/?}\007\]' # set window title
41+
# Taken parts from https://github.com/git-for-windows/build-extra/blob/main/git-extra/git-prompt.sh
42+
PS1='\[\033]0;${TITLEPREFIX:+$TITLEPREFIX:}${PWD//[^[:ascii:]]/?}\007\]' # set window title to TITLEPREFIX (if set) and current working directory
4343
# PS1="$PS1"'\n' # new line (disabled)
44-
PS1="$PS1"'\[\033[32m\]' # change to green
44+
PS1="$PS1"'\[\033[32m\]' # change to green and bold
4545
PS1="$PS1"'\u@\h ' # user@host<space>
4646
PS1="$PS1${MSYSTEM:+\[\033[35m\]$MSYSTEM }" # show MSYSTEM in purple (if set)
47-
PS1="$PS1"'\[\033[33m\]' # change to brownish yellow
47+
PS1="$PS1"'\[\033[1;33m\]' # change to dark yellow in bold
4848
PS1="$PS1"'\w' # current working directory
4949
if test -z "$WINELOADERNOEXEC"
5050
then
@@ -66,9 +66,11 @@ else
6666
fi
6767
fi
6868
fi
69-
PS1="$PS1"'\[\033[0m\]' # change color
69+
PS1="$PS1"'\[\033[0m\]' # reset color
7070
PS1="$PS1"'\n' # new line
71+
PS1="$PS1"'\[\033[30;1m\]' # change color to grey in bold
7172
PS1="$PS1"'λ ' # prompt: Cmder uses λ
73+
PS1="$PS1"'\[\033[0m\]' # reset color
7274
fi
7375

7476
MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc

0 commit comments

Comments
 (0)