Refactor async mode to no longer use zpty
See technique used in `fast-syntax-highlighting`:
- ca2e18bbc9
- http://www.zsh.org/mla/users/2018/msg00424.html
Also see http://www.zsh.org/mla/users/2018/msg00432.html
In async response handler:
- We only want to read data in case of POLLIN or POLLHUP. Not POLLNVAL
or select error.
- We always want to remove the handler, so it doesn't get called in an
infinite loop when error is nval or err.
There is an upstream bug that prevents ctrl-c from resetting the prompt
immediately after a suggestion has been fetched asynchronously. A patch
has been submitted, but a workaround for now is to add `command true`
after the exec.
See https://github.com/zsh-users/zsh-autosuggestions/issues/364
This commit is contained in:
@@ -89,7 +89,3 @@ typeset -g ZSH_AUTOSUGGEST_ORIGINAL_WIDGET_PREFIX=autosuggest-orig-
|
||||
# Max size of buffer to trigger autosuggestion. Leave null for no upper bound.
|
||||
(( ! ${+ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE} )) &&
|
||||
typeset -g ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=
|
||||
|
||||
# Pty name for calculating autosuggestions asynchronously
|
||||
(( ! ${+ZSH_AUTOSUGGEST_ASYNC_PTY_NAME} )) &&
|
||||
typeset -g ZSH_AUTOSUGGEST_ASYNC_PTY_NAME=zsh_autosuggest_pty
|
||||
|
||||
Reference in New Issue
Block a user