DEV Community

Andrea Giacobino
Andrea Giacobino

Posted on

2 2

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?

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay