DHO is Mostly Confused

Rants from Devon H. O'Dell

CasTTY: Screencast your Terminal

An internet-friend has been encouraging me to put together some material to help teach people stuff about software engineering in C and POSIX environments. I’ve been wanting to do this sort of thing for some time, but the tools are always really obtuse. You have some application that captures a window and makes a video, but then nobody can really interact with the text.

But then I remembered that ttyrec was a thing. I’ve used it before (mostly to watch NetHack games), but hadn’t thought much of using it as a tool for education. A few hours of work pulling together a bunch of other peoples’ hard work, and I ended up with CasTTY.

CasTTY is a stripped-down version of ttyrec (in particular, it doesn’t care so much about portability) that aims to make creating educational “videos” easy. It comes with code to “record” a TTY and simultaneously records audio. Where ttyrec just spits out some 32 bit integers with time offsets and terminal sequences, CasTTY spits out some Javascript containing basically the same information. Audio is recorded using PortAudio.

The player combines xterm.js, rangeslider.js, jQuery, and all the new-fangled HTML5 audio stuff to make an immutable (but copy-buffer-friendly) player. I’m hoping to use this in the near term to make some slightly-interactive tutorials on programming and debugging.

Putting this together was a snap, but I’d like to give another hat-tip to the developers of all the software I cobbled together for this project. Without their software, I probably wouldn’t have done this at all.

There are still bugs and numerous features I’d like to implement, but I want to get some experience using it first. I was thinking of doing a dive into the CasTTY code as a first example of how it works – but other suggestions are welcomed!

Finally, if you’d like to contribute, there are plenty of ideas for ways to take the code. I’d especially appreciate help with the UI-side of things. I’m not very good at making things look very good.

Enjoy!

More Posts