diff --git a/CHANGELOG.md b/CHANGELOG.md index cb37717..288512e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bash/Fish/Posix/Zsh: paths on Cygwin. - Fish: completions not working on certain systems. +- Bash: completions not escaping spaces correctly. ## [0.8.1] - 2021-04-23 diff --git a/templates/bash.txt b/templates/bash.txt index b3697f9..175f5ba 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -134,12 +134,12 @@ if [[ ${BASH_VERSINFO[0]:-0} -eq 4 && ${BASH_VERSINFO[1]:-0} -ge 4 || ${BASH_VER \builtin local result # shellcheck disable=SC2312 result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -i -- "{{ "${COMP_WORDS[@]:1:${#COMP_WORDS[@]}-2}" }}")" && - COMPREPLY=("${__zoxide_z_prefix}${result@Q}") + COMPREPLY=("${__zoxide_z_prefix}${result}/") \builtin printf '\e[5n' fi } - \builtin complete -F __zoxide_z_complete -o nospace -- {{cmd}} + \builtin complete -F __zoxide_z_complete -o filenames -- {{cmd}} \builtin complete -r {{cmd}}i &>/dev/null || \builtin true fi