From 5fd4f8d7cbb6dd0af1a0fc670e8107ddb0e5212f Mon Sep 17 00:00:00 2001 From: James Dixon Date: Tue, 26 May 2020 04:28:36 +0000 Subject: [PATCH] add git symbol to prompt --- bash/bashrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bash/bashrc b/bash/bashrc index b2bd0e7..a360e16 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -179,10 +179,11 @@ parse_git() { # colors are unescaped because the whole function should be escaped in PS1 if [[ $? -ne 0 ]]; then return; else printf "${unesc_reset}${unesc_bold}%s" ":(${BRANCH})["; fi if echo "${STATUS}" | grep -c "nothing to commit" &> /dev/null; then printf "${unesc_blue}%s" "="; else printf ""; fi - if echo "${STATUS}" | grep -c "renamed:" &> /dev/null; then printf "${unesc_red}%s" ">"; else printf ""; fi + if echo "${STATUS}" | grep -c "renamed:" &> /dev/null; then printf "${unesc_red}%s" "%"; else printf ""; fi if echo "${STATUS}" | grep -c "deleted:" &> /dev/null; then printf "${unesc_red}%s" "-"; else printf ""; fi if echo "${STATUS}" | grep -c "new file:" &> /dev/null; then printf "${unesc_green}%s" "+"; else printf ""; fi - if echo "${STATUS}" | grep -c "branch is ahead:" &> /dev/null; then printf "${unesc_yellow}%s" "!"; else printf ""; fi + if echo "${STATUS}" | grep -c "branch is ahead:" &> /dev/null; then printf "${unesc_yellow}%s" ">"; else printf ""; fi + if echo "${STATUS}" | grep -c "branch is behind" &> /dev/null; then printf "${unesc_yellow}%s" "<"; else printf ""; fi if echo "${STATUS}" | grep -c "Untracked files:" &> /dev/null; then printf "${unesc_yellow}%s" "?"; else printf ""; fi if echo "${STATUS}" | grep -c "modified:" &> /dev/null; then printf "${unesc_yellow}%s" "*"; else printf ""; fi printf "${unesc_white}%s" "]"