llm icon indicating copy to clipboard operation
llm copied to clipboard

backslash cannot be used in `llm chat`

Open grota opened this issue 1 year ago • 2 comments

Hopefully this is not something stupid on my part, but I cannot seem to be able to use the backslash \ in llm chat (not in single nor in multiline mode). Both typing interactively and pasting text have this problem; in the latter case the backslash is simply taken out.

As you can imagine this is problematic when pasting code.

The workaround is to use a literal Ctrl-v before \ then it appears, but when the prompt is long, with snippets of code, I have to open a scratch buffer in the editor and prefix each backslash with a literal Ctrl-v char which is error prone and something that in principle should not be asked to the user (in neovim you can type ctrl-v twice in insert mode).

llm prompt does not seem to have this problem.

grota avatar Jun 18 '24 15:06 grota

I figured out that the problem was the 2 readline statements for the arrow keys. I created a PR #560 with an explicit bind for the backslash

grota avatar Aug 27 '24 15:08 grota

Also removing the existing 2 mappings works, see related #495

grota avatar Aug 27 '24 15:08 grota

closing, this issue is solved with a recent version of click

grota avatar Aug 10 '25 19:08 grota