0

Have you met the case that Emacs in iterm2 on Mac does not recognize M-S-RET (Meta(Option)+Shift+ Return key)? I guess it's related to the modifier key conversions in terminals.

M-S-RET is used in org-mode

I tried describe-key in Emacs and got M-[1 3; 4 I think M stands for meta, 13 is the ASCII code of return, 4 is the CSI u code for Shift+Alt see http://www.leonerd.org.uk/hacks/fixterms/

Stefan
  • 26,154
  • 3
  • 46
  • 84
jing chen
  • 1
  • 2
  • You might want to clarify what what `describe-key` says, because the spacing in your `M-[1 3; 4` looks wrong. Also to see the full sequence of chars received by Emacs when you press `M-S-RET` `view-lossage` (aka `C-h l`) is a better choice (`describe-key` will try to guess when the sequence ends and that guess is not always the one you need). – Stefan Mar 17 '20 at 12:24
  • When testing in iTerm2, I've set up the left option key (Mac) to be Esc+, and report modifier CSI u key. In Option set sa Normal, M-S-RET is always equal to M-RET in terminal. I've tried to Use `C-h l`, it says `;` – jing chen Mar 31 '20 at 01:54
  • I've tried to Use `C-h l`, it says `ESC [ 1 3 ; 4 [nil]` – jing chen Mar 31 '20 at 02:01
  • What happens if you put `(define-key input-decode-map (kbd "ESC [ 1 3 ; 4") (kbd "S-RET"))` – Stefan Mar 31 '20 at 02:52
  • Thank you very much! It works. – jing chen Mar 31 '20 at 03:26
  • ``` (define-key input-decode-map (kbd "ESC [ 1 3 ; 4 u") (kbd "M-S-RET")) ``` When the key-sequence is not set, "ESC [ 1 3 ; 4 u" are splited into an unknow "ESC [ 1 3 ; 4" and an extra "u" command. – jing chen Mar 31 '20 at 03:28

0 Answers0