From 70a98660fbfc44b00433eefcaa8a0986ad0452c2 Mon Sep 17 00:00:00 2001 From: Kieran Klukas Date: Thu, 11 Jun 2026 03:38:56 +0000 Subject: [PATCH] feat: proeprly work with autosuggestions --- impure.zsh | 7 ++++++- 1 file(s) changed, 6 insertion(s)(+), 1 deletion(s)(-) diff --git a/impure.zsh b/impure.zsh --- a/impure.zsh +++ b/impure.zsh @@ -318,6 +318,7 @@ if zle; then local saved_prompt=$PROMPT saved_rprompt=$RPROMPT PROMPT="%F{$prompt_impure_colors[prompt:success]}${IMPURE_PROMPT_SYMBOL:-❯}%f " RPROMPT= + unset POSTDISPLAY 2>/dev/null zle .reset-prompt && zle -R PROMPT=$saved_prompt RPROMPT=$saved_rprompt @@ -1189,7 +1190,9 @@ prompt_impure_accept_line() { # Only set the transient flag for complete lines. In continuation mode # ($CONTEXT == cont, e.g. unclosed quote), don't go transient. [[ $CONTEXT != cont ]] && typeset -g prompt_impure_transient=1 - zle .accept-line + # Call accept-line (not .accept-line) to chain through any wrappers + # installed by zsh-autosuggestions or other plugins. + zle accept-line } prompt_impure_clear_screen() { @@ -1214,6 +1217,8 @@ typeset -g prompt_impure_saved_prompt="$PROMPT" typeset -g prompt_impure_saved_rprompt="$RPROMPT" PROMPT="%F{${prompt_color}}${IMPURE_PROMPT_SYMBOL:-❯}%f " RPROMPT= + # Clear any leftover autosuggestion display state. + unset POSTDISPLAY 2>/dev/null zle && zle .reset-prompt && zle -R } -- tangled.sh