Bug 108547 - Ctrl + PagUp/PagDown aren't working anymore
Summary: Ctrl + PagUp/PagDown aren't working anymore
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 114672 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-04 18:05 UTC by Pino Toscano
Modified: 2006-08-07 17:42 UTC (History)
3 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 Pino Toscano 2005-07-04 18:05:31 UTC
Version:           1.6beta (using KDE 3.4.89 (>= 20050615), compiled sources)
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-13)
OS:                Linux (i686) release 2.6.11-1-k7

I've compiled Konsole from trunk a couple of days ago, and with trunk the key shortcuts Ctrl+PagUp and Ctrl+PagDown I used to use with KDE 3.4 to browse bash history back and forward aren't working anymore.
Instrad, when I use one of these shortcuts, I get a '5~' written on Konsole screen.
Comment 1 Kurt Hindenburg 2005-07-04 18:58:38 UTC
It is Shift PageUp/Down.  Konsole tries not to use Ctrl at all.
Comment 2 Pino Toscano 2005-07-04 19:04:43 UTC
> It is Shift PageUp/Down.  Konsole tries not to use Ctrl at all.


Shift PageUp/Down moves me through Konsole output, which is different
from what I wanted.

With the Konsole in KDE 3.4, if I write, for example, 'ma' and then I
press Ctrl+PageUp, then the command it's completed with the last command
in my bash_history starting with 'ma', and then using again
Ctrl+PageUp/Down I could navigate in this history.
It's a mode similar to the reverse-i-search (which I go in through
Ctrl+r), but much quicker.
Comment 3 Kurt Hindenburg 2005-07-04 20:31:08 UTC
Yes, you're correct.  Works in KDE 3.4.x and not in KDE 3.5 (/trunk).

Changes were made to the default xterm keytab to make Konsole work more like xterm.  In xterm, Ctrl page up/down produce the ~5.

BUG: 92749
Comment 4 Thiago Macieira 2005-07-05 04:27:40 UTC
I have something similar with Alt+Left and Alt+Right. Instead of prefixing the normal Left and Right sequences with ^[, a completely different sequence is sent.

I've worked around this by selecting the "Linux console" Keyboard, in the Settings menu.
Comment 5 Hans de Goede 2005-07-05 09:33:08 UTC
konsole sets TERM to xterm and as such should behave as xterm, the old behaviour was wrong. Appearantly some distro makers have put bindings for this wrong behaviour in /etc/inputrc or ~/.inputrc, causing bash and other readline apps todo special things with this wrong behaviour.

Esp the prefixing of ESC (^[) to an ESC-sequence, making it start with a double ESC is totally wrong (the alt behaviour described in comment 4)

The proper fix for this is to look at your /etc/inputrc and/or ~/.inputrc
and look for lines like:
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word

These four line for example map ctrl left/right to forward word/backward word. The first two are for broken claming to be xterm terminal emulators such as gnome-terminal and older konsoles the last two are for the real xterm and current konsole, this is probably what you (Thiago Macieira) want. This however maps it the ctrl left/right instead of alt, if you really want alt replace the 5's by 3's, but CTRL is probably better since this is what graphical editors use.

The solution for the original reporter (Pino Toscano) also is to modify your inputrc file(s) and add bindings like this:
"\e[5;5~": history-search-forward
"\e[6;5~": history-search-backward

I could be wrong about the actions bound to the keys though, because I'm unfamiliar with the behaviour you discribe other options are:
forward-search-history
non-incremental-forward-search-history

And ofcourse their backward counterparts.
Comment 6 Thiago Macieira 2005-07-06 07:03:30 UTC
Actually, this is irssi. The proper key sequence is ESC, Left and ESC, Right. It was just nice that it mapped to Alt+Left and Alt+Right.
Comment 7 Hans de Goede 2005-07-06 07:10:31 UTC
About comment 6, very chance choice for a key mapping prefixing an ESC sequence (which left/right always are) with an ESC, since that causes a double ESC, which usually means something like abort/cancel.

For example pressing alt left/right in the old konsole causes mc to throw up an are you sure you want to quit yes/no dialog box, whihc is rather strange behaviour for alt+cursorkey.

Can irssi keybindings be tweaked, then you can easily restore the old behaviour.
Comment 8 Hans de Goede 2005-07-12 18:35:33 UTC
Hmm, quiet over here Pino Toscano does my fix fix your problem and in a satisfieng way, I would like to close this bug.
Comment 9 Thiago Macieira 2005-10-20 08:37:44 UTC
*** Bug 114672 has been marked as a duplicate of this bug. ***
Comment 10 Robert Knight 2006-08-07 17:42:10 UTC
Closing as suggested.  Konsole's behaviour seems consistant with Xterm which is a good sign.  

Please reopen if there is anything more you think we should do.