如何在Konsole中禁用`Alt sends Escape`?

huangapple go评论54阅读模式
英文:

How to disable `Alt sends Escape` in Konsole?

问题

I am using copilot.lua in which <M-[> and <M-]> are mapped to prev and next. In Linux, M is Alt.

However, when I type <M-]> in insert mode, it will be mapped to Esc (in normal mode), and then ]. So it seems that Alt sends Escape in konsole. How can I disable such mapping?

I also checked the keyboard settings in the current profile, but none of them is related with it:

如何在Konsole中禁用`Alt sends Escape`?

英文:

I am using copilot.lua in which &lt;M-[&gt; and &lt;M-]&gt; are mapped to prev and next. In Linux, M is Alt.

However, when I type &lt;M-]&gt; in insert mode, it will be mapped to Esc (in normal mode), and then ]. So it seems that Alt sends Escape in konsole. How can I disable such mapping?

I also checked the keyboard settings in the current profile, but none of them is related with it:

如何在Konsole中禁用`Alt sends Escape`?

答案1

得分: 1

以下是翻译好的部分:

你不能在Konsole中更改它 - alt 键应该发送 escape,而vim将escape解释为alt/meta键。要么vim在你的终端上被错误配置了,要么你认为已经安装的映射并没有安装。

要解决第一个问题,请进入插入模式,然后按Ctrl+V+Alt+]. 如果插入了<M-]>,那么一切都被正确配置。如果你离开插入模式,那么可能你的$TERM设置不正确,你的terminfo数据库有问题,或者你正在覆盖一些重要的vim设置。

要解决第二个问题,运行:imap并验证是否实际出现了<M-]>映射。如果没有,那么开始检查你的copilot.lua配置。

英文:

You can't change it in Konsole — alt is supposed to send escape, and vim understands escape to mean alt/meta. Either vim is somehow being configured improperly for your terminal, or the mapping that you think is installed isn't.

To debug the first one, go into insert mode and then press <kbd>Ctrl</kbd>+<kbd>V</kbd> <kbd>Alt</kbd>+<kbd>]</kbd>. If &lt;M-]&gt; is inserted then everything is configured correctly. If you leave insert mode instead, then perhaps your $TERM is set incorrectly, there is a problem with your terminfo database, or you're overriding some crucial vim setting.

To debug the second one, run :imap and verify that a &lt;M-]&gt; mapping actually appears there. If not, then start digging into your copilot.lua config.

huangapple
  • 本文由 发表于 2023年4月11日 12:53:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/75982504.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定