GNOME Terminal – Remap Shortcut Keys for Scroll Down/Up

gnome-terminalkeyboard shortcuts

According the gnome-terminal usage:

You can also scroll up or down one line at a time by pressing Control+Shift+Up or Control+Shift+Down.

In this document shows: Control + Shift + Up / Down can scroll up or scroll down the gnome-terminal one line. And, yes, they can!

Now, I want to re-map these two shortcut keys, like: Alt + J / K (Vimer habit).

My understanding

Here some signal must be triggered after press Ctrl + Alt + Up | Down.

The question is, what signal is triggered?


Here are some questions:

  • 0x115 is the signal of windows scrolling. what about Linux?
  • Can the scrolling be executed by command in gnome-terminal? (Some command inputted and gnome-terminal scrolling up/down)

I've download the source code of Gnome-Terminal, and tried to find the answer. But my C is terrible…


By the way, my Linux is Ubuntu 13.10, and gnome-terminal is 3.6:

$ gnome-terminal --version
GNOME Terminal 3.6.1
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 13.10
Release:    13.10
Codename:   saucy

Best Answer

[OPTIONAL]

I'm a vimer too and I feel uncomfortable with the default Ctrl position so I remapped the Window's Meta to be an additional Ctrl key. NOTE: you'll need xmodmap.

remove Control = Control_L Control_R
remove mod4 = Super_L Super_R
add Control = Control_L Super_L

[STEPS]

To remap Ctrl + J and Ctrl + K in Konsole follow these steps:

  1. Go to Settings -> Configure Current Profile -> Input
  2. Edit the Linux Console key binding
  3. Add a new key binding to scroll down a line at a time: J + Ctrl -> ScrollLineDown
  4. Add a new key binding to scroll up a line at a time: K + Ctrl -> ScrollLineUp

Some screenshots

   enter image description here

                         enter image description here

                                               enter image description here

NOTE: Now you'll be able to scroll up and scroll down a line at a time using the configured shortcuts.

EDIT #1

Alt does work!! Just change Ctrl with Alt in the bindings.

Related Question