From 4cd210b70d20e24946d68a4957cb4a90ff97cc44 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Wed, 10 Apr 2019 09:51:33 -0600 Subject: [PATCH] Fix async suggestions when SH_WORD_SPLIT is set --- src/async.zsh | 2 ++ zsh-autosuggestions.zsh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/async.zsh b/src/async.zsh index eab188f..b038cb0 100644 --- a/src/async.zsh +++ b/src/async.zsh @@ -54,6 +54,8 @@ _zsh_autosuggest_async_request() { # First arg will be fd ready for reading # Second arg will be passed in case of error _zsh_autosuggest_async_response() { + emulate -L zsh + if [[ -z "$2" || "$2" == "hup" ]]; then # Read everything from the fd and give it as a suggestion zle autosuggest-suggest -- "$(cat <&$1)" diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 2f52f81..e7e14a1 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -653,6 +653,8 @@ _zsh_autosuggest_async_request() { # First arg will be fd ready for reading # Second arg will be passed in case of error _zsh_autosuggest_async_response() { + emulate -L zsh + if [[ -z "$2" || "$2" == "hup" ]]; then # Read everything from the fd and give it as a suggestion zle autosuggest-suggest -- "$(cat <&$1)"