Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Byobu - Fix Scrolling Issue

If you've noticed that using your mouse wheel to scroll up in your terminal to view "the past" appears to not work correctly, then there is a simple solution.

Manually select "tmux" as the backend by entering the following command:

byobu-select-backend

You should see:

Select the byobu backend:
  1. tmux
  2. screen

Select 1 to choose tmux and you should be sorted. If you cannot use tmux and have to use screen, then you can get by with pressing f7 before scrolling.

Using Screen Scroll

To prevent byobu constantly scrolling to the bottom when you are in the MySQL CLI etc, then you can trigger the screen/tmux scrolling back by pressing f7 and then using the up and down arrow keys.

To escape from the scrolling mode, press ctrl-c.

By default, the scrollback buffer will be 10k (ignoring whatever your terminal client is set to). If you wish to change this do one of the following (depending on whether you have configured byobu to use tmux or screen).

Tmux Users

Edit the $HOME/.byobu/.tmux.conf file (which may be empty).

Add/edit the line like below with the number of lines you want. For example, this will set it to 20k lines.

set-option -g history-limit 20000

Log out and in again for the change to take effect.

Screen Users

Edit the $HOME/.byobu/.screenrc file (which may be empty).

Add/edit the line like below with the number of lines you want. For example, this will set it to 20k lines.

defscrollback 20000

Log out and in again for the change to take effect.

References

Last updated: 15th November 2022
First published: 16th August 2018

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch