M-RET and M-UP/DOWN not working in Emacs org-mode in console/terminal
Asked Answered
B

3

14

I'm using emacs23 on Ubuntu 32-bit 10.04/10.10 with GNOME and Compiz.

Pressing M-RET in an org-mode plain list in Emacs (GUI) inserts a new item. Pressing M-Up moves the item up in the list.

These keys don't work as expected in emacs -nw under Terminator and gnome-terminal. The M-Up key does nothing, whereas the M-RET key simply moves the cursor down one line and indents the position. The keys also don't "work" in xterm, which inserts \215 instead. Pressing ESC-RET or ESC-Up instead produces the expected functionality. The same problems exist if I run emacs -nw on a headless server accessed via ssh under Terminator, gnome-terminal and xterm.

I've searched both generally and on the org-mode Gmane list for an answer to this, but have not found anything. Is this a known issue with org-mode or is it related to the terminal emulator and/or the Window Manager?

Beleaguer answered 5/4, 2011 at 18:31 Comment(0)
B
5

In addition to the keys in my question, S-TAB, S-Left, S-Right, S-Up and S-Down were not working over ssh and PuTTY. Using certain keys on a TTY connection (ssh, screen, PuTTY) is a known issue.

Alternative keys are included in org-mode as detailed in 'Using Org on a TTY' in the org-mode manual.

Beleaguer answered 24/7, 2011 at 16:34 Comment(0)
J
3

Alternative key combinations exist

for equivalent to M-RET M C-m "<return>" is the Return ↩ key while emacs runs in a graphical user interface.

"RET" is the Return ↩ key while emacs runs in a terminal.

"RET" is also equivalent to "C-m" (【Ctrl+m】). (http://ergoemacs.org/emacs/emacs_key_notation_return_vs_RET.html)

as equivalents for M-<up/down> you can use

ESC-<up>
ESC-<down>
Jae answered 20/10, 2016 at 21:48 Comment(0)
T
2

The menubar of terminal emulator is not letting the M key that is meant for Emacs be passed down to Emacs. For Emacs to receive the M key as it is supposed to, you could either use the Esc or disable the menubar and use M key in Emacs as usual.

ADDED:

For the xterm, if you do CTRL+Mouse Button 1, you will see "Meta sends Escape". You need to make sure that option is checked/enabled to make M work as it should in Emacs.

Tollefson answered 5/4, 2011 at 22:6 Comment(3)
@vpti3833: Thanks for the reply. How come M-x works in Emacs in Terminator/gnome-terminal? The M is getting through in this case. Disabling the menubar in gnome-terminal results in M-UP working, but not M-RET.Beleaguer
@SabreWolfy: M-Ret should be doing something in the terminal emulators, then. In xterm it toggles between fullscreen and windowed display. Not sure what it does in others, though.Tollefson
Thanks. I've looked at the keyboard shortcuts in GNOME itself and in the emulators. M-RET is not bound to anything. I'll have to look into it further. I'll also try setting up xterm as you suggest.Beleaguer

© 2022 - 2024 — McMap. All rights reserved.