macos – 为什么iTerm2中OSX上的emacs不能看到C-S-?

我在init.el中有以下键盘快捷键

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

这在Cocoa Emacs.app中效果很好,但是当在iTerm2中以控制台模式运行emacs时,似乎它们的密钥永远不会成为emacs.

我尝试在emacs中运行以下内容

(read-key-sequence "?")

并且进入C-S-< up>在提示中但它从未收到过.这让我觉得iTerm2或zsh正在窃取击键.关于如何调试这个的任何想法?或者更好的答案?

我的猜测是iTerm拦截的东西.

您可能会发现this site有用.它说:

Select Profiles > Open Profiles… from the menu bar, or press Command-O and take a look at the default profile. Click on the Keys section. While you are here verify you have Left Option and Right Option as +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

相关文章