Super key combinations cause weird input in Konsole

0

I'm running KDE 5.10.4 on Fedora 26. Whenever I'm in Konsole and press the Win/Super key along with any key that's not bound to a system-wide KDE shortcut, such as 'I', it sends some weird input that: (1) prints some contents from /etc/hosts (but not the whole contents of /etc/hosts), and (2) writes "si" (or eg. "sd" if I pressed Super-D instead) on the next line. For example:

[eru@keionbu ~]$ 
::1                      localhost4.localdomain4  localhost.localdomain
localhost                localhost6               
localhost4               localhost6.localdomain6  
[eru@keionbu ~]$ si

The first line here being where I press Win+I. It should be noted that this also happens if there's already text on the first line. It also doesn't seem to happen with other terminal emulators like xterm or terminator.

I tried changing Konsole's keybindings and the Keyboard setting (between Xfree4, Linux, and Solaris), but it did not seem to solve the issue. I also tried changing the various settings under System Settings > Input Devices > Keyboard > Advanced that claim to pertain to Alt/Win key behavior, but to no avail.

Any ideas how to fix it besides just finding another terminal emulator? It's pretty annoying because I occasionally accidentally press Super instead of Alt, and it causes this weird input/output.

burneddi

Posted 2017-08-06T15:36:55.730

Reputation: 103

Same here on Kubuntu. But I have never seen it until I tried to reproduce your problem. Seems related to some kind of autocompleion of hosts names (if you enter it after a letter you only get hosts names with that letter)? May not be related to Konsole. If I log into one of the TTYs, Meta-G lists all the directories, and if I type D+Meta-G I only get those startwith with a D: Desktop, Documents, Downloads... So changing the console app may not fix the problem. – xenoid – 2017-08-06T18:03:18.847

Same behavior in Ubuntu 17.04, Unity. I don't know the full answer, but I could split the problem space in half. When you press Super + letter, konsole emits ^X @ s letter (that is: Ctrl-X, literal "at" sign, literal "s", and the letter you pressed). You can verify this by running e.g. cat and then pressing this. One question is why does konsole emit this sequence. Another question is why is bash (or more likely readline) configured to list all the hostname completions upon a ^X @. – egmont – 2017-08-06T21:25:17.627

It appears ^X is a bash shortcut for much extended functionality, and it just happens that ^X-@ is mapped to "possible hostname completions". The real question, I guess, is how to stop Konsole (and other terminal emulators) from sending ^X @ s on super. – burneddi – 2017-08-07T00:01:24.120

Answers

0

It's hard-coded (not configurable) and done intentionally. The git log for that commit says

[commit 5ba344714b8da55dfcc84823abac6f059a288386
Author: Jekyll Wu <adaptee@gmail.com> 
Date:   Tue Apr 24 14:35:06 2012 +0800
    Translate the "Super" modifier into bytes prefix understood by Emacs.
    Note: although it is Qt::MetaModifier in the code, the actual pressed
    key is the "Super/Windows" key.
    CCBUG: 96282][1]

The cited bug report is here (Emacs-specific).

Thomas Dickey

Posted 2017-08-06T15:36:55.730

Reputation: 6 891

God damn emacs users ruining it for everyone again! Thanks for the answer. – burneddi – 2018-01-24T20:10:43.433