6493ff2871aec8ea3ce7170d7ac22a2b36acd954
- Author
- Michael Aquilina <michaelaquilina@gmail.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
Merge pull request #25 from wookayin/fix/startup
Detect and activate virtualenv on sourcing the plugin
Diff
1diff --git a/autoswitch_virtualenv.plugin.zsh b/autoswitch_virtualenv.plugin.zsh
2index fef44db4baea93f248ba96b783457c6c4139d0a7..7f7a1e4f41cc7760565665394bcaad3483506ef2 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