Bug 443113

Summary: Shortcuts sent through to terminal
Product: [Applications] konsole Reporter: Henrik Pauli <henrik.pauli>
Component: keyboardAssignee: Konsole Developer <konsole-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 20.12.2   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Henrik Pauli 2021-09-29 12:38:46 UTC
I have the Next Tab and Previous Tab set to Ctrl+PageDown and Ctrl+PageUp, respectively.  These work just fine, most of the time.

However, in some situations the keypress is sent to the terminal component.

```
$ cat
^[[6;5~^[[5;5~
```

Some testing showed that this happens on a brand new window, if – and only if – there has only been one tab in that window ever.  Put differently: if you open a tab in this window, the shortcut handler will get installed and closing the tab so only one tab remains will retain the handler and no rogue keycodes are sent to the terminal.

STEPS TO REPRODUCE

(A)
1. Open a new Konsole window
2. Press tab-cycling shortcuts

Then (B)
1. Open a new Konsole window
2. Open an extra tab
3. Press tab-cycling shortcuts
4. Close the extra tab
5. Press tab-cycling shortcuts

OBSERVED RESULT
(A) the terminal will print the keypresses (if it's such that it translates well; you may want to run cat, or something)
(B) the terminal will not print

EXPECTED RESULT
(A) 3. and (B) 5. should behave identically, in particular the way that (B) 5. does.

SOFTWARE/OS VERSIONS
Konsole: 20.12.2
Running MATE 1.24.1
KDE Frameworks 5.79.0
Qt 5.15.2 (built against 5.15.2)
The xcb windowing system