Escape spaces correctly in Bash completions
This commit is contained in:
parent
c7400cf0ed
commit
162956990a
|
|
@ -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.
|
- Bash/Fish/Posix/Zsh: paths on Cygwin.
|
||||||
- Fish: completions not working on certain systems.
|
- Fish: completions not working on certain systems.
|
||||||
|
- Bash: completions not escaping spaces correctly.
|
||||||
|
|
||||||
## [0.8.1] - 2021-04-23
|
## [0.8.1] - 2021-04-23
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,12 +134,12 @@ if [[ ${BASH_VERSINFO[0]:-0} -eq 4 && ${BASH_VERSINFO[1]:-0} -ge 4 || ${BASH_VER
|
||||||
\builtin local result
|
\builtin local result
|
||||||
# shellcheck disable=SC2312
|
# 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@Q}")
|
COMPREPLY=("${__zoxide_z_prefix}${result}/")
|
||||||
\builtin printf '\e[5n'
|
\builtin printf '\e[5n'
|
||||||
fi
|
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
|
\builtin complete -r {{cmd}}i &>/dev/null || \builtin true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue