diff options
| author | Marc Cornellà <marc@mcornella.com> | 2024-11-19 21:05:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-19 21:05:34 +0100 |
| commit | 2e8d2d74014f366461d36712840ea59e8f734df3 (patch) | |
| tree | 99645d233d20d9b3e52cc4b1f09640a750915372 | |
| parent | 9ad764d80c3b0cca1fb3251cb9c14e25543d5a42 (diff) | |
| download | zsh-2e8d2d74014f366461d36712840ea59e8f734df3.tar.gz zsh-2e8d2d74014f366461d36712840ea59e8f734df3.tar.bz2 zsh-2e8d2d74014f366461d36712840ea59e8f734df3.zip | |
fix(pipenv): fix auto-shell functionality when cd-ing out (#12813)
Co-authored-by: Jean-Tiare Le Bigot <jt@yadutaf.fr>
| -rw-r--r-- | plugins/pipenv/pipenv.plugin.zsh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/pipenv/pipenv.plugin.zsh b/plugins/pipenv/pipenv.plugin.zsh index f81c266a4..76d66b301 100644 --- a/plugins/pipenv/pipenv.plugin.zsh +++ b/plugins/pipenv/pipenv.plugin.zsh @@ -19,7 +19,8 @@ if zstyle -T ':omz:plugins:pipenv' auto-shell; then if [[ ! -f "$PWD/Pipfile" ]]; then if [[ "$PIPENV_ACTIVE" == 1 ]]; then if [[ "$PWD" != "$pipfile_dir"* ]]; then - exit + unset PIPENV_ACTIVE pipfile_dir + deactivate fi fi fi @@ -28,7 +29,8 @@ if zstyle -T ':omz:plugins:pipenv' auto-shell; then if [[ "$PIPENV_ACTIVE" != 1 ]]; then if [[ -f "$PWD/Pipfile" ]]; then export pipfile_dir="$PWD" - pipenv shell + source "$(pipenv --venv)/bin/activate" + export PIPENV_ACTIVE=1 fi fi } |
