feat(python): add recursive parent directory search for auto_vrun

Add PYTHON_AUTO_VRUN_RECURSIVE option to search parent directories
for virtual environments, useful for monorepos where venv is at
project root but you work in subdirectories.
This commit is contained in:
kang 2026-01-18 20:15:31 +08:00
commit d7dd980970
No known key found for this signature in database
GPG key ID: 716B162E703DA80C
2 changed files with 15 additions and 1 deletions

View file

@ -34,6 +34,7 @@ virtual environments:
`<venv-name>/bin/activate`, and automatically deactivate it when navigating out of it (keeps venv activated
in subdirectories).
- To enable the feature, set `PYTHON_AUTO_VRUN=true` before sourcing oh-my-zsh.
- To also search parent directories (useful for monorepos), set `PYTHON_AUTO_VRUN_RECURSIVE=true` as well.
- The plugin activates the first existing virtual environment, in order, appearing in `$PYTHON_VENV_NAMES`.
The default virtual environment name is `venv`. To use a different name, set
`PYTHON_VENV_NAME=<venv-name>`. For example: `PYTHON_VENV_NAME=".venv"`