The first step is to disable the default conda prompt modifier by running conda config --set changeps1 false as they already mentioned.
Next, add the following to your .zshrc:
# Determines prompt modifier if and when a conda environment is active
precmd_conda_info() {
if [[ -n $CONDA_DEFAULT_ENV ]]; then
CONDA_ENV="($CONDA_DEFAULT_ENV) "
# When no conda environment is active, don't show anything
else
CONDA_ENV=""
fi
}
# Run the previously defined function before each prompt
precmd_functions+=( precmd_conda_info )
# Allow substitutions and expansions in the prompt
setopt prompt_subst
PROMPT='%F{cyan}$CONDA_ENV%f%F{green}%n%f %B%F{blue}%1~%f%b $ '
With this, the conda environment is shown before the rest of the prompt, inside parentheses, and in cyan.
If you want it to appear bold, enclose that portion in %B and %b:
PROMPT='%B%F{cyan}$CONDA_ENV%b%f%F{green}%n%f %B%F{blue}%1~%f%b $ '
If you want to use more colours, check whether your terminal supports it by running echo $TERM. If it returns xterm-256color, you can replace the colours in curly brackets by values from 0 to 255. You can check out the colours here.