Hi there! If you’re anything like me, you love using Tmux for your terminal sessions, but sometimes you may run into the issue of not being able to scroll back far enough in your history. This can be a real roadblock when you’re trying to debug a program or review some lengthy output. Don’t worry, I’ve got your back! Today, we’re going to look at how to increase the scrollback buffer size of Tmux. So, buckle up and let’s dive right in!
Just starting out with Tmux? Don’t miss out on the Tmux basics. Seasoned with Tmux? Let’s take the plunge!
Increase Tmux Scroll History Limit
The default tmux scrollback buffer size is set to 2000 as default value. This scrollback limit of 2000 is set during the pane creation and cannot be changed within for existing panes. The value is taken from the history-limit
session option.
To create a pane with a different value or to increase the limit, you will need to set the appropriate history-limit
option before creating the pane.
You can insert the following line in your ~/.tmux.conf
file-
set-option -g history-limit <number>
Details of the above command-
set-option
is used to set the config in .tmux.conf
-g
refers that it is a global config. history-limit
is the maximum number of lines of history <number>
is the value
You can insert it using a direct shortcut-
echo "set-option -g history-limit 10000" >> ~/.tmux.conf
You have to reload changes in tmux config tmux.conf
so that it reflects-
tmux source-file ~/.tmux.conf
OR
You can insert the line either by opening the file using vim-
vim ~/.tmux.conf
and then insert it in ~/.tmux.conf
–
set-option -g history-limit 10000
You have to reload changes in tmux config tmux.conf
so that it reflects-
tmux source-file ~/.tmux.conf
OR
You can insert the line either by opening the file using nano-
nano ~/.tmux.conf
and then insert it in ~/.tmux.conf
–
set-option -g history-limit 10000
You have to reload changes in tmux config tmux.conf
so that it reflects-
tmux source-file ~/.tmux.conf
You can also clear your tmux history to make it look afresh.
Set the value of the history-limit
as per your convenience and use-case. You can set it to 10000 or 20000 or even 50000.
And voila! You’ve successfully learned how to increase the scrollback buffer size in Tmux. No more frustration over lost command lines or inability to review your output. Remember, mastering tools like Tmux is all about knowing these little tweaks that make your life so much easier. So keep exploring, keep learning, and most importantly, keep coding! Till next time.
You can also check out the complete tmux cheatsheet of keyboard shortcuts and mouse shortcuts.