Issues

Issue #86 resolved

lsvirtualenv doesn't read args properly

Nat Williams
created an issue

Using zsh (4.3.9), workon prints out the list of envs very slowly, taking 10s to show a list of ~50 in my case.

What's happening is that lsvirtualenv is ignoring any arguments passed to it (-b in the case of workon).

Consider the following snippets, first in Bash: {{{ [mac ~]$ foo=(-b) [mac ~]$ typeset args="$(getopt blh "$foo")" [mac ~]$ for i in $args; do echo $i; done -b -- [mac ~]$ }}}

This is as desired. Lsvirtualenv can then iterate over $args and do its thing.

In zsh, though, we get this: {{{ [mac ~]% foo=(-b)
[mac ~]% typeset args="$(getopt blh "$foo")" [mac ~]% for i in $args; do; echo $i; done; -b -- [mac ~]% }}}

Thus, none of the parameters are matched, and lsvirtualenv thinks it's in "long_mode"

I made a change [[https://bitbucket.org/natw/virtualenvwrapper/changeset/49bde9a9d12f|here]] that appears to fix this problem, as far as I can tell. Shell programming kind of breaks my brain, so I can't say my fix doesn't cause some kind of other horribly subtle problem, but it does appear to work in zsh and bash.

Comments (3)

  1. Log in to comment