Create a screencast of your terminal session using Showterm

Sep 17, 2017 using tags terminal, screencast

If you haven’t already heard of showterm.io, highly recommend checking it out! Showterm uses a combination of script and a custom timer-file to record and play back your terminal session.

Because the underlying data is essentially plain text, the playback is done via a custom javascript library which in turn allows viewers to copy & paste (terminal) text as needed!

Start by installing the showterm Ruby gem.

$ gem install --no-rdoc --no-ri showterm

Now record a screencast of your terminal and hit ctrl+d when you’re done.

$ showterm
showterm recording. (Exit shell when done.)
# echo "Hey there! this is a showterm demo"
Hey there! this is a showterm demo
# 
showterm recording finished.
Uploading...
http://showterm.io/596a5f49a7a1cbc3aea3c

You may notice that it automatically uploaded the screencast to showterm.io. This may not be desirable if you have secret or private data you need redacted.

So this time let’s record a new screencast but we’re going to make sure we redact the secret data before the screencast gets uploaded to Showterm.

Initiate a new showterm session using the -e flag.

$ showterm -e
showterm recording. (Exit shell when done.)
# echo "The password is sekret"
The password is sekret
# 
showterm recording finished.
Recording done, now it's time to dress up those timings!             Hot vim tips:

Use :cq  from vim to exit nonzero, and cancel the upload
Use :%s/^[0-9]./0./  to get rid of all longish pauses.
[Hit Enter to edit]

Hit Enter when prompted. This will bring up vim to edit the timings file. Now exit vim with a non-zero status using :cq - this will effectively prevent the automatic upload.

OK, discarding edits and skipping upload.
your work is safe in "/tmp/showtime.18508.script" and "/tmp/showtime.18508.times"
To try uploading manually, use:
showterm --retry "/tmp/showtime.18508.script" "/tmp/showtime.18508.times"

Let’s edit the raw script file and redact our secret.

vi /tmp/showtime.18508.script

Finally, upload the screencast to Showterm.

$ showterm --retry "/tmp/showtime.18508.script" "/tmp/showtime.18508.times"
Uploading...
http://showterm.io/ef671a311d11ecfcd9560

Tip: Terminal Resizing

Resize your terminal window if you would like to control the uploaded dimensions of your screencast. The width and height can be controlled via the raw API but it does not appear possible to set these values through showterm gem options.