loading...

Terminal split-screen recording with asciinema + screen

noandrea profile image Andrea Giacobino ・1 min read

While showcasing geo2tz I wanted to record both client and server on the same asciinema video.

Luckily you can do just that using screen.

I'm assuming at this point that you have installed both asciinema and screen and that you are on linux.

Before you start, add this line layout save default in your ~/.screenrc

Next setup your screen session so when you are about to record the screen will be already set:

screen -R devto 

Once there execute this sequence of keystrokes (case sensitive):

  • ctrl + a + S // split horizontally
  • ctrl + a + Tab // move to the bottom window
  • ctrl + a + c // open a new shell
  • ctrl + a + Tab // move back to the top window
  • ctrl + a + d // detach (but not close) the session

pro tip, for maximum effect you can set the windows name with ctrl + a + A

Now that the stage is ready you can start recording:

asciinema rec -c "screen -R devto"

Here is how it looks like:

if you don't see the embed, follow this link to the video.

Do you know another way of doing this, maybe with tmux?

Discussion

pic
Editor guide