Asciinema: natural typing timing?

Created on 30 Jul 2017  ·  3Comments  ·  Source: asciinema/asciinema

I asked myself whether there already is a tool that can postprocess a asciinema json to make it look like manually typed in.

A borgbackup contributor recently made new asciinema recordings and he found a nice way to enter a lot of text, avoiding typos:

He first entered them into the shell (without asciinema recording it) and then, while asciinema was recording, he just used some autocompletion/history recall feature of the shell so he just needed to manually type the first few characters and then the rest was completed from the shell's memory.

While that is a nice hack, it has one drawback: the first few chars look manually typed and then whoosh all the rest of that line comes in in a blast. Looks strange and also speed-wise sometimes difficult to read / follow.

One issue with such a post-processing might be to actually know what was echoed from the keyboard and what was output generated by the shell - is there some way to know that?

Most helpful comment

I was thinking about something similar where we could define the commands to be executed in a file and pass it to asciinema with a parameter as time transition in order to record it without to play the scenario manually

All 3 comments

I was wondering the same question a time ago. I wrote some JSON filters with jq to "normalize" delays in the recording. Check #157. I'm not sure I can find my scripts now, but I was going recently to use asciinema again, so I'll be interested in this issue again.

Anyway, if there are any ready to use tools already, I'd be glad to know too.

One could indeed build a tool which could tell echoed text from generated text. It would require asciinema recorder to also capture stdin (in addition to stdout) and store it in the recording file. We don't have it now but it wouldn't be hard to implement it (and we're discussing asciicast v2 format now, considering stdin to be optionally saved).

@ThomasWaldmann I use borg, it's fantastic, great work! And it was nice to see asciinema used in borg's docs 😍

I was thinking about something similar where we could define the commands to be executed in a file and pass it to asciinema with a parameter as time transition in order to record it without to play the scenario manually

Was this page helpful?
0 / 5 - 0 ratings