commit 5bc43a463ca066b91bdbcd3ac5f3f7ec9c7515a4
parent fc70a442c634a98fdaf878efee5b17befc6ab56c
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date: Fri, 3 May 2024 16:02:54 -0500
bash: improved PS1
Not show dotfiles git repo if not inside $HOME
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.bashrc b/.bashrc
@@ -33,7 +33,7 @@ export GIT_PS1_SHOWUPSTREAM="auto"
export GIT_PS1_COMPRESSSPARSESTATE=1
export GIT_PS1_SHOWCONFLICTSTATE=1
export GIT_PS1_HIDE_IF_PWD_IGNORED=1
-PS1='\$$(GIT_DIR=$HOME/.dotfiles GIT_WORK_TREE=$HOME __git_ps1)$(__git_ps1) '
+PS1='\$$([[ $PWD/ = $HOME/* ]] && GIT_DIR=$HOME/.dotfiles GIT_WORK_TREE=$HOME __git_ps1)$(__git_ps1) '
cd() { echo "Use pushd!"; }