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?


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.)

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.