# Create new tmux session for recording
$ tmux new-session -s recording-studio
# Run the resize-window command to set tmux window to good size for recording
:resize-window -y 24 -x 80
# Set the prompt to something very simple
# For Bash, I like:
$ PS1='\\$ '
# For Zsh, I like:
$ PROMPT='$ '
We can record a terminal session directory with Asciinema. However, as detailed here it can be helpful to discard timing information if your typing is inconsistent or you need to pause and look something up during recording. scriptreplay_ng is the only tool I’ve found that allows you to discard timing information. This makes each keystroke appear at a consistent interval and makes for a more polished presentation.
Steps:
-
Install scriptreplay_ng if you haven’t already install script
-
Record the session:
$ record-script-session <session name>
# Do what you want to record
$ ...
# Ctrl-D to exit
Sometimes it’s necessary to convert the terminal record into a format that can be viewed anywhere.
The asciinema agg
tool converts asciinema recordings into animated GIFs. The generated GIF file
can then be converted to another format like MP4.
Steps:
-
Install asciinema/agg.
-
Run
agg <ASCIINEMA FILE> <OUTPUT GIF FILE>
with any options you want.
I’ve found the following options to be good:
agg --font-size 21 --rows 20 --theme asciinema --speed 1.3