发送“C - (”到Emacs在VT100 / xterm终端(Mac OS X的终端)? [英] Send "C-(" to Emacs in VT100/xterm terminal (Mac OS X's Terminal)?

查看:214
本文介绍了发送“C - (”到Emacs在VT100 / xterm终端(Mac OS X的终端)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以以任何方式将密钥C-发送到VT100 / xterm终端(Mac OS X终端)上的Emacs?是否有可以发送的转义序列来实现等效?



我怀疑根本的问题是将控件与字符((和其他使用移位产生的其他字符)组合的概念不存在。



注意:使用Cocoa Emacs不是一个选项,需要C-(是paredit.el在其他组合中使用它的原因),而不是重映射它(因为它是有意义的在C - ()。

解决方案

VT100终端不能这样做,因为没有 ^(控制字符对应于),但xterm有所谓的modifyOtherKeys模式,它允许为这样的组合发送唯一的键码。



要启用它,请设置 modifyOtherKeys 资源,例如在〜/ .Xdefaults

  XTerm * vt100.modifyOtherKeys:1 

这样,Ctrl +(将发送以下密码:

  ^ [[27; 6; 40〜

这是相当长的时间,所以引入了这样的键码的另一种格式,可以通过设置 formatOtherKeys resource来启用:

  XTerm * vt100.formatOtherKeys:1 

这样,Ctrl +(发送:

  ^ [[40; 6u 
pre>

在这两个键码中,40是)的十进制ASCII代码,6代表



请参阅 man xterm http://invisible-island.net/xterm/ctlseqs/ctlseqs.html 了解更多详细信息。不知道Terminal.app是否支持任何。


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-(").

解决方案

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:

XTerm*vt100.modifyOtherKeys: 1

With that, Ctrl+( will send the following keycode:

^[[27;6;40~

That's rather long though, so another format for keycodes like that was introduced, which can be enabled by setting the formatOtherKeys resource:

XTerm*vt100.formatOtherKeys: 1

With that, Ctrl+( sends:

^[[40;6u

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.

这篇关于发送“C - (”到Emacs在VT100 / xterm终端(Mac OS X的终端)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆