From 2b71206d42ea6dd8b02d104a770d6495c4ed44df Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Mon, 25 Jul 2022 16:36:59 -0400 Subject: [PATCH] disable git prompt if git completion is not sourced --- bash_tools/theme_bash.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bash_tools/theme_bash.sh b/bash_tools/theme_bash.sh index 9910eb5..0ca4013 100644 --- a/bash_tools/theme_bash.sh +++ b/bash_tools/theme_bash.sh @@ -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\]$ '