brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: set -g history-limit 50000 gives every pane a much longer scrollback

Tmux
~/tips/tip-tmux-history-limit

set -g history-limit 50000

Raises how many lines each tmux pane remembers, so long output is still there when you scroll back.

The default scrollback is 2000 lines, which a chatty build log finishes in seconds.

set -g history-limit 50000

Add it to ~/.tmux.conf before you create the session. Copy mode and search then reach much further back.

Two thousand lines sounds like plenty until you run a build or a container log. A busy command can write that in a few seconds, and then the start of the output is gone for good. Setting the limit higher is the cheapest improvement in the whole config.

Memory is the cost, and it is per pane, so there is a limit to how far it is sensible to go. 50000 lines is a comfortable number for most people. You can check the current value with tmux show -gv history-limit and you can set it for a single session with tmux set -t work history-limit 100000 if one job needs more.

The limit applies to panes created after the change, not to ones that already exist.

Try it without risk: start a throwaway session with tmux new -s scratch, use the shortcut or command above there, look at what changes, and close the session again with tmux kill-session -t scratch. Nothing else on your machine is touched.

Further reading: tmux manual page (OpenBSD, official), tmux wiki: Getting Started (official), On this site: tmux capture-pane -p dumps a pane's scrollback to a file, On this site: tmux capture-pane -p dumps the pane's text to stdout

More Tmux tips tmux new -d -s report -x 200 -y 50 'top' tmux wait-for build-done set -g allow-passthrough on tmux kill-server Ctrl-b [ All Tmux tips (125) All topics

Link