mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-30 09:40:09 +00:00
Added current working anaconda env to agnoster prompt
This commit is contained in:
parent
a52a5fb1f4
commit
e501f8aace
1 changed files with 14 additions and 0 deletions
|
@ -198,6 +198,19 @@ prompt_virtualenv() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Anaconda: current working conda env
|
||||||
|
# To replace the conda modification of PS1 do `conda config --set changeps1 False`
|
||||||
|
# or add 'changeps1: False' to your .condarc file.
|
||||||
|
prompt_conda() {
|
||||||
|
local conda_env="$CONDA_DEFAULT_ENV"
|
||||||
|
if [[ -n $conda_env ]]; then
|
||||||
|
local conda_changeps1="`conda config --show changeps1`"
|
||||||
|
if [[ $conda_changeps1 == "changeps1: False" && $conda_env != "base" ]]; then
|
||||||
|
prompt_segment blue black "($CONDA_DEFAULT_ENV)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Status:
|
# Status:
|
||||||
# - was there an error
|
# - was there an error
|
||||||
# - am I root
|
# - am I root
|
||||||
|
@ -216,6 +229,7 @@ prompt_status() {
|
||||||
build_prompt() {
|
build_prompt() {
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
prompt_status
|
prompt_status
|
||||||
|
prompt_conda
|
||||||
prompt_virtualenv
|
prompt_virtualenv
|
||||||
prompt_context
|
prompt_context
|
||||||
prompt_dir
|
prompt_dir
|
||||||
|
|
Loading…
Reference in a new issue