Skip to content

Instantly share code, notes, and snippets.

@worldofprasanna
Last active December 14, 2024 10:19
Show Gist options
  • Save worldofprasanna/1861b182103cef452ec58471679a7e5b to your computer and use it in GitHub Desktop.
Save worldofprasanna/1861b182103cef452ec58471679a7e5b to your computer and use it in GitHub Desktop.
Multiple screen terminal capture using asciinema & tmux

Commands Reference

  1. Start a new tmux named session tmux new -s terminal-capture
  2. Split the screen using these commands,
  • vertical split <C-b>"
  • horizontal split <C-b>%
  1. To navigate between the panes,
  • To goto Left pane <C-b> left-key
  • To goto Right pane <C-b> right-key
  • To goto Top pane <C-b> up-key
  • To goto Down pane <C-b> down-key
  1. Detach the session tmux <C-b>+d
  2. Record the tmux session with asciinema asciinema rec -c "tmux attach -t terminal-capture"
  3. Detach the tmux session, save the recording and convert it into gif
  4. Enjoy !!!
@ryderstorm
Copy link

Excellent guide, thanks for writing this up!

@worldofprasanna
Copy link
Author

Excellent guide, thanks for writing this up!

Thank you !!

@djgoldsmith
Copy link

Thanks for this, saved me having to work it out myself.

@pesader
Copy link

pesader commented Feb 15, 2021

Awesome, thanks for this!

@iamjjanga-ouo
Copy link

thanks!! So helpful!

@Timmmm
Copy link

Timmmm commented Jun 9, 2021

This was really helpful. To clarify, C-b means Ctrl-b (even on Mac). And step 6, "Detach the tmux session" - you can press Ctrl-b d again and it will stop the recording; you don't need to exit tmux.

Also I found there is a bug with iTerm2 where it doesn't render anything except the first frame of recordings, after you've made a tmux recording. But if you exit the shell and start a new one it plays fine. Anyway I recommend using Apple's Terminal app for this rather than iTerm2.

@worldofprasanna
Copy link
Author

This was really helpful. To clarify, C-b means Ctrl-b (even on Mac). And step 6, "Detach the tmux session" - you can press Ctrl-b d again and it will stop the recording; you don't need to exit tmux.

Also I found there is a bug with iTerm2 where it doesn't render anything except the first frame of recordings, after you've made a tmux recording. But if you exit the shell and start a new one it plays fine. Anyway I recommend using Apple's Terminal app for this rather than iTerm2.

Thanks for the extra tips @Timmmm 👍

@rewanthtammana
Copy link

Beautiful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment