1

I get some standard output in a terminal and try to use the arrow keys to scroll up but instead it gives me previous commands.

Page up and page down do nothing.

Using the scroll bar is extremely difficult because it moves about a page per micro-inch. Please tell me there is a way to get sensible scrolling using the arrow keys (or something equivalent) on a Ubuntu terminal?

I see nothing in the preferences for scrolling.

  • 2
    Which "Ubuntu terminal"? The choice of terminal emulators is in the double figures. Which one are you actually asking about? – JdeBP Aug 4 '18 at 8:18
  • 1
    I'm using GNOME terminal 3.28.1, the one that came "out of the box." – Russ P. Aug 4 '18 at 17:17
  • 1
    Several come "out of the box", a notion that has not very much meaning on a package-based operating system like Ubuntu in any event. – JdeBP Aug 4 '18 at 18:53
  • @JdeBP Gnome Terminal is the only terminal installed on the Ubuntu Desktop image. – wjandrea Jan 10 at 22:49
6

You can use ⇧ Shift + PgUp and ⇧ Shift + PgDown to scroll in most terminals. The addition of ⇧ Shift stops the keypress from being sent through the terminal to applications, as of course happens if you just press PgUp and PgDown unmodifed.

These must, moreover, be the PgUp and PgDown on the editing keypad, not the ones on the calculator keypad.

⇐ This is the editing keypad. If you have a laptop without a full 104/105/106/107/109-key keyboard, you will have to find its equivalent on your laptop keyboard, wherever that is.

  • I don't see why this was downvoted. OP asked for "scrolling using the arrow keys (or something equivalent)" – Jesse_b Aug 3 '18 at 21:43
  • 1
    shift + page up or page down does not work for me. It just prints a 3 or a 9 – Russ P. Aug 3 '18 at 22:59
  • I was baffled by what you meant by the "cursor keypad," but I finally found pgup and pgdn keys above the calculator keyboard. And they do work when I use them with the shift key. That's progress. But it seems a bit strange that I should have to use the shift to make these keys do what their name says they do. Also, it would be nice to have finer control using the arrow keys. If not the default mode, it seems to me that there should at least be a way in the get that mode in the scrolling preferences. – Russ P. Aug 4 '18 at 17:36
0

I just noticed another link on the side here called "How to scroll in a terminal by line in GNOME Terminal 2.31.3?". It turns out that you can use the arrow keys to scroll by holding down both shift and control! Who would have guessed?! So that gives me a workaround of sorts, but I think the arrow keys should work that way without having to hold down any other keys. Shouldn't have to jump through hoops just to get basic functionality. Just my opinion.

  • 1
    The basic functionality is of course for the key presses to be sent to the applications connected to the terminal as terminal input. – JdeBP Aug 5 '18 at 12:53
  • I consider scrolling to be "basic functionality." And while I greatly appreciate the help that I got at this site, I shouldn't have had to come to a help forum just to figure out how to scroll in a terminal. It should be intuitive. Apparently some users like to use the arrow keys to select previous commands, but I have always just used !!, !<start of previous command to be selected>, or the bash history command. In my opinion, basic line-by-line scrolling is more fundamental than repeating previous commands and should be the default behavior for the arrow keys or at least an option. – Russ P. Aug 5 '18 at 17:14
  • 1
    You have not grasped the fundamentals of what such a terminal emulator is. It emulates a terminal. Terminals (can) have arrow keys. Users expect to use them with applications and expect them to be transmitted as ordinary terminal input. They are not, in the normal case, local functions on (character-based) terminals. – JdeBP Aug 6 '18 at 7:56
  • Perhaps, but you have not grasped the concept that basic functionality should be intuitive and obvious when possible. Ask Steve Jobs. I don't want to be an expert on terminal emulators; I want to use one to do my job. – Russ P. Aug 6 '18 at 16:33
2

The way to scroll using the arrow keys in a terminal emulator is to hold down the shift key. This is because a terminal emulator send all keypresses to the application running in the terminal; holding shift down bypasses that. This can also be used with other keys like copy and paste.

For those complaining that the shift key is unnecessary, changing the behaviour of the terminal emulator to not need the shift key would break all terminal applications that can make use of the arrow keys such vim, nano, git, less and many more. In all of those applications, using the arrow keys will just scroll as a user would expect.

  • i have now tested this one the gnome-terminal and well gnome is the exception to this in also requiring the control key,..... why? i suppose that's a question for the gnome team – Fuseteam Jun 27 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.