digego / extempore

A cyber-physical programming environment
1.41k stars 127 forks source link

Record and replay a coding session #408

Closed fetsorn closed 2 years ago

fetsorn commented 2 years ago

Is there a common way to record and replay keystrokes to reproduce an extempore coding session? I have yet to find a FOSS that can record keystrokes with delays and replay them. Emacs macros don't record original delays, vscode's Codio appears to be broken, asciinema only works in the terminal, macos' Automator doesn't record original delays either.

benswift commented 2 years ago

Hey there

There's no standard way - no. Mostly because that's an editor-level thing. Vanilla Emacs doesn't have the fidelity that you need (as you noted), but packages might. Same for the other editors.

The other option might be to run Emacs in a terminal and use something like this? But I haven't tried it really.

To be honest, when I need a record of things I normally just do a reasonably hi-fi screencap (which does require a slightly beefier machine). And the fact that the exact keystrokes are lost is part of the fun ephemerality of livecoding :)

fetsorn commented 2 years ago

I see, thanks for a reply.

A note on asciinema since you haven't tried it. AFAIK, if you run Emacs in a terminal and use asciinema, it will record and replay stdout, but it won't reenact the inputs or reproduce the sound of extempore. Still, asciinema produces a screen recording with selectable text, which you can publish alongside the screencap. And it outputs a .cast file with timestamps of inputs, which can perhaps be useful for self-analysis.

Closing this since the question was answered, will come back if I have any luck with Codio or Elisp.

benswift commented 2 years ago

One other note on this - years ago I wrote up a little keylogger minor mode - you can see it here.

The goal was to have something (in Emacs) which captured timestamped keystrokes, extempore evals & other commands. It was hacky & gross, and it sortof worked, but I eventually abandoned that type of "record & replay" approach for the "just record the video & the source is lost to time" thing I mentioned above. But you're welcome to pinch any of it.