0

I prefer to work without a mouse. This means I prefer to use PageUp and PageDown instead of the scroll wheel.

This works fine, except in the gnome terminal. I need to use shift-pageUp/Down there.

I would like to have one way to scroll-up and down.

In vscode terminal it was easy. I just needed to change the keyboard shortcuts.

But how to change config for the gnome-terminal, so that the PageUp key works (without the Shift key)?

Related: https://github.com/guettli/ten-flying-fingers

guettli
  • 1,777

1 Answers1

0

In VTE-based terminals, including GNOME Terminal, Shift+PageUp and Shift+PageDown are hardcoded and cannot be modified without touching the source code.

Plain PageUp and PageDown keys report this keypress towards the application running inside, e.g. bash, vim etc., so that they can handle it the way they wish.

You need to modify VTE's source, or use a different terminal emulator that allows to configure it. Or get used to this hardcoded behavior and adjust your workflow, including the possibility of using less as suggested in an already linked post.

egmont
  • 8,225
  • I had the pager less on my mind. And in vscode it magically works. I can use plain PageUp/Down. It works on the shell, and in less, too. – guettli Jan 26 '24 at 12:21
  • "works on the shell" - depends on what you mean by "works". For example, bash on PageUp invokes the latest command that starts with the prefix that you typed. Now, it surely cannot both scroll back the terminal as well as invoke the latest command with that prefix (or at least that wouldn't make sense). You say that in vscode it scrolls back, that is, you cannot easily invoke the command from the history that starts with the typed in prefix? gnome-terminal and vscode work differently, gnome-terminal follows what the majority of Unix terminals do. – egmont Jan 26 '24 at 16:14
  • I don't use the feature "invoke the latest command with that prefix". I use ctrl-r to search backwards in the bash history. All I can say, that it works fine on vscode-terminal. And I would like to have the same in the gnome-terminal. – guettli Jan 29 '24 at 09:29
  • I'd like to emphasize that whenever you say "works", "works fine" etc. you mean it works according to your personal preference, not that it works according to some standard or common behavior. Most terminals work like GNOME Terminal in this aspect, I believe vscode is the odd one here. Unfortunately to you, GNOME Terminal's behavior here cannot be changed, at least not without modifying VTE's source. Let me know if you're interested and I'll give some help where and how to do it. – egmont Jan 29 '24 at 09:46