Fix async suggestions when SH_WORD_SPLIT is set

This commit is contained in:
Eric Freese 2019-04-10 09:51:33 -06:00
parent 586b51366b
commit 4cd210b70d
2 changed files with 4 additions and 0 deletions

View file

@ -54,6 +54,8 @@ _zsh_autosuggest_async_request() {
# First arg will be fd ready for reading # First arg will be fd ready for reading
# Second arg will be passed in case of error # Second arg will be passed in case of error
_zsh_autosuggest_async_response() { _zsh_autosuggest_async_response() {
emulate -L zsh
if [[ -z "$2" || "$2" == "hup" ]]; then if [[ -z "$2" || "$2" == "hup" ]]; then
# Read everything from the fd and give it as a suggestion # Read everything from the fd and give it as a suggestion
zle autosuggest-suggest -- "$(cat <&$1)" zle autosuggest-suggest -- "$(cat <&$1)"

View file

@ -653,6 +653,8 @@ _zsh_autosuggest_async_request() {
# First arg will be fd ready for reading # First arg will be fd ready for reading
# Second arg will be passed in case of error # Second arg will be passed in case of error
_zsh_autosuggest_async_response() { _zsh_autosuggest_async_response() {
emulate -L zsh
if [[ -z "$2" || "$2" == "hup" ]]; then if [[ -z "$2" || "$2" == "hup" ]]; then
# Read everything from the fd and give it as a suggestion # Read everything from the fd and give it as a suggestion
zle autosuggest-suggest -- "$(cat <&$1)" zle autosuggest-suggest -- "$(cat <&$1)"