MichaelAquilina/zsh-autoswitch-virtualenv

Slow shell after autoswitch

vhristev opened this issue · 2 comments

Issue Details

When i use autoswitch in poetry project i get super slow shell just hitting enter i can see the delay. The fun part is that if i create new poetry init project i don't see the problem. If i create new mkvenv env in some test folder slowness is not there.

It seems the slowness is with already created projects with poetry but i cannot identify the root cause.

Operating System (uname -a)

uname -a
Darwin vhristev-g1r5-1226.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

zsh version (zsh --version)

zsh --version
zsh 5.8 (x86_64-apple-darwin20.1.0)

autoswitch-virtualenv version

echo "$AUTOSWITCH_VERSION"
3.3.0

How is zsh-autoswitch-virtualenv installed?

  • oh-my-zsh

Steps to reproduce the issue

Create virtual env with 'mkvenv' enter the dir

Shell debug with export PYENV_DEBUG=1 set -x

Entire debug is 3500+ lines ,so i snip where i see the slowness which is right after +_activate_poetry:3> cut '-d ' -f1

+_activate_poetry:3> poetry env list --full-path
+_activate_poetry:3> sort -k 2
+_activate_poetry:3> tail -n 1
+_activate_poetry:3> cut '-d ' -f1
+_activate_poetry:3> local name=/Users/vhristev/Documents/CB/CB-gitlab/obseye/.venv
+_activate_poetry:4> [[ -n /Users/vhristev/Documents/CB/CB-gitlab/obseye/.venv ]]
+_activate_poetry:5> _maybeworkon /Users/vhristev/Documents/CB/CB-gitlab/obseye/.venv poetry

Debug zsh

@vhristev please update and check if the latest changes fix this issue :)

I can confirm that after the update everything works as charm thank you very much @MichaelAquilina