14

In org-mode, pressing M-S-RET (meta-shift-return) will create a new TODO on a new line. This key sequence sends M-RET to emacs through my terminal. I've checked this with C-h c ESC-S-RET, which returns M-RET is undefined in the mini-buffer.

I'm using Snow Leopard with Emacs 23.2.1 running in Terminal.app. There is no option to define a RET sequence in the terminal keyboard preferences.

Any idea what's causing the missing SHIFT? Workarounds?

jrhorn424
  • 1,981
  • 2
  • 21
  • 27

5 Answers5

7

You can get Emacs to pretend that it got S-RET with C-x @ S RET (note uppercase S).

This also works for adding control, meta, alt, hyper or super modifiers; type C-x @ C-h for the list of bindings. The Modifier Keys section in the Emacs manual mentions this as well.

legoscia
  • 39,593
  • 22
  • 116
  • 167
  • 1
    This answer provides a hack: map the terminal's (iTerm's, more specifically) M/S-RET to what Emacs would process as as M/S-RET https://emacs.stackexchange.com/a/62538/29629 – anon2328 May 07 '22 at 01:23
5

In general, lots of keystrokes are simply impossible to send via a terminal, since terminals emulate an old protocol that only allowed 256 separate keys (or maybe only 128).

Chances are, when you press S-RET, Terminal.app does exactly the same thing as if you'd pressed RET. Thus Emacs has no way to distinguish those two cases.

offby1
  • 6,767
  • 30
  • 45
  • I was afraid this might be the case. I'll leave the question open for a bit to see if anyone out there knows which terminal I should emulate to get `S-RET`. It may not be possible. Currently, terminal reports itself as `xterm-color`, but I can change this in the config options. Don't know if it would solve anything though. – jrhorn424 Aug 21 '10 at 01:32
3

Cross-linking to other Q&As:

If you are using an xterm, then the modifyOtherKeys option may facilitate that binding. See the following for details:

Send "C-(" to Emacs in VT100/xterm terminal (Mac OS X's Terminal)?

I suspect Emacs recognises those codes by default, but if not then also see input-decode-map as described here: Binding M-<up> / M-<down> in Emacs 23.1.1

Community
  • 1
  • 1
phils
  • 71,335
  • 11
  • 153
  • 198
2

See explanation and alternative shortcuts for TTY here.

Some of these have worked for me in a terminal in Ubuntu Linux (both locally and over SSH), but not all of them seem to work. For example, the alternative provided for S-RET (which I expected to run org-table-copy-down) instead seems to run org-clone-subtree-with-time-shift for some reason. However, I have found the list of alternatives useful, particularly those with the M- prefix. For example ESC UP for M-UP to move text around in tables.

SabreWolfy
  • 5,392
  • 11
  • 50
  • 73
0

Though it's a lot of extra key presses, it turns out that org-mode has an alternative:

C-c C-x <shift> m

i.e. C-c C-x M

https://orgmode.org/manual/TTY-Keys.html#TTY-keys

Matt Kneiser
  • 1,982
  • 18
  • 23