Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asciicast Output #109

Open
rsteube opened this issue Oct 30, 2022 · 3 comments
Open

Asciicast Output #109

rsteube opened this issue Oct 30, 2022 · 3 comments

Comments

@rsteube
Copy link

rsteube commented Oct 30, 2022

This is probably out of scope but would be nice to have asciicast output (Output: out.cast).
I initally wanted gif for the readme and asciicast for the mdbook documentation but then decided against gif due to it's size.
Managed to record it by simply spawning an asciinema recording within tmux.
Keeping size in sync with the other outputs could be challenge but there are also gif, svg,.. generators available for asciicast.
It might even provide an alternative to the chrome dependency (which pushes my cpu to the limit).

Hide
Type "tmux"
Enter
Type "tmux resize-window -x 108 -y 24"
Enter
Type "asciinema rec --overwrite out.cast"
Enter
Sleep 1s
Show

# ...

Hide
Type "exit"
Enter
Show

Example

Source: https://github.com/rsteube/carapace-bin/blob/18ca32ea6093b965e4949a13ccce85f9108ca65c/carapace-bin.tape

Asciicast

asciicast

Gif

GIF output with agg (ignore the missing symbols, didn't get the font right)

agg --font-family "RobotoMono Nerd Font Mono,Noto Color Emoji"  carapace-bin.cast out.gif

out

Svg

SVG output with svg-term-cli (nice output but high load for playing it)

cat carapace-bin.cast | svg-term --out out.svg

out

related #105

@maaslalani
Copy link
Contributor

This is quite interesting @rsteube, nice work and really clever stuff.

There is definitely something here. Would be really cool to remove the dependency on the browser all together and make terminal GIFs purely in the terminal eventually 😄

@maxandersen
Copy link

The .svg format would be the bomb. Lets you copy/paste the commands shown.

@drupol
Copy link

drupol commented Nov 5, 2023

I'm also looking for this !

Thanks @rsteube for the snippet ! I use it and it works very well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants