diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2016-08-31 03:57:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-31 03:57:46 +0300 |
commit | 02cc43ff095a4f71ca558ff8b1de307d3b95b7d8 (patch) | |
tree | 2a8e64ce2d0da189850c76045ed9c5f1fd5aac5a /powerlevel9k.zsh-theme | |
parent | 683ca10e369ae6699197e81f6fd5aec44c05c4f1 (diff) | |
parent | 9bc55ab175f2bf48e6673327df7e814de35f9d1e (diff) |
Merge pull request #309 from krischer/conda-prompt-changes
Conda prompt speedup and configuration
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index bf09b4ce..e81aa6f2 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -291,13 +291,14 @@ 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)" "" + # Depending on the conda version, either might be set. This + # variant works even if both are set. + _path=$CONDA_ENV_PATH$CONDA_PREFIX + if ! [ -z "$_path" ]; then + # config - can be overwritten in users' zshrc file. + set_default POWERLEVEL9K_ANACONDA_LEFT_DELIMITER "(" + set_default POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER ")" + "$1_prompt_segment" "$0" "$2" "$3" "$4" "$POWERLEVEL9K_ANACONDA_LEFT_DELIMITER$(basename $_path)$POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER" 'PYTHON_ICON' fi } |