diff --git a/src/async.zsh b/src/async.zsh index 0e29a3f..18dbb9d 100644 --- a/src/async.zsh +++ b/src/async.zsh @@ -12,6 +12,9 @@ _zsh_autosuggest_async_fetch_suggestion() { _zsh_autosuggest_async_suggestion_server() { emulate -R zsh + # Output only newlines (not carriage return + newline) + stty -onlcr + while IFS='' read -r -d $'\0' prefix; do # Kill last bg process kill -KILL %1 &>/dev/null diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index ff3f0ac..449e08d 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -489,6 +489,9 @@ _zsh_autosuggest_async_fetch_suggestion() { _zsh_autosuggest_async_suggestion_server() { emulate -R zsh + # Output only newlines (not carriage return + newline) + stty -onlcr + while IFS='' read -r -d $'\0' prefix; do # Kill last bg process kill -KILL %1 &>/dev/null