From d43f5b09f76a4fb486b2b8346efc158e997330da Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 12 Apr 2024 09:24:08 +0200 Subject: [PATCH] small fix --- plugins/poetry-env/poetry-env.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh index 8f9e09e08..f98c177b4 100644 --- a/plugins/poetry-env/poetry-env.plugin.zsh +++ b/plugins/poetry-env/poetry-env.plugin.zsh @@ -6,14 +6,14 @@ _togglePoetryShell() { fi # Deactivate the current environment if moving out of a Poetry directory or into a different Poetry directory - if [[ "$poetry_active" == 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 deactivate fi # Activate the environment if in a Poetry directory and no environment is currently active - if [[ $in_poetry_dir -eq 1 ]] && [[ "$poetry_active" != 1 ]]; then + if [[ $in_poetry_dir -eq 1 ]] && [[ $poetry_active -ne 1 ]]; then venv_dir=$(poetry env info --path 2>/dev/null) if [[ -n "$venv_dir" ]]; then export poetry_active=1