k9withabone / autocast

Automate terminal demos
https://crates.io/crates/autocast
GNU General Public License v3.0
75 stars 4 forks source link

Would this work with PowerSession-rs? #3

Closed nmstoker closed 8 months ago

nmstoker commented 8 months ago

I haven't got a firm handle on how autocast gets the results it does, so perhaps this is a naive question, but would this tool possibly work with the repo https://github.com/Watfaq/PowerSession-rs which is an asciinema clone able to run on Windows?


Thanks a lot for this tool - I realised the need for something exactly like this when I started trying to set up a range of asciinema recordings recently for documentation I was sprucing up.

k9withabone commented 8 months ago

Autocast theoretically should work just fine on Windows. I haven't really tested this though as I don't use Windows myself anymore.

Autocast doesn't use asciinema under the hood. It creates an asciicast file directly by starting a shell in a PTY using the expectrl library, then by running commands via the started shell. Bash is used as the default, so you'll have to customize the shell configuration to get autocast to work on Windows. See the full-example.yaml file, starting at line 24, for configuring the shell. The bash defaults are set here in the code if that helps.

If you get something working let me know, and I'll add it as a --shell option. However, it might just be easier to just use WSL.

The asciicast files autocast creates should work just fine with Power Session, assuming it has kept up with the semi-recent additions to the format, notably the marker event type if you use the !Marker instruction.

By the way, asciinema is currently being rewritten in Rust. So maybe it will work on Windows at some point?

nmstoker commented 8 months ago

Thanks! Really appreciate the answer with all those handy pointers.

I'll see what I can come up with!

Good point re: asciicast being rewritten too.