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/
describe-keysays, because the spacing in yourM-[1 3; 4looks wrong. Also to see the full sequence of chars received by Emacs when you pressM-S-RETview-lossage(akaC-h l) is a better choice (describe-keywill try to guess when the sequence ends and that guess is not always the one you need). – Stefan Mar 17 '20 at 12:24C-h l, it says;– jing chen Mar 31 '20 at 01:54C-h l, it saysESC [ 1 3 ; 4 [nil]– jing chen Mar 31 '20 at 02:01(define-key input-decode-map (kbd "ESC [ 1 3 ; 4") (kbd "S-RET"))– Stefan Mar 31 '20 at 02:52(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