mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 11:50:38 +01:00
Adding Pyenv support to Python virtualenv as "fallback"
This commit is contained in:
@@ -12,7 +12,7 @@ theme based on the
|
||||
simplicity, showing information only when it's relevant.
|
||||
|
||||
It currently shows:
|
||||
- Current Python virtualenv
|
||||
- Current Python virtualenv; when using Pyenv and no active virtualenv shows the current Python version the shell uses
|
||||
- Current Ruby version using Rbenv; version and gemset when on RVM
|
||||
- Current Node.js version, through NVM
|
||||
- Git status
|
||||
@@ -136,7 +136,7 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|
||||
|`BULLETTRAIN_CONTEXT_DEFAULT_USER`|none|Default user. If you are running with other user other than default, the segment will be showed.
|
||||
|`BULLETTRAIN_IS_SSH_CLIENT`|none|If `true`, the segment will be showed.
|
||||
|
||||
### Python virtualenv
|
||||
### Python virtualenv (+Pyenv)
|
||||
|
||||
|Variable|Default|Meaning
|
||||
|--------|-------|-------|
|
||||
|
||||
@@ -361,6 +361,8 @@ prompt_virtualenv() {
|
||||
local virtualenv_path="$VIRTUAL_ENV"
|
||||
if [[ -n $virtualenv_path && -n $VIRTUAL_ENV_DISABLE_PROMPT ]]; then
|
||||
prompt_segment $BULLETTRAIN_VIRTUALENV_BG $BULLETTRAIN_VIRTUALENV_FG $BULLETTRAIN_VIRTUALENV_PREFIX" $(basename $virtualenv_path)"
|
||||
elif which pyenv &> /dev/null; then
|
||||
prompt_segment $BULLETTRAIN_VIRTUALENV_BG $BULLETTRAIN_VIRTUALENV_FG $BULLETTRAIN_VIRTUALENV_PREFIX" $(pyenv version | sed -e 's/ (set.*$//')"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user