Open hjmallon opened 6 years ago
Jep, sounds like a good idea. Want to lend a hand?
It's as good an excuse as any to learn some more Javascript, I can have a poke around soon hopefully.
It's as good an excuse as any to learn some more Javascript, I can have a poke around soon hopefully.
👍 That is very nice of you, thanks!
You'll want to have a look at the following lines that start the asciinema
child process.
They'll look something like:
const result = await execa("asciinema", [
"rec",
"-c",
cmd,
...(options.title ? ["-t", options.title] : []),
...(typeof options.maxWait === number ? ["--max-wait", options.maxWait] : [])
tmp
]);
This changes also requires the addition of maxWait?: number;
to RecordOptions
.
asciinema
expects --max-wait
in seconds, while svg-term-cli
uses milliseconds, so the record
option will look like this:
record(cli.flags.command, {
maxWait: typeof cli.flags.maxWait === "number" ? cli.flags.maxWait * 1000 : cli.flags.maxWait
})
I was actually talking about using a json file recorded by asciinema itself. But I see that tying it in here would be useful.
I reported a similar issue here: https://github.com/asciinema/asciicast2gif/issues/34 It was fixed by a commit (and new version bump) here: https://github.com/asciinema/asciinema-player/commit/5c922c8aa9dc4963fae01b71edd2a0542e922883
Maybe if https://github.com/marionebl/load-asciicast pulled it's submodule of asciiema-player up to v2.6.1 then at least the json might work.
This is all hearsay and suspicion as I have not got the build environment set up here yet, so pinch of salt required.
Ok, that is interesting. Could you point to an asciicast
that is affected?
Also I tried again today (reinstall from npm) and I assume that pulling the submodules up in the other repo has fixed this.
It works great now. Feel free to close this unless you want to keep it open for adding CLI support for this feature?
As long as you update load-asciicast library to use latest asciinema-player it will automatically handle idle_time_limit
saved in the asciicast, and adjust timing properly. (asciicast/load ...)
function also allows passing idle-time-limit value in case you want to override it / provide it from the command line.
Btw, I've set up a discussion forum for asciinema: https://discourse.asciinema.org/ , where I'd be happy to discuss this and any other asciinema/asciicast related topics 👋
Asciicast version 2 files have a setting for 'idle_time_limit'. This is meant to compresses time differences bigger than the set amount. It is handy for making clean demos. svg-term-cli is not respecting that field currently.