diff --git a/plugins/last-working-dir/last-working-dir.plugin.zsh b/plugins/last-working-dir/last-working-dir.plugin.zsh index e882b288f..1586e67e5 100644 --- a/plugins/last-working-dir/last-working-dir.plugin.zsh +++ b/plugins/last-working-dir/last-working-dir.plugin.zsh @@ -16,8 +16,8 @@ lwd() { # Jump to last directory automatically unless: # - this isn't the first time the plugin is loaded -# - it's not in $HOME directory +# - it's in $HOME directory [[ -n "$ZSH_LAST_WORKING_DIRECTORY" ]] && return -[[ "$PWD" != "$HOME" ]] && return +[[ "$PWD" == "$HOME" ]] && return lwd 2>/dev/null && ZSH_LAST_WORKING_DIRECTORY=1 || true