plugin: virtualenvwrapper doesn't cleanup properly after being disabled/reconfigured #12852
Labels
Area: plugin
Issue or PR related to a plugin
Status: needs repro
Bug that doesn't have a reproduction
Describe the bug
hello.
virtualenvwrapper
plugin has this feature where it installs a zshchpwd
hook function namedworkon_cwd
.It has a configurable env variable for people like me:
DISABLE_VENV_CD
.However if you define
export DISABLE_VENV_CD=1
and then source the plugin, it will leave previously defined function intact. :)basically, when being sourced the plugin needs to check whether it needs the function and whether it is already present.
Steps to reproduce
Assuming you have oh-my-zsh installed at default location.
I. Enable the plugin
virtualenvwrapper
and see its operation:so far as expected.
II. Disable cd handling:
i.e. the hook is still working :)
Expected behavior
I expected at II last line I would not get any
chpw
hooks.Screenshots and recordings
don't forget to clean up:
OS / Linux distribution
Mac OS 15.2
Zsh version
5.9
Terminal emulator
iTerm2
If using WSL on Windows, which version of WSL
None
Additional context
workarounds:
omz reload
FIX:
add a test for DISABLE_VENV_CD undef or 0 and ensure that the hook
is removed from
chpwd_functions`:I know this is a rare use case and not a critical one.
The text was updated successfully, but these errors were encountered: