get the contents of specified window and pane.


$ tmux capture-pane -t 0:0.0
$ tmux show-buffer

-t option specifies a pane of some window of some session as <session id>:<window id>.<pane id>.
captured contents is bufferd and it can be shown by show-buffer.