MichaelAquilina/zsh-autoswitch-virtualenv

oh-my-zsh instructions not currently working

john-sandall opened this issue · 3 comments

Issue Details

Followed oh-my-zsh instructions as given in README but utils like mkvenv were not being found on PATH. Installing by sourcing the plugin directly in .zshrc does seem to work.

Please provide the following details when opening an issue:

Operating System (uname -a)

Darwin Johns-MacBook-Pro.local 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64

zsh version (zsh --version)

zsh 5.7.1 (x86_64-apple-darwin18.2.0)

autoswitch-virtualenv version (echo "$AUTOSWITCH_VERSION")

1.10.0

How is zsh-you-should-use installed?

  • zplug
  • oh-my-zsh
  • Antigen
  • Other (please specify)

Steps to reproduce the issue

git clone "https://github.com/MichaelAquilina/zsh-autoswitch-virtualenv.git" "$ZSH_CUSTOM/plugins/autoswitch_virtualenv"

# Added this to bottom of ~/.zshrc
plugins=(autoswitch_virtualenv $plugins)

# This shows the plugin name
echo $plugins

# But mkvenv isn't found on PATH, this gives me nothing
which mkvenv

# Tried commenting out this:
plugins=(autoswitch_virtualenv $plugins)
# and adding this
source $ZSH_CUSTOM/plugins/autoswitch_virtualenv/autoswitch_virtualenv.plugin.zsh
# and everything now works as documented.

gist link to your zshrc

https://gist.github.com/john-sandall/c75fb745ff01e695b52d48b0329c5f50

After cloning the repository, does adding the line plugins=(autoswitch_virtualenv $plugins) to your .zshrc and restarting your shell work?

(oh-mh-zsh does not hot reload as far as I know)

easiest way to check is changing this line https://gist.github.com/john-sandall/c75fb745ff01e695b52d48b0329c5f50#file-zshrc-L71 to

plugins=(autoswitch_virtualenv git colorize github vagrant virtualenv pip python brew osx)

restart your shell and test :)

Yup that fixes it. It doesn't hot reload, but I was restarting my shell previously. But yes changing my line to read plugins=(autoswitch_virtualenv git colorize github vagrant virtualenv pip python brew osx) or even adding plugins=(autoswitch_virtualenv $plugins) directly below does work.

The key seems to be if you add it after source $ZSH/oh-my-zsh.sh then it won't work.

ah yes that definitely would be it. I'll update the README to make sure that is clear