mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2026-06-16 11:36:14 +08:00
clear postdisplay fix
This commit is contained in:
parent
85919cd1ff
commit
ca5d566c84
@ -21,6 +21,12 @@ _zsh_autosuggest_start() {
|
||||
# Mark for auto-loading the functions that we use
|
||||
autoload -Uz add-zsh-hook is-at-least
|
||||
|
||||
# Hook that runs when line editing finishes (right before command execution)
|
||||
_zsh_autosuggest_line_finish() {
|
||||
# Clear POSTDISPLAY to prevent it from appearing in terminal
|
||||
POSTDISPLAY=
|
||||
}
|
||||
|
||||
# Automatically enable asynchronous mode in newer versions of zsh. Disable for
|
||||
# older versions because there is a bug when using async mode where ^C does not
|
||||
# work immediately after fetching a suggestion.
|
||||
@ -29,5 +35,8 @@ if is-at-least 5.0.8; then
|
||||
typeset -g ZSH_AUTOSUGGEST_USE_ASYNC=
|
||||
fi
|
||||
|
||||
# Register the line finish hook
|
||||
zle -N zle-line-finish _zsh_autosuggest_line_finish
|
||||
|
||||
# Start the autosuggestion widgets on the next precmd
|
||||
add-zsh-hook precmd _zsh_autosuggest_start
|
||||
|
||||
@ -855,6 +855,12 @@ _zsh_autosuggest_start() {
|
||||
# Mark for auto-loading the functions that we use
|
||||
autoload -Uz add-zsh-hook is-at-least
|
||||
|
||||
# Hook that runs when line editing finishes (right before command execution)
|
||||
_zsh_autosuggest_line_finish() {
|
||||
# Clear POSTDISPLAY to prevent it from appearing in terminal
|
||||
POSTDISPLAY=
|
||||
}
|
||||
|
||||
# Automatically enable asynchronous mode in newer versions of zsh. Disable for
|
||||
# older versions because there is a bug when using async mode where ^C does not
|
||||
# work immediately after fetching a suggestion.
|
||||
@ -863,5 +869,8 @@ if is-at-least 5.0.8; then
|
||||
typeset -g ZSH_AUTOSUGGEST_USE_ASYNC=
|
||||
fi
|
||||
|
||||
# Register the line finish hook
|
||||
zle -N zle-line-finish _zsh_autosuggest_line_finish
|
||||
|
||||
# Start the autosuggestion widgets on the next precmd
|
||||
add-zsh-hook precmd _zsh_autosuggest_start
|
||||
|
||||
Loading…
Reference in New Issue
Block a user