As an editor, I try to improve answers (often by trimming) without conflicting with author intent. However, I came across an answer that could not be shortened as much as I would like, so I posted another one.
How can I write all the scrollback in a tmux session to a file?
From the manual:
‘-’ to -S is the start of the history.
tmux capture-pane -pS - > file
This will "write all the scrollback in a tmux" pane.
For all pane's in the session, you can try to loop through all the panes with
tmux list-panes -s ...
If that's what you needed, I might update this answer.
My new answer:
tmux capture-pane -pS - > tmux.log
I think the succinctness makes the answer easier to find and use.
To risk a loaded question: are short, minimal, but complete answers not valuable?
EDIT: I have deleted my former answer and edited the other answer instead. The proposed edit looks better than I thought it would. Perhaps there are better case studies of this situation.