asciinema / discussions

Public open-ended discussions about asciinema
https://github.com/orgs/asciinema/discussions
1 stars 2 forks source link

Parse typescript into raw format #77

Closed hyiltiz closed 1 year ago

hyiltiz commented 4 years ago

It would be awesome to import/parse/play the typescript output generated by script. typescript seems to contain tons of escape sequences and colors that is not recognized by less.

ku1ik commented 3 years ago

It would be... :)

In fact asciinema was inspired by the very script / scriptreplay commands!

The thing is, script on macOS doesn't support saving timing information, this only works on Linux. So this is not portable solution. Also, typescript on Linux saves the timing info in a separate file, so that makes the format even less portable as one would need to either upload 2 files for a single recording to asciinema.org site, or wrap them in a tarball or sth like that.

I'm still open for discussing support for typescript files locally, for local playback.

hyiltiz commented 3 years ago

It doesn't have to be natively supported, i.e., directly uploading them to asciinema.org. Something like --import or --convert that locally converts them should be enough. If the user is satisfied with the result, they can easily upload that converted file to the site.

Whenever the timing info is available (like in Linux), the converter/importer can use it. When it is not available, maybe an option like --stroke-per-second with some default value might be enough. Thoughts?

FranklinYu commented 2 years ago

I’m also interested in this.

My use case is that, when I’m upgrading across macOS major versions, I need to reinstall all MacPorts packages (a.k.a. “ports”). I installed asciinema via MacPorts, so I can’t use asciinema itself for recording. Another use-case is when I upgrade my Debian server from Buster (old-stable) to Bullseye (current stable).

The thing is, script on macOS doesn't support saving timing information, this only works on Linux. So this is not portable solution.

Actually this is only half-true. The macOS script is indeed very different from the Linux one, so we need platform-specific code. That said, on macOS one can specify -r flag to record the timestamp into the same file.

FranklinYu commented 2 years ago

I found https://gist.github.com/izabera/223f58d20be61911e62b but it’s super old (in 2015), so I assume it’s not working.