From cf8bb2983c93b2b953e4ed8221790a48bb37cd3d Mon Sep 17 00:00:00 2001 From: Dominique Barton Date: Tue, 18 Aug 2015 08:40:19 +0200 Subject: [PATCH] bugfix for issue #4255, where cd can get stuck if virtualenvwrapper plugin is used in combination with WORKON_HOME and a trailing slash --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 6cd30732..fbf88be9 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -63,7 +63,7 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then fi if [[ "$ENV_NAME" != "" ]]; then # Activate the environment only if it is not already active - if [[ "$VIRTUAL_ENV" != "$WORKON_HOME/$ENV_NAME" ]]; then + if [[ "$VIRTUAL_ENV" != "${WORKON_HOME%/}/$ENV_NAME" ]]; then if [[ -e "$WORKON_HOME/$ENV_NAME/bin/activate" ]]; then workon "$ENV_NAME" && export CD_VIRTUAL_ENV="$ENV_NAME" elif [[ -e "$ENV_NAME/bin/activate" ]]; then