mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
bugfix(plugin): correctly switch VENV when transitioning between projects directly
Properly deactivate shell if you move directly from one poetry env to another otherwise you get stuck in the old virtual env unless you hit a non poetry directory first which would trigger the deactivate command.
This commit is contained in:
parent
7ed475cb58
commit
bc383878e4
1 changed files with 2 additions and 3 deletions
|
|
@ -6,11 +6,10 @@ _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
|
||||
deactivate
|
||||
fi
|
||||
|
||||
# Activate the environment if in a Poetry directory and no environment is currently active
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue