Skip to content

Commit

Permalink
Enabled CONDA env indication
Browse files Browse the repository at this point in the history
See agnoster/agnoster-zsh-theme#24 for
more details
  • Loading branch information
drorata committed Aug 6, 2017
1 parent d848c94 commit 141b117
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions themes/agnoster.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,19 @@ prompt_dir() {

# Virtualenv: current working virtualenv
prompt_virtualenv() {
local virtualenv_path="$VIRTUAL_ENV"
if [[ -n $virtualenv_path && -n $VIRTUAL_ENV_DISABLE_PROMPT ]]; then
prompt_segment blue black "(`basename $virtualenv_path`)"
local env='';

if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
env="$CONDA_DEFAULT_ENV"
elif [[ -n "$VIRTUAL_ENV" ]]; then
env="$VIRTUAL_ENV"
fi
}

if [[ -n $env ]]; then
prompt_segment cyan black
print -Pn "$(basename $env)"
fi
}
# Status:
# - was there an error
# - am I root
Expand Down

0 comments on commit 141b117

Please sign in to comment.