简体   繁体   English

为什么iTerm2中OSX上的emacs不能看到CS- <up> ?

[英]Why can't emacs on OSX in iTerm2 not see C-S-<up>?

I have the following keyboard shortcut in my init.el 我在init.el中有以下键盘快捷键

(global-set-key (kbd "C-S-<up>") 'move-line-up)

This works great in Cocoa Emacs.app, but when running emacs in console mode in iTerm2 it seems that they keys never make it to emacs. 这在Cocoa Emacs.app中效果很好,但是当在iTerm2中以控制台模式运行emacs时,似乎它们的密钥永远不会成为emacs。

I tried running the following in emacs 我尝试在emacs中运行以下内容

(read-key-sequence "?")

And entering CS-<up> in the prompt but it was never received. 并在提示符中输入CS-<up>但从未收到过。 That makes me think that either iTerm2 or zsh is stealing the keystrokes. 这让我觉得iTerm2或zsh正在窃取击键。 Any ideas on how to debug this? 关于如何调试这个的任何想法? Or better yet answers? 或者更好的答案?

My guess would be that it's iTerm intercepting things. 我的猜测是iTerm拦截的东西。

You might find this site helpful. 您可能会发现此网站很有帮助。 It says: 它说:

Select Profiles > Open Profiles… from the menu bar, or press Command-O and take a look at the default profile. 从菜单栏中选择“ 配置文件”>“打开配置文件... ”,或按Command-O查看默认配置文件。 Click on the Keys section. 单击Keys部分。 While you are here verify you have Left Option and Right Option as +Esc . 当你在这里验证你有左选项右选项+Esc

For the arrow key fixes though you will need to add a series of key shortcuts. 对于箭头键修复,您需要添加一系列关键快捷键。 The easiest way to get started is select Load Preset… > xterm Defaults 最简单的入门方法是选择Load Preset ...> xterm Defaults

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM