diff --git a/src/shell.rs b/src/shell.rs index f3d5edd..38f0388 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -74,7 +74,7 @@ mod tests { ) { let opts = Opts { cmd, hook, echo, resolve_symlinks }; let source = Bash(&opts).render().unwrap(); - assert!(source.contains("[[ -n \"${__zoxide_result}\" ]] || return")); + assert!(source.contains("[[ -n ${__zoxide_result} ]] || return")); } #[apply(opts)] diff --git a/templates/bash.txt b/templates/bash.txt index 6b82949..ef1ff87 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -179,7 +179,7 @@ if [[ ${BASH_VERSINFO[0]:-0} -eq 4 && ${BASH_VERSINFO[1]:-0} -ge 4 || ${BASH_VER elif [[ -z ${COMP_WORDS[-1]} ]]; then # shellcheck disable=SC2312 __zoxide_result="$(\command zoxide query --exclude "$(__zoxide_pwd)" --interactive -- "{{ "${COMP_WORDS[@]:1:${#COMP_WORDS[@]}-2}" }}")" || return - [[ -n "${__zoxide_result}" ]] || return + [[ -n ${__zoxide_result} ]] || return # In case the terminal does not respond to \e[5n or another # mechanism steals the response, it is still worth completing