Method
After conda init
we need to set in the ~/.p10k/zsh
vim ~/.p10k/zsh
Add this two sentences in this file, this two sentences are designed for the color and env format.
# Anaconda environment color.
typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=37
typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}'
And then add anaconda
to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
or POWERLEVEL9K_RIGHT_PROMPT_ELEMENT
to show.