How to Stop Ubuntu from Automatically Clearing the Terminal Scrollback

The Lost Output

When working in the Ubuntu terminal, you often execute commands that generate hundreds or thousands of lines of output, such as compiling software, running network diagnostics, or tailing a massive log file. By default, terminal emulators in Ubuntu (like GNOME Terminal) maintain a “scrollback buffer”—a memory limit on how many previous lines you can scroll up to see. However, there is a secondary behavior: if you are actively scrolling up to read a specific error message, and the running process outputs a single new line of text at the bottom, the terminal will often automatically snap your view all the way back down to the bottom, clearing your place and making it impossible to read fast-moving logs.

Locking the Scroll Position

To ensure you can read historical output in peace and stop the Ubuntu terminal from automatically snapping to the bottom (clearing your scrollback position) on new output, you must disable the scroll-on-keystroke or scroll-on-output settings.

Open your GNOME Terminal. Look at the menu bar at the very top of the window (or click the hamburger menu icon in the top right) and select Preferences. In the left-hand sidebar of the preferences window, click on your active profile (usually named “Unnamed” or “Default”). Now, click on the Scrolling tab at the top of the right-hand panel. You will see two critical checkboxes: “Scroll on keystroke” and Scroll on output. Uncheck the box for Scroll on output. With this disabled, if you scroll up to examine a log line, the terminal view will remain locked in that exact position, even if the program continues to rapidly spit out new lines of code at the bottom of the buffer.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.