loiccoyle / zsh-github-copilot

🧠 GitHub Copilot for your command line
MIT License
56 stars 5 forks source link

Works only once #6

Closed akaihola closed 4 months ago

akaihola commented 4 months ago

On my system, zsh-github-copilot does run when I type one of the assigned key bindings, but it works correctly only the first time I use it. On subsequent invocations, I get:

$ show directory listing<Alt-\>_gh_copilot_spinner:3: file exists: /tmp/zsh_gh_copilot_result

I think this is because ZSH redirection by default refuses to overwrite a file:

$ echo foo >bar
$ echo foo >bar
zsh: file exists: bar

This can be overridden e.g. using >| instead:

$ echo foo >bar
$ echo baz >|bar
$ cat bar
baz