GNOME Bugzilla – Bug 743258
alt-enter sends wrong key sequence
Last modified: 2015-01-20 22:39:01 UTC
While 'enter' correctly sends ^M, 'alt-enter' sends ^]^J, instead of ^]^M as expected. This can hinder use of software such as emacs which binds that key.
Indeed. Also, same story for ctrl-enter, which is ^M in xterm (that is, ctrl is ignored), but ^J in vte. Not sure if we should change it or leave it this way, the extra functionality might become handy. Probably we should take a look at some other terminals. Note to self #1: Put this in ~/XTerm so that it doesn't handle alt-enter specially: *fullscreen: never Note to self #2: To see what terminals send before they go through the kernel's possible crlf mangling, probably the simplest and cleanest is to strace the write()s to the /dev/ptmx fd.
Created attachment 295044 [details] [review] Fix This changes both alt-enter and ctrl-enter to emit ^[^M and ^M resp.
konsole, urxvt, putty, st, terminology => they all send ^M on ctrl-enter, so I don't see a point in us sending ^J. The patch can probably be further simplified a bit.
Yes, let's keep to xterm behaviour here. Please commit.
Created attachment 295051 [details] [review] Fix, v2 Noticed one more thing: As per bug 608400 comment 4, my keyboard generates the wrong keycode. After remapping, the situation looks the following in xterm: "Normal" Enter key: ^[^M with Alt, ^M with Ctrl or no modifiers. KP Enter, when it should "act normally": Emit ^M, modifiers are ignored. KP Enter in application keymap mode and numlock turned off: \eOM, modifiers applied such as \e[O3M, \e[O5M etc. Vte didn't emit the modifiers here. The 2nd patch fixes all these issues - I hope :)
Submitted.