disable git prompt if git completion is not sourced

This commit is contained in:
Nachuan Tang
2022-07-25 16:36:59 -04:00
parent 9f4dbbe2f9
commit 2b71206d42
+4
View File
@@ -1,4 +1,8 @@
# display git status
export GIT_PS1_SHOWDIRTYSTATE=1
if [[ $(type -t foo) != function ]]; then
__git_ps1(){
}
fi
export PS1=' \[\e[0;32m\]\w\[\e[01;31m\]$(__git_ps1 "(%s)")\[\e[00m\]$ '