Skip to content

Command line not reliably cleared when a full command is returned #12

@sonnyka

Description

@sonnyka

Just came across your project and want to say thank you for this good work! I integrated it into my zsh and love it already. Thank you so much!

I found a small issue: My command prompt buffer is not reliably cleared when AI returns a full command ("=" prefix).

So I suggest a small patch which makes that part more reliable:

index 867f60a..ee72917 100644
--- a/zsh-copilot.plugin.zsh
+++ b/zsh-copilot.plugin.zsh
@@ -230,6 +230,7 @@ function _suggest_ai() {
         # Reset user input
         BUFFER=""
         CURSOR=0
+        zle reset-prompt
 
         zle -U "$suggestion"
     elif [[ "$first_char" == '+' ]]; then`

zle-reset-prompt makes sure to redraw the current command buffer immediately.
It is so small I decided against a formal pull request.

Thank you again!
Andreas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions