I am using the following line in tmux for getting a "hardcopy" feature like in GNU Screen:

bind H capture-pane \; save-buffer -b 0 ~/tmux.hardcopy \; delete-buffer -b 0

However, the ANSI colors are not captured to the file. How do I make tmux save the ANSI escape sequences so that the hardcopy will be colored too?

1 Answer 1


tmux 1.8 added the -e option to capture-pane; using this new option causes the captured data to include the effective escape sequences.

bind H capture-pane -e \; save-buffer ~/tmux.hardcopy \; delete-buffer

(You can omit -b 0 since buffer 0 is the default buffer if one is not specified.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .