Add conda environment info to terminal prompt
To add to the answer by A.Wenn, this is what I added to my custom prompt
PS1=""
# Add conda environment to prompt
if [ ! -z "$CONDA_DEFAULT_ENV" ]
then
PS1+="($CONDA_DEFAULT_ENV) "
fi
The method suggested in the comment from darthbith works very well. The variable $CONDA_DEFAULT_ENV
is exactly what I was looking for:
>>> source activate myEnv
>>> echo $CONDA_DEFAULT_ENV
myEnv