Long output in a tmux pane can move out of view before a build, log stream, or test run finishes. Increasing the pane history limit gives copy mode and capture-pane more retained lines to inspect after the command has already scrolled past the visible terminal.
Tmux controls retained pane history with the history-limit option. The setting is commonly placed in ~/.tmux.conf with set -g so new windows inherit the larger limit, then loaded into the running server with source-file.
Raise the limit before starting output-heavy work. Increasing history-limit changes how much history tmux keeps from that point onward, but it cannot restore lines that were already discarded from a busy pane. For output that must be archived while it is produced, use a live pane log instead of relying only on retained history.
Related: How to use copy mode in tmux
Related: How to save tmux scrollback to a file
Related: How to enable output logging in tmux
Related: How to reload the tmux config
$ tmux show-options -g history-limit history-limit 2000
The value is the maximum number of lines tmux keeps in each pane history buffer before older lines are discarded.
$ vi ~/.tmux.conf
Most setups use ~/.tmux.conf. If the server was started from $XDG_CONFIG_HOME/tmux/tmux.conf or ~/.config/tmux/tmux.conf, edit that file and source the same path later.
set -g history-limit 20000
set -g writes the global value tmux uses for windows that do not have their own local override.
Pick a number that matches the output you need to review. Very large limits consume more memory in sessions with many busy panes.
$ tmux source-file ~/.tmux.conf
No output means tmux accepted the file and applied the setting to the running server.
Related: How to reload the tmux config
$ tmux show-options -g history-limit history-limit 20000
$ tmux set-option -g history-limit 20000
This command is useful for a temporary adjustment or for testing the value before keeping it in ~/.tmux.conf. Save the line in the config file when the larger scrollback should survive a server restart.
$ tmux capture-pane -p -S - -t work:0.0 history-line-001 history-line-002 ##### snipped history-line-069 history-line-070
Replace work:0.0 with the session, window, and pane you want to inspect. The -S - argument starts capture at the oldest retained history line, so missing early lines usually mean the pane produced more output than the configured limit could keep.
Ctrl-b [
Use PageUp, PageDown, search, or the configured copy-mode key table to review the retained history.
Related: How to use copy mode in tmux