简体   繁体   中英

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

I have the following keyboard shortcut in my 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.

I tried running the following in emacs

(read-key-sequence "?")

And entering CS-<up> in the prompt but it was never received. That makes me think that either iTerm2 or zsh is stealing the keystrokes. Any ideas on how to debug this? Or better yet answers?

My guess would be that it's iTerm intercepting things.

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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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