Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I keep flip flopping between tmux and screen, and right now I'm back on the tmux kick. I've been doing some setup for a friend, and I want to make a hard copy of the session so he can see the commands that I've run. I know this is possible in screen, but can I do it with tmux? The man page doesn't seem to have anything related to hardcopy...

share|improve this question

3 Answers 3

up vote 10 down vote accepted

It's not as simple as in screen, but it can be done with capture-pane and save-buffer. The example below will copy the contents of TARGET pane (or current pane if none is given) to the file ~/tmux.hardcopy:

tmux capture-pane -t TARGET \; save-buffer -b 0 ~/tmux.hardcopy H 

Optionally add it as a binding in tmux.conf, escaping the ";" as necessary:

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

As seen here.

share|improve this answer
    
@Moondoggy: The semi-colons should indeed be escaped, thanks. –  Thor Nov 8 '13 at 8:58
script

to start recording, and

exit

to exit the recording session. Tab-autocomplete and delete keys show up a little weird (^G, etc.), though.

share|improve this answer

Also, asciinema is a very nice terminal recorder (text only) that you can use with tmux (or any terminal) if you want to share online. It uploads to the asciinema site and gives a short link (which you can open with the "url" function in tmux).

It's very nice for tutoring, because beginners can follow the real-time typing more easily than a huge transcript.

It's on github: sickill/asciinema.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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