英文:
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:
英文:
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:
答案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 <M-]>
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 <M-]>
mapping actually appears there. If not, then start digging into your copilot.lua config.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论