抛砖引玉: 介绍命令行AI编程工具aider以及emacs集成aider.el

多行输入应该使用 bracketed-paste。这个是 terminal app 的标准做法。

bracket-paste 是标准的终端 app 用来区分一段文本到底是用户粘贴的,还是用户直接输入的的两段不同的 control sequence。

vterm 原生自带对 bracketd-paste 的支持,如果不用 vterm,其实也很简单,就是在向终端发送的string 的开头和结尾添加两个 string 就行了。

以下引用 wikipedia

Each implementation uses the control sequences documented in xterm’s control sequences:

  • ESC [ 200 ~ to signify the beginning of pasted text and
  • ESC [ 201 ~ to signify the end.

因此这个问题的解决方案,非常简单。你在每次发动给 aider 的 string 开头和结尾加上这两个 control sequence 问题就解决了。