Bug 376770 - Impossible to unbind Shift + Up/Down
Summary: Impossible to unbind Shift + Up/Down
Status: RESOLVED NOT A BUG
Alias: None
Product: konsole
Classification: Applications
Component: keyboard (show other bugs)
Version: 16.12.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-21 18:39 UTC by andydecleyre
Modified: 2018-07-03 03:25 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andydecleyre 2017-02-21 18:39:46 UTC
I would love to keep using konsole but I need to unbind its keys so I can use them with programs running within konsole. It is apparently impossible to unbind some of them. Please allow this, especially for shift+up, shift+down, ctrl+shift+up, ctrl+shift+down. These are not even listed in the keybindings configuration.
Comment 1 andydecleyre 2017-02-21 22:13:58 UTC
And shift+left and shift+right, I think konsole is sneakily stealing those events as well.
Comment 2 andydecleyre 2017-11-01 16:03:07 UTC
I don't know if things have changed, but things do seem different than what I thought when I reported this.

In Terminator, outside of my tmux session, inside of a text editor with shift+up/down bound to change the text selection, that works fine. In Terminator, inside of a tmux session, it also works fine. In Konsole, outside of a tmux session, it also works fine. But in Konsole, inside a tmux session, it does not -- instead, it does some sort of paging of the terminal contents.

tmux config:

set -g prefix `
bind ` send-prefix
set -g mouse on
set -ga terminal-overrides ',xterm-256color:Tc:smcup@:rmcup@'
setw -g mode-keys vi
setw -g xterm-keys on
set -g history-limit 300000
set -g status off
set -g set-titles on
set -g set-titles-string "#W - #{USER}@#h.#I"
bind j prev
bind k next
bind l new-window
bind s set -g status
bind -T copy-mode-vi c send -X copy-pipe "xclip -sel clip"

I'll investigate on the tmux side as well, but so far it seems particular to Konsole.
Comment 3 andydecleyre 2017-11-01 16:16:30 UTC
After getting some help from nicm in #tmux analyzing my verbose tmux logs after shift+left/right:

<‎nicm‎>‎ tmux is not receiving any key presses
‎<‎nicm‎>‎ the only key in here is ^D
‎<‎nicm‎>‎ so this seems like a problem with your terminal

But this problem only presents when using tmux with konsole. Either without the other is fine.
Comment 4 Egmont Koblinger 2017-11-01 20:06:19 UTC
You mentioned you're using Konsole as well as Terminator.

Terminator in turn uses the VTE widget, where Shift+{PgUp,PgDn,Home,End} and Ctrl+Shift+{Up,Down} aren't configurable either. On the normal screen, they scroll the viewport just like Konsole does. On the alternate screen though (this is where tmux and vim switch to, so if you're using at least one of the two, you're there) these keypresses are sent to the applications. (The alternate screen doesn't have a scrollback buffer, so I think it's a reasonable behavior, konsole could also do this.)
Comment 5 Ahmad Samir 2017-12-21 19:12:39 UTC
Shift+{Left, Right} are the default shortcuts to switch to previous/next tab respectively.

Shift+Up (Up+Shift-AppScreen) and Shift+Down (Down+Shift-AppScreen) are bound in Konsole to ScrollLineUp and ScrollLineDown respectively; can you try removing those key bindings from Konsole profile settings?
Comment 6 andydecleyre 2018-03-22 15:07:40 UTC
(In reply to Ahmad Samir from comment #5)
> Shift+{Left, Right} are the default shortcuts to switch to previous/next tab
> respectively.

I have disabled those shortcuts prior to reporting this bug. Shift+Left/Right was ineffective in konsole+tmux.

> Shift+Up (Up+Shift-AppScreen) and Shift+Down (Down+Shift-AppScreen) are
> bound in Konsole to ScrollLineUp and ScrollLineDown respectively; can you
> try removing those key bindings from Konsole profile settings?

OK, in the profile settings, I removed the keybindings of the "Default (XFree 4)" list for "Down+Shift-AppScreen" and "Up+Shift-AppScreen," but still Shift+Up/Down was ineffective in konsole+tmux. So I also removed the bindings for "Down+Shift+AppScreen" and "Up+Shift+AppScreen" and it seems to work ok now. Thank you for your help!

My primary mistakes were:

1) Thinking the relevant configuration would be under Konsole's keyboard shortcuts
2) Thinking that AppScreen was some fancy key that wasn't relevant to my life. I still don't really get it.
3) Thinking that I shouldn't mess with the stuff in XFree4

Thank you again!
Comment 7 Ahmad Samir 2018-03-22 17:32:54 UTC
The documentation for the keyboard translator (aka the key bindings editor), which is a powerful tool, isn't visible/accessible enough currently; have a look at:
https://cgit.kde.org/konsole.git/tree/data/keyboard-layouts/README.KeyTab
https://cgit.kde.org/konsole.git/tree/src/KeyboardTranslator.cpp#n645

+AppScreen means using the Alternate screen (that's what vim, screen, tmux... etc use)

-AppScreen means NOT using the Alternate screen.

Closing as INVALID as this can be configured in konsole (albeit it's a bit hard to discern at first).
Comment 8 andydecleyre 2018-03-23 02:44:39 UTC
Thank you.

Nothing has changed in the configuration since my last comment, but somehow the behavior has.

Now outside of tmux, shift+left/right pass through ok, but shift+up/down don't. Inside tmux, neither work.
Comment 9 andydecleyre 2018-03-23 03:04:25 UTC
I started over with the default keytab from /usr/share/konsole/default.keytab but haven't been able to recreate success.
Comment 10 Ahmad Samir 2018-03-23 14:18:42 UTC
I tested with tmux:
- started tmux then in another terminal I executed:
tmux bind-key S-up split-window -h
- in tmux pressing C-b then Shift+UP split the window horizontally

so that seems to work.

Another thing to try in the konsole key bindings enditor:
Down+Shift+AppScreen \x00
Up+Shift+AppScreen \x00

this will make those key bindings send no escape sequences at all (\x00 is the null character).
Comment 11 andydecleyre 2018-07-03 03:25:05 UTC
I've pinned the problem down to ":smcup@:rmcup@" in my tmux terminal-overrides. Without that, I can use shift and the cursor keys in apps in konsole, in or out of tmux. The change breaks shift+page{up,down} in tmux, but that's fine.

So I replaced

set -ga terminal-overrides ',xterm-256color:Tc:smcup@:rmcup@'
with
set -ga terminal-overrides ',xterm-256color:Tc'

and I get to come home to konsole.

Re-closing as invalid