diff --git a/README.md b/README.md index d533888..01c18d0 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,7 @@ You can set certain environment variables to control pyenv-virtualenv. * `PIP_VERSION`, if set and `venv` is preferred over `virtualenv`, install the specified version of pip. * `PYENV_VIRTUALENV_VERBOSE_ACTIVATE`, if set, shows some verbose outputs on activation and deactivation +* `PYENV_VIRTUALENV_PROMPT`, if set, allows users to customize how `pyenv-virtualenv` modifies their shell prompt. The default prompt ("(venv)") is overwritten with any user-specified text. Specify the location of the virtual environment name with the string `{venv}`. For example, the default prompt string would be `({venv})`. ## Version History diff --git a/bin/pyenv-sh-activate b/bin/pyenv-sh-activate index 38091ee..5c53b50 100755 --- a/bin/pyenv-sh-activate +++ b/bin/pyenv-sh-activate @@ -262,9 +262,14 @@ EOS fi ;; * ) + if [ -z "${PYENV_VIRTUALENV_PROMPT}" ]; then + PYENV_VIRTUALENV_PROMPT="(${venv})" + else + PYENV_VIRTUALENV_PROMPT="${PYENV_VIRTUALENV_PROMPT/\{venv\}/${venv}}" + fi cat <