984c9d91628715ab814d1455b02022111fedf02f

Author
Jongwook Choi <wookayin@gmail.com>
Committer
Jongwook Choi <wookayin@gmail.com>
Date

Message

Detect and activate virtualenv on sourcing the plugin

Previously, virtualenv was not being activated on zsh startup (e.g.
opening a new tmux pane with initial working directory with .venv).

Now the virtualenv will be automatically activated on zsh startup.

Diff

 1diff --git a/autoswitch_virtualenv.plugin.zsh b/autoswitch_virtualenv.plugin.zsh
 2index 47c4fd33c27ac11dcdcac84063f176498f9766db..adef243af1e15e4f0ff4c2a24a57ef9364a63475 100644
 3--- a/autoswitch_virtualenv.plugin.zsh
 4+++ b/autoswitch_virtualenv.plugin.zsh
 5@@ -131,3 +131,6 @@ function mkvenv()
 6 autoload -Uz add-zsh-hook
 7 add-zsh-hook -D chpwd check_venv
 8 add-zsh-hook chpwd check_venv
 9+
10+# auto-detect virtualenv on zsh startup
11+[[ -o interactive ]] && check_venv