diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/essentials/zsh/.zshrc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 3f2d7f4..76ff87f 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -115,9 +115,9 @@ RPROMPT='%F{blue}$(parse_git_remote)%f%F{red}$(parse_git_status)%f%F{green}$(par setopt prompt_subst parse_git_remote() { - git branch -v 2>/dev/null | - grep '^\*' | cut -f2 -d'[' | cut -f1 -d' ' | - sed 's/ahead/↑ /;s/behind/↓ /;s/\*//' + git branch -v 2> /dev/null | + awk -F '[][]' '/^\*/ {print $2}' | + sed 's/ahead/↑ /;s/behind/↓ /;s/[^↓↑]*/ /g' } parse_git_branch() { git symbolic-ref --short HEAD 2> /dev/null || git rev-parse --short HEAD 2> /dev/null |