I am using the git-prompt.sh script to show the git status at the bash command prompt. Using the
PROMPT_COMMAND method to also have colors:
source ~/.bash.d/git-prompt.sh # Show git branch name at command prompt export GIT_PS1_SHOWCOLORHINTS=true # use existing PS1 settings PROMPT_COMMAND=$(sed -r 's|^(.+)(\\\$\s*)$|__git_ps1 "\1" "\2"|' <<< $PS1)
This works so far in regard of showing the git status, but it does not show the conda environment anymore.
When I comment out the line with
PROMPT_COMMAND=..., the conda env is displayed, e.g.
(base) [user@linux ~]$
Apparently the problem is that git-prompt.sh uses PROMPT_COMMAND and conda uses PS1.
Is there a way to achieve this? Maybe showing the conda env with PROMPT_COMMAND?