How does one send S-RET to Emacs in a terminal?

后端 未结 4 1629
天涯浪人
天涯浪人 2020-12-10 04:19

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

相关标签:
4条回答
  • 2020-12-10 04:56

    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.

    0 讨论(0)
  • 2020-12-10 04:57

    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.

    0 讨论(0)
  • 2020-12-10 05:02

    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.

    0 讨论(0)
  • 2020-12-10 05:02

    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

    0 讨论(0)
提交回复
热议问题