From ca5471fe496f00007727fd26db762d19519c2e8f Mon Sep 17 00:00:00 2001 From: Kate Sullivan <75387802+katesullivan@users.noreply.github.com> Date: Thu, 14 Nov 2024 02:00:48 -0600 Subject: [PATCH] fix(poetry-env): switch venv between poetry dirs (#12804) Co-authored-by: Carlo Sala --- plugins/poetry-env/poetry-env.plugin.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh index dd52b1655..dca388dfe 100644 --- a/plugins/poetry-env/poetry-env.plugin.zsh +++ b/plugins/poetry-env/poetry-env.plugin.zsh @@ -6,8 +6,7 @@ _togglePoetryShell() { fi # Deactivate the current environment if moving out of a Poetry directory or into a different Poetry directory - if [[ $poetry_active -eq 1 ]] && [[ $in_poetry_dir -eq 0 ]] \ - && [[ "$PWD" != "$poetry_dir"* ]]; then + if [[ $poetry_active -eq 1 ]] && { [[ $in_poetry_dir -eq 0 ]] || [[ "$PWD" != "$poetry_dir"* ]]; }; then export poetry_active=0 unset poetry_dir (( $+functions[deactivate] )) && deactivate