add comments

This commit is contained in:
romir kulshrestha 2024-02-09 07:12:49 +01:00
parent 9d0e422d3f
commit 4e127dcd39
No known key found for this signature in database
2 changed files with 12 additions and 4 deletions

View file

@ -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

View file

@ -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