Issue #215 resolved

workon launched from zsh enters in an infinite recursion

Jan Dittberner
created an issue

I got the following bug report for the Debian package of virtualenvwrapper:

  • Package: virtualenvwrapper
  • Version: 4.1.1-1
  • Severity: grave
  • Justification: renders package unusable

Dear Maintainer,

After switching to virtualenvwrapper_lazy instead of the 'normal' virtualenvwrapper file in my ~/.zshrc I noticed a speed up when opening a new terminal but as soon as I tried to use "workon env" the terminal hang CTRL-C or Z it did not kill anything.

After having added some debugging echo in the virtualenvwrapper_lazy script I noticed that it enters into what seems to me and infinite recursion.

My zsh version is 5.0.2.

Thank you.

Versions of packages virtualenvwrapper depends on:

  • ii libjs-sphinxdoc 1.1.3+dfsg-8
  • ii python 2.7.5-5
  • ii python-stevedore 0.10-2
  • ii python-virtualenv 1.10.1-1
  • ii virtualenv-clone 0.2.4-1

Versions of packages virtualenvwrapper recommends: * ii bash-completion 1:2.1-2

Comments (6)

  1. Daniel Hahler

    I remember having the same problem (Ubuntu/Debian).

    This is caused by the shell completion (setup): it sets up "virtualenvwrapper_load" for all commands via:

    compctl -K virtualenvwrapper_load $(echo ${_VIRTUALENVWRAPPER_API})

    But then the load function (which just does source "$VIRTUALENVWRAPPER_SCRIPT") does not setup the real completion for all commands and/or it is problematic for zsh in general to replace the completion function from the original completion itself.

    I remember it having hung, crashed or just misbehave. IIRC I upgraded Zsh back then, which made it less crashy, but eventually I gave up and just commented the hack, which adds completion to the lazy-loading wrapper function.

    For reference, this is the Debian bug report:

  2. Daniel Hahler

    Here is some more info from my questions in #zsh about this:

    • zsh is crashing, if "compctl -K" gets recursive.
    • You can reset a completion using "compctl + foo", but that does not appear to work from inside the function (which is called via compctl itself).
    • I think the best fix appears to make sure that the main script only gets sourced once, and not touch the compctl definitions that do not get setup.
  3. Log in to comment