2
1
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:
.bashrc :
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?
It works and does the show the git branch. I think it should be
$(git_branch)
though (without the \). But it doesn't provide all the features you get with git-prompt.sh and PROMPT_COMMAND – jost21 – 2019-08-13T07:31:13.310