GitHub - micromaomao/ts-player: A terminal recorder that produces files capable of efficient random access

2 min read Original article ↗

ts-player: Flexible terminal recorder

demo screencast

Building & Installing

Via AUR:

ts-player

Build from source:

go get -v -d
make
./ts-player

Features

  • Jump around recordings instantly, even for hours/days long recordings.
  • Produce recording files that are easy to parse randomly -- just like a video except you get text.
    • Clips, crops, text replacement, and other transformations are in principle easy to do. (TODO?)
    • Format spec (uses protobuf)
  • Index and encode recordings produced with the script command to this format.
  • Corruption / crash recovery
  • Bake color profile into recordings / play back recordings with any color profile of your choice. (I'm speaking of things like "xterm" or "solarized")
  • Render recordings to video (arbitrary resolution / font) with ffmpeg

Motivation

I record all my terminal activities, and I used to do this with script:
screenshot
However, it is hard to replay and manage (can't easily jump around, produce GiBs of files). I knew of asciinema but a client-server setup just don't feel right. That's one motivation behind this project.

Another one is simply to learn how the Linux terminal works (recommended article), and also, how to do concurrency with Go.

I might come up with yet another useless project when I decide to learn Rust.

Things involved

Color profiles?

They can be generated for the current terminal simply by running ts-player get-color-profile. You get something like this:

Just take a screenshot of it in png format. The file can then be passed into the -c parameter.

Yes. ts-player scans the image for the black-purple color pattern.

Planning TODOs

  • JavaScript player
  • Index recording content for fast text search
  • Test Mac support & support Windows?