Because checking some of the Debian patches accrued against ttyrec, and the source to rewindtty, it seems that rewindtty does not have some of the common programming mistakes that the author of ttyrec made a quarter of a century ago.
* https://sources.debian.org/src/ttyrec/1.1.7.1-1/debian/patch...
* https://github.com/debba/rewindtty/blob/develop/src/recorder...
* https://github.com/mjording/ttyrec/blob/master/ttyrec.c#L328
rewindtty will error out if the SHELL environment variable's value does not have a directory prefix, but at least it won't outright crash. (-:
debba•3d ago
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
sunscream89•3d ago
And I love that you used c. Nothing against rust, or (ahem) “go”, but it’s good to see you doing something in c!
debba•3d ago