Bug 267100 - keytab rule key PgUp+Shift+AppScreen : "bar" doesn't work
Summary: keytab rule key PgUp+Shift+AppScreen : "bar" doesn't work
Alias: None
Product: konsole
Classification: Unclassified
Component: kpart (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR wishlist with 20 votes (vote)
Target Milestone: ---
Assignee: Konsole Developer
: 191476 (view as bug list)
Depends on:
Reported: 2011-02-24 22:00 UTC by Tomáš Čech
Modified: 2011-07-26 22:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7

modified default.keytab (3.22 KB, text/plain)
2011-02-27 12:00 UTC, Tomáš Čech
patch (5.77 KB, patch)
2011-03-31 01:51 UTC, Tomáš Čech

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Čech 2011-02-24 22:00:21 UTC
Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

Some applications can prevent terminal emulator from history scrolling (which
is done usually by pressing shift+pageup/pagedown). Good example is midnight
commander or vim.

It would be great to have possibility to delegate this (probably dropped)
events into application running in terminal emulator. When applications like
screen or tmux will be able to receive such events, there may be implemented
history scrollback internally with usual behaviour instead of special modes.

Reproducible: Always

Steps to Reproduce:
1] run konsole with vim
2] enter insert mode
3] pres ctrl+v
4] press shift+pageup

Actual Results:  
no characters seen

Expected Results:  
see generated characters
Comment 1 Tomáš Čech 2011-02-24 22:03:50 UTC
I created same feature request for GTK 2.0 VTE component so you can see also discussion there:
Comment 2 Tomáš Čech 2011-02-27 08:19:12 UTC
OK, I did some analysis. The feature I'd like to use is called alternate screen (or buffer). In konsole there is used mode 'MODE_AppScreen' and 'AppScreen' it looks almost like keyboard modificator in keytab file. Not scrolling is defined in data/keyboard-layouts/default.keytab (end of file).

It seems that it could be solved by configuration only, but when I alter my keytab with

key Up+Shift+AppScreen : "foo"
key Down+Shift+AppScreen : "foo"
key PgUp+Shift+AppScreen : "bar"
key PgDown+Shift+AppScreen : "bar"

it doesn't have desired effect. I tried to run vim, enter insert mode and tried to scroll, but nothing was inserted...

Comment 3 Tomáš Čech 2011-02-27 11:25:56 UTC
By testing with

key Backspace+Shift-AppScreen : "off-screen"
key Backspace+Shift+AppScreen : "in-screen"

I got correct behaviour. Thus I believe this is bug and not feature.
Comment 4 Tomáš Čech 2011-02-27 12:00:45 UTC
Created attachment 57548 [details]
modified default.keytab

this keytab contains modified:
Comment 5 Tomáš Čech 2011-03-03 22:38:05 UTC
it seems that it's hardcoded in src/TerminalDisplay:2483-2517
Comment 6 Tomáš Čech 2011-03-31 01:51:53 UTC
Created attachment 58472 [details]

OK, this is straightforward approach to implement missing functionality. I store information which TerminalDisplay object received keyPress event in Screen object.
Comment 7 Kurt Hindenburg 2011-04-14 17:39:32 UTC
Git commit b88dfb402a8ba3afe317e4a0741bf999f84b68bc by Kurt Hindenburg.
Committed on 14/04/2011 at 17:25.
Pushed by hindenburg into branch 'master'.

Delegate PgUp/Down and Up/Down +Shift+AppScreen to terminal application.

After this patch, the following in the .keytab will work:

key Up+Shift+AppScreen : "appup"
key Down+Shift+AppScreen : "appdown"
key PgUp+Shift+AppScreen : "apppgup"
key PgDown+Shift+AppScreen : "apppgdown"

Patch by Tomáš Čech tcech@suse.cz

FEATURE: 267100

M  +14   -0    src/Screen.h     
M  +13   -37   src/TerminalDisplay.cpp     
M  +7    -1    src/TerminalDisplay.h     
M  +12   -3    src/Vt102Emulation.cpp     

Comment 8 Paul Gideon Dann 2011-06-13 16:26:21 UTC
I hope this doesn't show my ignorance too badly, but does this also make it possible to pass mouse scroll events through to the application (tmux in my case)?  I'm getting three "up" or "down" events (^[[A and ^[[B) when I try to scroll in tmux.  Is there a way of passing this through in a way that can be captured by tmux instead?

Ultimately, I'd like to get tmux to enter copy-mode when I scroll the mouse.
Comment 9 Richard Hansen 2011-07-18 17:37:22 UTC
duplicate of bug #191476
Comment 10 Kurt Hindenburg 2011-07-19 02:12:31 UTC
*** Bug 191476 has been marked as a duplicate of this bug. ***