ca5471fe496f00007727fd26db762d19519c2e8f
- Author
- Kate Sullivan <75387802+katesullivan@users.noreply.github.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
fix(poetry-env): switch venv between poetry dirs (#12804)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
Diff
1diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh
2index dd52b165548a28d4e1694864fba53226bc802caf..dca388dfe58d11e4f6dd6795095cbfaf21742776 100644
3--- a/plugins/poetry-env/poetry-env.plugin.zsh
4+++ b/plugins/poetry-env/poetry-env.plugin.zsh
5@@ -6,8 +6,7 @@ _togglePoetryShell() {
6 fi
7
8 # Deactivate the current environment if moving out of a Poetry directory or into a different Poetry directory
9- if [[ $poetry_active -eq 1 ]] && [[ $in_poetry_dir -eq 0 ]] \
10- && [[ "$PWD" != "$poetry_dir"* ]]; then
11+ if [[ $poetry_active -eq 1 ]] && { [[ $in_poetry_dir -eq 0 ]] || [[ "$PWD" != "$poetry_dir"* ]]; }; then
12 export poetry_active=0
13 unset poetry_dir
14 (( $+functions[deactivate] )) && deactivate