aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorLion Krischer <krischer@geophysik.uni-muenchen.de>2016-07-15 17:26:37 +0300
committerLion Krischer <krischer@geophysik.uni-muenchen.de>2016-08-31 01:08:01 +0300
commit8a62fceb7b114d3121cd3d67c03a99e945eadcce (patch)
treed146b5817c9a810eeef3aa4b7a88773c78edf850 /powerlevel9k.zsh-theme
parent02820a9f3f6927e7e38a2831061a05cde777fd06 (diff)
Much faster conda env detection - no more file I/O needed.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme9
1 files changed, 2 insertions, 7 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index a1d18cb1..57058a70 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -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
}