Skip to content

Commit bd5aee1

Browse files
authored
vcs_git: fix display with branch name starting with digits
By suggestion of @Artoria2e5 about UNIX escape characters.
1 parent d1afdbf commit bd5aee1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bashrc.d/.vcs_git

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ alias __git_branch="git branch 2>/dev/null | grep '*' | sed 's/*\ //g'"
3434
_git_status() {
3535
git branch &>/dev/null || return 1
3636
if LC_ALL=C git status | grep -q "nothing to commit"; then
37-
echo -e "\01\e[1m\02@\01\e[0;32m\02$(__git_branch)\01\e[0m\02"
37+
echo -e "\01\e[1m\02@\01\e[0;32m\0002$(__git_branch)\01\e[0m\02"
3838
elif LC_ALL=C git status | grep -q "nothing added to commit"; then # Untracked
39-
echo -e "\01\e[1m\02@\01\e[0;35m\02$(__git_branch)\01\e[0m\02"
39+
echo -e "\01\e[1m\02@\01\e[0;35m\0002$(__git_branch)\01\e[0m\02"
4040
else # Change not added/not merged yet
41-
echo -e "\01\e[1m\02@\01$IRED\02$(__git_branch)\01\e[0m\02"
41+
echo -e "\01\e[1m\02@\01$IRED\0002$(__git_branch)\01\e[0m\02"
4242
fi
4343
}
4444

0 commit comments

Comments
 (0)