I'm trying to execute C-M--
from Emacs on Terminal (iTerm2) running on OSX, but I keep getting an error saying C-M-_ is undefined
. Any ideas how to workaround this?
Asked
Active
Viewed 469 times
2

Gilles 'SO- stop being evil'
- 21,702
- 4
- 53
- 89

Galder Zamarreño
- 1,527
- 2
- 12
- 21
-
1Using `M--` works, but makes it a bit awkward for scrolling up on other window. Note that this is Emacs Terminal and hence `C-M-S-v` does not work. – Galder Zamarreño Jul 03 '15 at 18:11
-
possible duplicate of [Shift+Up isn't recognized by Emacs in a terminal](http://emacs.stackexchange.com/questions/977/shiftup-isnt-recognized-by-emacs-in-a-terminal) – PythonNut Aug 03 '15 at 19:59
-
@PythonNut Not a duplicate. http://emacs.stackexchange.com/questions/977/shiftup-isnt-recognized-by-emacs-in-a-terminal is definitely useful background, but an answer to this question would explain how to set up iTerm2. Hmm, I've done that before. – Gilles 'SO- stop being evil' Aug 03 '15 at 22:02
-
possible duplicate of [Problems with keybindings when using terminal](http://emacs.stackexchange.com/questions/1020/problems-with-keybindings-when-using-terminal) – Gilles 'SO- stop being evil' Aug 03 '15 at 22:03
-
@Gilles @PythonNut can you be more specific how this is a duplicate? And @Gilles, any specific ideas on how to solve this? Looking at the output of `C-h l`, I see `ESC C-_` being printed out when I execute `C-M--` – Galder Zamarreño Aug 04 '15 at 11:36
-
@GalderZamarreño So configure the iTerm2 binding for Ctrl+Meta+-. – Gilles 'SO- stop being evil' Aug 04 '15 at 12:18
1 Answers
0
I eventually got this working by going into iTerm2 preferences and adding a new global shortcut key binding where I entered as Keyboard Shortcut ^⌥-
, chose Action Send Escape Sequence
and just typed -
in the Esc+ field. That seems to do the trick.
Thanks @Gilles and @PythonNut for their help :)

Galder Zamarreño
- 1,527
- 2
- 12
- 21
-
If you're satisfied with this answer, could you please accept it so we can mark it as answered? – Dan Oct 04 '15 at 15:51