Skip to content

krpors/ttyasc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ttyasc

A simple ttyrec file to asciinema transformer.

  1. Record a terminal session using ttyrec.
  2. Run ttyasc on the produced file.
  3. Redirect the stdout to a file.
  4. Play the file using the asciinema player.

Why?

I was bored a bit, and wanted to write something in C. I discovered asciinema a while ago, and it reminded me of the ttyrec program. I decided to write a translator to adhere to a part the Unix philosophy:

"Make each program do one thing well. [...]

Since ttyrec does the job well, I felt like writing a simple transformer from that format to the one asciinema accepts (which is JSON).

Compiling

The program is written without external dependencies or whatever, so simply running make will do the trick. It will produce one binary, called ttyasc. To make a static executable, run the static target using make static.

Running

Run ttyrec to record a terminal session. Hit ^D when done. This will create a file ttyrecord by default. Now run the ttyasc binary:

$ ttyasc ./ttyrecord

On the stdout it will print out a JSON structure. This can be used in the asciinema player by simply redirecting the output to a file.

$ ttyasc ./ttyrecord > output_somewhere.json

That's all there is to it.

About

ttyrec to asciinema translator

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published