Make terminal use pageup/pagedown instead of shift-pageup/shift-pagedown?

8,265

Solution 1

I am afraid this is not possible, as no PgUp/PgDown will be sent to command-line applications, which will render some of them unusable. This is a good old days Unix feature.

If you want more user-friendly scrolling, I suggest using the less command. It's used this way:

command-with-lot-of-output | less

This will start the less command with output of your original command. (*More about piping output to other programs can be found here.

less can be navigated using arrows or PgUp/PgDown. For your convenience it also provides searching and more (see man less for more). You can quit less by pressing the q key.

Solution 2

Use xterm and tweak the keybindings (in ~/.Xresources) like this:

xterm*VT100.Translations: #override \n\
    <KeyPress>Prior:scroll-back(1,page)\n\
    <KeyPress>Next:scroll-forw(1,page)\n\

gnome-terminal says PageUp/PageDown is for applications within the terminal and using them would be confusing...

Share:
8,265
HDave
Author by

HDave

Architect, developer, and most importantly, user.

Updated on September 18, 2022

Comments

  • HDave
    HDave over 1 year

    I've grown quite weary of shift-pgup to page up in gnome terminal, the command line, terminator, and guake, etc.

    Any way to easily make these apps use the straight page-up and page-down keys for paging around?

  • HDave
    HDave over 11 years
    I researched the heck out of this and while it seems there at 100+ keystrokes that you can map in the command console, page-up and page-down aren't two of them!
  • Jonathan Hartley
    Jonathan Hartley over 10 years
    less is not suitable for just scrolling up/down in the contents of your terminal, and invoking it is hardly more convenient than pressing shift. Not Jakub's fault at all, but it's sad there isn't an answer to this question.
  • William
    William over 7 years
    @HDave here is how to do it in xterm unix.stackexchange.com/questions/339160/…
  • William
    William over 7 years
    @JonathanHartley here is how to do it in xterm unix.stackexchange.com/questions/339160/…
  • William
    William over 7 years
    then why does xterm support the option and not gnome terminal? Either way I am the one that both linked the answer above and posted the bounty I'm not giving a bounty to this answer.
  • aba
    aba over 7 years
    askubuntu.com/users/33577/liam-william Oops, I didn't read until the bottom (at the top, it's about the clipboard). And: fair enough! I wouldn't give it to me: I tried to post an URL that supports my gnome-terminal statemtent, but all I found were outdated, i.e. non-existant links...