向 VT100/xterm 终端(Mac OS X 终端)中的 Emacs 发送“C-(”?
是否可以以任何方式通过 VT100/xterm 终端(Mac OS X 终端)将键“C-(”发送到 Emacs?是否有可以发送的转义序列来实现等效操作?
我怀疑根本问题是不存在将控制与字符“(”(以及使用 Shift 生成的其他此类字符)相结合的概念。
注意:使用 Cocoa Emacs 不是一个选项。需要“C-(”的原因是 paredit .el 在其他组合键中使用它,最好不要重新映射它(因为将它放在“C-(”)上是有意义的。
Is it possible in any way to send the key "C-(" to Emacs over a VT100/xterm terminal (Mac OS X Terminal)? Is there an escape sequence that could be sent to achieve the equivalent?
I suspect the fundamental problem is that the concept of combining control with the character "(" (and other such characters that are produced using shift) does not exist.
Note: Using Cocoa Emacs is not an option. And the reason for needing "C-(" is that paredit.el uses it amongst other key combinations, and it would be preferable to not remap it (because it makes sense to have it on "C-(").
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
VT100 终端无法做到这一点,因为没有与
(
对应的^(
控制字符。但是,xterm 有所谓的“modifyOtherKeys”模式,它可以允许发送类似的组合的唯一键码要启用它,请设置
modifyOtherKeys
资源,例如在~/.Xdefaults
中:这样,Ctrl+( 将发送以下键码:
虽然相当长,所以引入了另一种类似的键码格式,可以通过设置
formatOtherKeys
资源来启用:这样,Ctrl+( 发送:
在这两个键码中,40 是
(
的十进制 ASCII 代码,6 代表 Ctrl。请参阅
man xterm
和 http://invisible-island.net/xterm/ctlseqs/ctlseqs.html 了解更多详细信息。不知道 Terminal.app 是否支持其中任何一个。A VT100 terminal couldn't do that, because there is no
^(
control character corresponding to(
. However, xterm has the so-called "modifyOtherKeys" mode, which does allow to send unique keycodes for combinations like that.To enable it, set the
modifyOtherKeys
resource, e.g. in~/.Xdefaults
:With that, Ctrl+( will send the following keycode:
That's rather long though, so another format for keycodes like that was introduced, which can be enabled by setting the
formatOtherKeys
resource:With that, Ctrl+( sends:
In both of these keycodes, the 40 is the decimal ASCII code for
(
, and the 6 represents the Ctrl.See
man xterm
and http://invisible-island.net/xterm/ctlseqs/ctlseqs.html for further details. No idea whether Terminal.app supports any of it.