DEV Community

Andrea Giacobino
Andrea Giacobino

Posted on

Terminal split-screen recording with asciinema + screen

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 
Enter fullscreen mode Exit fullscreen mode

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"
Enter fullscreen mode Exit fullscreen mode

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?

Top comments (0)