mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2026-09-10 07:16:18 -04:00
add comments
This commit is contained in:
parent
9d0e422d3f
commit
4e127dcd39
|
|
@ -246,11 +246,17 @@ if [ -z "${PYENV_VIRTUALENV_DISABLE_PROMPT}" ]; then
|
|||
fish )
|
||||
if [ -z "${QUIET}" ]; then
|
||||
cat <<EOS
|
||||
functions -e _pyenv_old_prompt
|
||||
functions -c fish_prompt _pyenv_old_prompt
|
||||
functions -e _pyenv_old_prompt # remove old prompt function if exists.
|
||||
# since everything is in memory, it's safe to
|
||||
# remove it.
|
||||
functions -c fish_prompt _pyenv_old_prompt # backup old prompt function
|
||||
|
||||
# from python-venv
|
||||
function fish_prompt
|
||||
echo -n "(${venv}) "
|
||||
_pyenv_old_prompt
|
||||
set -l prompt (_pyenv_old_prompt) # call old prompt function first since it might
|
||||
# read exit status
|
||||
echo -n "(${venv}) " # add virtualenv to prompt
|
||||
string join -- \n \$prompt # handle multiline prompts
|
||||
end
|
||||
EOS
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -188,7 +188,9 @@ esac
|
|||
case "${shell}" in
|
||||
fish )
|
||||
cat <<EOS
|
||||
# check if old prompt function exists
|
||||
if functions -q _pyenv_old_prompt
|
||||
# remove old prompt function if exists.
|
||||
functions -e fish_prompt
|
||||
functions -c _pyenv_old_prompt fish_prompt
|
||||
functions -e _pyenv_old_prompt
|
||||
|
|
|
|||
Loading…
Reference in a new issue