After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743258 - alt-enter sends wrong key sequence
alt-enter sends wrong key sequence
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.36.x
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-20 17:38 UTC by Tom Hunt
Modified: 2015-01-20 22:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix (1.28 KB, patch)
2015-01-20 19:56 UTC, Egmont Koblinger
none Details | Review
Fix, v2 (1.31 KB, patch)
2015-01-20 22:30 UTC, Egmont Koblinger
none Details | Review

Description Tom Hunt 2015-01-20 17:38:09 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.
Comment 1 Egmont Koblinger 2015-01-20 19:54:50 UTC
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.
Comment 2 Egmont Koblinger 2015-01-20 19:56:31 UTC
Created attachment 295044 [details] [review]
Fix

This changes both alt-enter and ctrl-enter to emit ^[^M and ^M resp.
Comment 3 Egmont Koblinger 2015-01-20 20:09:24 UTC
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.
Comment 4 Christian Persch 2015-01-20 20:15:26 UTC
Yes, let's keep to xterm behaviour here. Please commit.
Comment 5 Egmont Koblinger 2015-01-20 22:30:14 UTC
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 :)
Comment 6 Egmont Koblinger 2015-01-20 22:39:01 UTC
Submitted.