Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top