Issue #216 resolved

lsvirtualenv and workon output broken in zsh (5+?)

Johann Visagie
created an issue

I have the following virtualenvs in my ~/.virtualenvs: "2.7.5", "2.7.6", "3.3.2", "aws".

Invoking lsvirtualenv fails to list "2.7.5". lsvirtualenv -b or workon (without any parameters) gives an even stranger output:


The problem seems to be introduced by the invocation of fmt on line 538 of (f0f0077).

For some reason that I cannot find documented anywhere, zsh returns the working directory of a subshell as a file:// URL on STDOUT, wrapped in control characters. This is easily verified:

(cd /) | cat -v

That fmt makes the URL visible, and screws up the output.

As I said, I cannot find this feature of zsh documented anywhere. It may or may not have been introduced recently. It may or may not be under the control of some zsh configuration knob.

There is at least one other user on StackOverflow who has also run into this issue, so it's not just me.

Comments (4)

  1. Johann Visagie reporter

    I didn't do my due diligence on this beforehand.

    It turns out that a blank zsh configuration is unaffected by this issue. Hence, the problem was obviously something in my zsh configuration.

    It turned out, after some digging, that the problem lay in a by-now ancient (and widely publicised) method of setting the proxy icon in the title bar of the Mac OS X Terminal application to that of the current directory. I'd first encountered this method here:

    It's possible that this little trick has been taken up verbatim in zsh configuration bundles like oh-my-zsh, hence the fact that even seemingly inexperienced users on StackOverflow have come across this issue.

    (The problem may be resolved by adding the function to the "precmd" hook instead of "chpwd", in the above-linked hint on MacOSXHints.)

    Apologies for wasting everyone's time.

  2. Log in to comment