Open phil-s opened 6 months ago
Not to doubt you, but I'm curious, is it really not available in a terminal? When I press Shift+Return in a shell, both Bash and Fish distinguish it from simply pressing Return.
It could well be me, or it might depend on the terminal. I know that some terminal emulators do/can support more or less every key sequence Emacs can use, but traditional ones are relatively limited.
Which terminal are you using?
(I'm using gnome-terminal on an Ubuntu system and, under emacs -nw
, C-h k S-RET
thinks I typed RET
.)
Running showkey -a
also supports that result in my terminal: I get the same output typing both RET
and S-RET
. Somewhere I've seen an article on exactly how common terminals process modified keys, so if I can find that I can probably confirm this definitively.
Hm, interesting. showkey -a
shows, for Return followed by Shift+Return:
$ showkey -a
Press any keys - Ctrl-D will terminate this program
^M 13 0015 0x0d
^[OM 27 0033 0x1b
79 0117 0x4f
77 0115 0x4d
^D 4 0004 0x04
That's using Konsole from KDE/Plasma 5.
But emacs -q -nw
on the same terminal, using C-h k
, detects both Return and Shift+Return as RET
.
I suspect RET
being ^M
is actually the reason, as Ctrl-modified letters are case-insensitive. In your case you're seeing a different escape sequence being sent to disambiguate it (and I think you could probably get Emacs to interpret that), but I'm guessing that's a Konsole thing. (I'd try it myself, but I think Ubuntu wants to install all of KDE in order to provide konsole -- 85 packages seems a bit much).
Thanks. Well, I guess we should do this, then.
I haven't implemented that swap, but I have changed the existing S-RET
to S-<return>
in #270.
This would be a change for users (and take some adjusting to), but it looks like
S-<return>
isn't normally available in terminals – so should the standard bindings forM-RET
(which is available in terminals) andS-<return>
(which isn't) be swapped?Being able to reply to messages is, after all, far more important than selecting between two alternatives for writing a new message (and I think even more so now that users can customize their preferred
ement-room-compose-method
).I noticed this issue when updating the transient menu in https://github.com/phil-s/ement.el/commit/24197ba25099d478e6cc97298e8972554e6c2b2f and realising that the transient specified
S-RET
(vsS-<return>
in the regular keymap), and then establishing thatS-RET
(which looks like it would be terminal-friendly) didn't seem to be a thing in practice.