General documentation / cheat sheets for various languages and services


Saving scrollback to a file

(Assuming Ctrl-b is your “prefix” (Ctrl-b is the default)…)

  1. Type Ctrl-b + : to enter tmux’s command mode, and enter capture-pane -S -2000, which copies the previous (up to) 2000 lines into an internal buffer.

    If you’ve reconfigured your session’s history-limit to be longer than 2000 (which is the default) you may want to increase the -2000 argument.

  2. Type Ctrl-b + : to get back into command mode, and enter save-buffer ~/current-tmux-scrollback.log, which will write that internal buffer to the file at ~/current-tmux-scrollback.log.

    Evidently, tmux’s working directory is /, so it’s best to use an absolute path, such as ~/....