Skip to content

Commit

Permalink
Fix async suggestions when SH_WORD_SPLIT is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfreese committed Apr 10, 2019
1 parent 586b513 commit 4cd210b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/async.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
2 changes: 2 additions & 0 deletions zsh-autosuggestions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit 4cd210b

Please sign in to comment.