mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-16 17:50:09 +00:00
Much faster conda env detection - no more file I/O needed.
This commit is contained in:
parent
02820a9f3f
commit
8a62fceb7b
1 changed files with 2 additions and 7 deletions
|
@ -291,13 +291,8 @@ CURRENT_BG='NONE'
|
|||
|
||||
# Anaconda Environment
|
||||
prompt_anaconda() {
|
||||
if $(hash ack 2>/dev/null); then
|
||||
local active_conda_env=$(where conda | ack -o '(?<=envs/)[\w-]+(?=/bin)')
|
||||
else
|
||||
local active_conda_env=$(where conda | grep -o -P '(?<=envs/)[\w-]+(?=/bin)')
|
||||
fi
|
||||
if [[ -n $active_conda_env ]]; then
|
||||
"$1_prompt_segment" "$0" "$2" "green" "black" "($active_conda_env)" ""
|
||||
if ! [ -z ${CONDA_ENV_PATH+x} ]; then
|
||||
"$1_prompt_segment" "$0" "$2" "green" "black" "($(basename $CONDA_ENV_PATH))" ""
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue