In your .tmux.conf file you can set the window history with something like:

set -g history-limit 4096

Is there a way to set an unlimited history for each window?


Do NOT set it to something like:

set -g history-limit 999999999

This will pre-allocate that many lines (and hence memory) for all windows, which is going to cripple your machine the more history is stored over time.

Set it to something large, by all means but not THIS large.

| improve this answer | |
  • Thanks, this is good to know. I guess you just have to balance the size with comfort that everything you dump will be there. – kenny Dec 18 '13 at 21:18
  • 2
    Looks like the time is comming where we need to do actual benchmarks :-) – Volker Siegel Jun 20 '14 at 15:00
  • 8
    Ha, I did a comparison, starting tmux with either of the history-limit values; Memory is the same after start, so tmux does not preallocate the scrollback buffer. (Of course, that does not solve the practical problem) – Volker Siegel Jun 20 '14 at 16:07
  • 2
    I found another interesting investigation into tmux's memory usage at blog.42.be/2015/02/tmux-memory-usage-on-linux.html – Silveri Aug 13 '15 at 7:44
  • 1
    To sum up @Silveri's link: tmux had a bug, as it did not release its buffers. Fixed. (as of google group and also merged if I did not misunderstand github.com/42wim/tmux/network) – serv-inc Apr 18 '16 at 13:25

From what I can tell, you can only do this in a "practical" fashion, by setting the history to an absurdly large number. e.g.:

set -g history-limit 999999999

UPDATE: see the other answer as to why you don't want to use a number this high. Something more reasonable (less 9's) would be best.

UPDATE again: perhaps pre-allocation doesn't occur. @Volker Siegel's comment on the other answer indicates that setting the value does not cause memory allocation.

| improve this answer | |
  • See warning in the answer of @ThomasAdam. – Volker Siegel Jun 19 '14 at 10:32
  • See my comment on his answer. :) – kenny Jun 20 '14 at 13:54
  • @kenny how do you know its set? is there a way to query the currently active limit on tmux? – Rika Aug 3 at 2:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.