Created
August 11, 2015 14:52
-
-
Save jackmaney/1d08614bd32b87addb7f to your computer and use it in GitHub Desktop.
pyenv virtualenv in PS1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export VIRTUAL_ENV_DISABLE_PROMPT=1 | |
pyenv_python_version(){ | |
result="" | |
if pyenv 2>/dev/null; then | |
pyenv_version="$(pyenv version-name)"; | |
if [ -n "$pyenv_version" ]; then | |
result="$pyenv_version"; | |
fi | |
fi | |
[[ -n "$result" ]] && echo "($result) " | |
} | |
export PS1="\$(pyenv_python_version)\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h\[\033[33;1m\]\w\[\033[m\]$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment