Bug report
Looked for similar issues and could not find any.
Steps to reproduce bug:
- activate venv
- spawn child fish process (or start tmux session)
- activate same venv
source activate.fish
fish
source activate.fish
Should output:
functions: Function “_old_fish_prompt” does not exist
Cause
I think I've identified the reason for the bug:
- The environment variables set in
activate.fish are exported to child processes (script uses set -gx to set the variables).
- However, the function
_old_fish_prompt is not exported to child processes.
So, when we run fish from another fish session (such as in tmux), the variables set in activate.fish are present in the child process, but the functions are not.
Fix
I've written a fix for this, which is to test if the _old_fish_prompt function exists before attempting to delete it. I can make a PR with this fix.
Also, the implementation from virtualenv does not suffer from this bug. They check if the function exists before deleting it.
Your environment
Ubuntu 22.04 amd64
Python 3.10.4
Python and venv packages installed from apt
Bug report
Looked for similar issues and could not find any.
Steps to reproduce bug:
Should output:
functions: Function “_old_fish_prompt” does not existCause
I think I've identified the reason for the bug:
activate.fishare exported to child processes (script usesset -gxto set the variables)._old_fish_promptis not exported to child processes.So, when we run fish from another fish session (such as in tmux), the variables set in
activate.fishare present in the child process, but the functions are not.Fix
I've written a fix for this, which is to test if the
_old_fish_promptfunction exists before attempting to delete it. I can make a PR with this fix.Also, the implementation from virtualenv does not suffer from this bug. They check if the function exists before deleting it.
Your environment
Ubuntu 22.04 amd64
Python 3.10.4
Python and venv packages installed from apt