3


I'm currently trying to learn org-mode in OS X.
And I found there's a keymap "M-S-RET".
But "S-RET" is not recognized in the iTerm2.
It seems like terminal interpret "S-RET" and "RET" as same.
But, iTerm2 can bind a "S-RET" in the GUI preference tab.
(PREFERENCE->PROFILE->KEY)
And I can bind "S-RET" and send hex value instead of 13.
(13 is keycode for RET)
enter image description here But I can't find what's the keycode for the "S-RET".
Actually, I think "Shift + Enter" is not exist as a keycode.
However, there must be some key combination that Emacs uses.
How can I figure it out?
Are there any files containing that information?

Thank you for reading.

1

C-c C-x M is an alternative for M-S-Ret

http://orgmode.org/manual/TTY-keys.html#TTY-keys

1

There isn't really a standard escape sequence for Shift+Return. You could say that there are two standards, but each of them is only followed by a small number of terminals:

  • libtermkey: "\e[13;2u"
  • xterm: "\e[27;2;13~"

But Emacs only activates them if it can figure out that the current terminal sends them. Since iTerm2 doesn't send them by default, Emacs doesn't activate them.

You might as well use one of these sequences. To activate them unconditionally, put the following code in your init file (this code is from terminal-init-xterm in term/xterm.el):

(load "term/xterm")
(let ((map (copy-keymap xterm-function-map)))
  (set-keymap-parent map (keymap-parent input-decode-map))
  (set-keymap-parent input-decode-map map)))

For more information and some explanation of these escape sequences, see Problems with keybindings when using terminal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.