Show HN: Rewindtty – Record and replay terminal sessions as structured JSON

4 days ago (github.com)

Hi HN,

I built rewindtty, a small tool in C that lets you record a terminal session and later replay it, using a simple JSON log format that includes:

- timestamp - command (user input) - output (stdout) - stderr

It works like this:

- rewindtty record session.json # Runs a shell, records the session - rewindtty replay session.json # Replays it step by step

Under the hood:

- Uses fork() to manage the pseudo-terminal - Captures stdout/stderr with timestamps - Stores everything in structured JSON for easy analysis, replay or transformation

Why I made this: I wanted a minimal tool to track terminal interactions — for debugging, documentation, and reproducibility — without relying on heavier tools or external formats.

It’s still early, but the core works and I’d love feedback or suggestions.

GitHub: https://github.com/debba/rewindtty

  • You have scratched a long persistent itch. Good work!

    And I love that you used c. Nothing against rust, or (ahem) “go”, but it’s good to see you doing something in c!

    • Yeah, it’s just a side project for now, but I’m hoping to make it more solid over time. As for C, I wanted to challenge myself and step away from what I usually do — try something a bit different.

On github, I see an asciinema tag, but no explanation of the differences?

  • It's not related to asciinema, it's a totally different project. Asciinema is a much more complex and structured project than mine; mine is the result of a few hours of free time—I was looking for a lighter solution.

Have you made an online demo for the browser player? I guess it will have potential uses in tutorials

  • Not for now. That's a side project and it is really new and still a bit rough around the edges; it’s only a few days old. I’ll do it soon, meanwhile if you want to contribute you’re welcome :)

Is this ttyrec with json output?