From d12378fc15117e392ac1acbbae759d820bf74123 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 24 Sep 2014 12:35:17 -0400 Subject: [PATCH] Fix no jump when query begins with - in Zsh Without this commit, the following command prints the path found by autojump, but doesn't actually jump because the Zsh script assumes we're passing an option to j(): j -- -tools The -- is needed; otherwise `-tools` would be interpreted as a (bad) autojump option. --- bin/autojump.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autojump.zsh b/bin/autojump.zsh index 09d78fb..187e142 100644 --- a/bin/autojump.zsh +++ b/bin/autojump.zsh @@ -42,7 +42,7 @@ chpwd_functions+=autojump_chpwd # default autojump command j() { - if [[ ${@} == -* ]]; then + if [[ ${@} == -* && ! (${#} -eq 2 && ${1} == '--') ]]; then autojump ${@} return fi