Bug 394276 - Alt+Backspace sends wrong sequence
Summary: Alt+Backspace sends wrong sequence
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: keyboard (show other bugs)
Version: 18.04.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-15 11:12 UTC by Moritz Bunkus
Modified: 2018-05-16 13:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 18.04.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Bunkus 2018-05-15 11:12:33 UTC
This is a regression from 17.12.3.

In 17.12.3, pressing Alt+Backspace sends M-DEL to Emacs. In 18.04.0, it sends C-M-h according to Emacs, something completely different.

I can return to the desired behavior simply by downgrading the konsole package to 17.12.3. No other packages are changed.

How to reproduce:

1. Start konsole 18.04.0.
2. Start Emacs with default configuration: emacs -Q -nw
3. Press C-h k (for `describe-key`), then Alt+Backspace. Emacs shows "C-M-h runs the command mark-defun".

Contrast that to konsole 17.12.3, where 3. shows "M-DEL runs the command backward-kill-word".

Other terminal emulators such as the VTE-based "terminator" or "kitty" all show the desired behavior: Emacs shows M-DEL.

Note that I've renamed ~/.config/konsolerc and ~/.local/share/konsole before running the tests. Therefore konsole's default configuration should apply.

I'm using Arch Linux' packages.
Comment 1 Kurt Hindenburg 2018-05-15 14:11:39 UTC
A fresh emacs install following your examples below shows "It is bound to C-M-h." for Alt+Backspace in 17.12 and 18.04

Any chance some other update changed this on your system?

In xterm, "self-insert-command N"
terminator, "M-DEL
Comment 2 Moritz Bunkus 2018-05-15 15:15:26 UTC
Thanks for the quick feedback.

I can trigger both behaviors simply by switching between the following two packages:

konsole-17.12.3-1-x86_64.pkg.tar.xz 
konsole-18.04.1-1-x86_64.pkg.tar.xz

What I did:

1. Made sure no konsole process was running,
2. Installed konsole 18.04.1,
3. Created a new user,
4. Starting Plasma as that user,
5. Starting konsole,
6. Starting "emacs -Q -nw"

Result: bound to C-M-h.

Next:

1. Logged out as that new user,
2. Deleted that user,
3. Created yet another user,
4. Again made sure no konsole process was running,
5. Installed konsole 17.12.3,
6. Started Plasma as that new user,
7. Started konsole,
8. Started "emacs -Q -nw"

Result: bound to M-DEL.

I did not change anything else in this system between the two test cases. No other packages or libraries were changed or updated.

Arch's 17.12.3 package is upstream's release with the following additional patch applied: https://cgit.kde.org/konsole.git/patch/?id=b8a2f0cf The 18.04.1 package is just the upstream tarball without any additional patches applied. In both cases cmake is invoked with:

     -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DBUILD_TESTING=OFF

I'm running in xorg, not Wayland.

Any other information I could provide?
Comment 3 Ahmad Samir 2018-05-15 16:01:18 UTC
This is caused by this commit:
https://cgit.kde.org/konsole.git/commit/?id=5345bbb0afa8edd6ba4909eca2495745df36f6a1

One way to fix it, is to be less zealous in the first Backspace rule, so using "-Control" instead of "-AnyMod".

@Moritz, please test this:
- Open Edit current Profile -> Keyboard, make sure Default is selected and click Edit
- Change:
Backspace-AnyModifier
to:
Backspace-Ctrl
Comment 4 Ahmad Samir 2018-05-15 16:11:36 UTC
https://phabricator.kde.org/D12899
Comment 5 Kurt Hindenburg 2018-05-16 01:03:30 UTC
OK my fault, I had an old default.keytab so my testing didn't work.  I'll commit the fix shortly and backport it to 18.04.2
Comment 6 Ahmad Samir 2018-05-16 03:26:29 UTC
(In reply to Kurt Hindenburg from comment #5)
> OK my fault, I had an old default.keytab so my testing didn't work.  I'll
> commit the fix shortly and backport it to 18.04.2

Great :)
Comment 7 Moritz Bunkus 2018-05-16 06:06:45 UTC
> - Change:
> Backspace-AnyModifier
> to:
> Backspace-Ctrl

That works. Thanks. And thanks for implementing that fix.
Comment 8 Kurt Hindenburg 2018-05-16 13:36:21 UTC
Git commit be7181c93ad0f36953555e2cee402e193da2d5a9 by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 16/05/2018 at 13:36.
Pushed by hindenburg into branch 'master'.

Backspace without CTRL should send '^?'

Summary:
This matches XTerm behaviour, so that pressing Alt+Backspace will send
\E + Del, which is the expected behaviour in some apps (e.g. emacs),
and it also matches the Konsole behaviour before commit
5345bbb0afa8edd6ba4909eca2495745df36f6a1
FIXED-IN: 18.04.2

Test Plan:
- Make sure you have the default .keytab file without any modifications
- Run `emacs -Q -nw`, press Ctrl+h k, to invoke the describe key functionality
- Press Alt+Backspace, it'll send C-M-h
- Apply the diff and test again, now it should send M-Del

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: konsole-devel, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12899

M  +6    -2    data/keyboard-layouts/default.keytab

https://commits.kde.org/konsole/be7181c93ad0f36953555e2cee402e193da2d5a9
Comment 9 Kurt Hindenburg 2018-05-16 13:37:00 UTC
Git commit c86aa6a0cb6e4d9e21d44589cab45875dae2dd9e by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 16/05/2018 at 13:36.
Pushed by hindenburg into branch 'Applications/18.04'.

Backspace without CTRL should send '^?'

Summary:
This matches XTerm behaviour, so that pressing Alt+Backspace will send
\E + Del, which is the expected behaviour in some apps (e.g. emacs),
and it also matches the Konsole behaviour before commit
5345bbb0afa8edd6ba4909eca2495745df36f6a1
FIXED-IN: 18.04.2

Test Plan:
- Make sure you have the default .keytab file without any modifications
- Run `emacs -Q -nw`, press Ctrl+h k, to invoke the describe key functionality
- Press Alt+Backspace, it'll send C-M-h
- Apply the diff and test again, now it should send M-Del

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: konsole-devel, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12899

(cherry picked from commit be7181c93ad0f36953555e2cee402e193da2d5a9)

M  +6    -2    data/keyboard-layouts/default.keytab

https://commits.kde.org/konsole/c86aa6a0cb6e4d9e21d44589cab45875dae2dd9e
Comment 10 Moritz Bunkus 2018-05-16 13:45:15 UTC
Thank you both very much for the great support!