Issue #153 resolved

completion and the `chpwd` function

Rob McBroom
created an issue

I wasn't able to use completion for workon (in zsh). I tracked it down to my chpwd hook function, which looks like this.



Set Apple resume directory

based on this answer:

function chpwd { local SEARCH=' ' local REPLACE='%20' local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}" printf '\e]7;%s\a' "$PWD_URL" echo -n "\033]0;${HOST//.*}:$USER\007" } }}}

Much like colored ls, this causes control characters to be included in the output from virtualenvwrapper_show_workon_options (because it calls cd before listing virtual envs). I was able to fix it locally by adding function chpwd {} to the virtualenvwrapper_show_workon_options function, but I'm sure there's a more elegant solution.

Thanks for this excellent tool.

Comments (4)

  1. Doug Hellmann repo owner

    Fix virtualenvwrapper_show_workon_options under zsh with chpwd

    Fixes issue #153

    Re-implement virtualenvwrapper_show_workon_options to work for zsh users with chpwd hook functions that emit output.

    Wiki macro error: Changeset 3c1088e73372 not found.

  2. Log in to comment