diff --git a/templates/bash.txt b/templates/bash.txt index c7fbb35..2d8084c 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -82,7 +82,7 @@ function __zoxide_z() { else \builtin local result # shellcheck disable=SC2312 - result=$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@") && + result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" && __zoxide_cd "${result}" fi } @@ -90,7 +90,7 @@ function __zoxide_z() { # Jump to a directory using interactive search. function __zoxide_zi() { \builtin local result - result=$(\command zoxide query -i -- "$@") && __zoxide_cd "${result}" + result="$(\command zoxide query -i -- "$@")" && __zoxide_cd "${result}" } {{ section }} @@ -133,7 +133,7 @@ if [[ ${BASH_VERSINFO[0]:-0} -eq 4 && ${BASH_VERSINFO[1]:-0} -ge 4 || ${BASH_VER elif [[ -z ${COMP_WORDS[-1]} ]]; then \builtin local result # shellcheck disable=SC2312 - result=$(\command zoxide query --exclude "$(__zoxide_pwd)" -i -- "{{ "${COMP_WORDS[@]:1:${#COMP_WORDS[@]}-2}" }}") && + result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -i -- "{{ "${COMP_WORDS[@]:1:${#COMP_WORDS[@]}-2}" }}")" && COMPREPLY=${__zoxide_z_prefix}${result}/ \builtin printf '\e[5n' fi