Just sharing a bit of more info about why the conda prompt breaks.
Hugo Buddelmeijer <firstname.lastname@example.org> writes:
> 2. The prompt is not set correctly, as in, what should happen is that the
> current conda environment is added to the prompt. Instead, the prompt is
> replaced entirely by the environment. This shouldn't be too hard to fix
> manually though.
Weird! Is this something Conda does wrong because it assumes too much
about the existing prompt?
This is what happens, reducing the files to the essence:
1) .bashrc runs
__conda_setup="$('/gnu/store/ihn8dbs84rmc3ai7r1vkvh4cya518wmx-conda-4.8.3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
2) __conda_setup runs
ask_conda="$(PS1="$PS1" "$CONDA_EXE" $_CE_M $_CE_CONDA shell.posix "$cmd" "$@")" || \return $?
conda activate base
3) ask_conda will contain the new PS1 definition. The command ran to create ask_conda is
PS1="\u@\h \w\$" "/gnu/store/ihn8dbs84rmc3ai7r1vkvh4cya518wmx-conda-4.8.3/bin/conda" shell.posix "activate" "base"
4) conda runs
exec -a "$0" "/gnu/store/ihn8dbs84rmc3ai7r1vkvh4cya518wmx-conda-4.8.3/bin/.conda-real" "$@"
5) .conda.real generates the prompt in Python:
from conda.cli import main
6) .conda.real outputs
The problem with the prompt arises from step 4), because 'conda' has bash as interpreter, and "non-interactive bashes go out of their way to unset PS1":
So .conda.real never gets the PS1 variable and it disappears.
I don't really understand why there is a bash function, a conda bash script and a .conda-real python script.