#mmm actually I'm executing `asciinema`,
1 messages ยท Page 1 of 1 (latest)
ah okay, im mildly surprised it doesn't work, would have thought exec containers still get /dev/ptmx, but maybe they don't or something else is going wrong. If it's giving you any specific error msg that could be helpful
It's a particularly gnarly container. I take an arbitrary target container, then inject the asciinema binary + needed libraries
I was actually surprised it executed at all
But I may mess something up in the process
I'm so close though... I can accurately generate animated gifs of running any dagger command in any container... It's pretty sweet ๐ I'm just missing the TUI
I have a "simple mode" that is more reliable. It just captures the full output the usual way. Then simulates keystrokes + output. But you lose all timing information (all output drops at the same time)
Actually I get one little piece of the TUI ("initializing") then nothing. super weird
dagger call -m github.com/shykes/daggerverse/termcast \
exec --cmd 'dagger call -m github.com/kpenfound/dagger-modules/ruff check --directory=https://github.com/ollama/ollama-python' \
gif export --path=ruff.gif
huh, yeah, that's weird... especially if asciinema can record the TUI when not in a dagger exec
The only thing that comes to mind is if the pty asciinema allocates has too small a window size or something? i had to adjust the window size in the automated tests for dagger ... terminal. But just a wild guess
cc @lethal plume
yea that was gonna be my guess ๐
Ah, I'll try explicitly setting the dimensions in the asciinema call (had to do that anyway)
If you try running this, you'll see the "can't allocate pty" message in the output
By the way you can replace gif export by play, it will return a Terminal that will replay the recording directly from dagger call, it's pretty neat ๐
dagger call -m github.com/shykes/daggerverse/termcast keystrokes --data 'Well hello there!' enter wait --ms=3000 play
@lethal plume any idea why the first line "initialize" renders fine, then nothing?
Anything special about that line?
nope, that's why I figured it might just be the window size isn't set if you're doing any custom pty stuff
could see if --debug changes anything (since it should reveal the contents of initialize)
haha it's pretty neat!
you're using asciinema internally? or vhs?
i saw vhs had recent progress on that weird fast-forwarded-recording issue I ran into (https://github.com/charmbracelet/vhs/issues/88)
For most commands I actually just generate the asciicast file directly
Then use agg to generate gifs, or asciinema to replay
But specifically for the exec() function which actually executes something, and specifically when "simple mode" is disabled (need to allocate a tty and record each byte going through it with timestampt): then yeah I use asciinema directly
There's also an imagine() function which is just OpenAI generating an asciicast file ๐
Also I let you mix and match all of those. So you can combine manually crafted fake output; running real commands; and AI-generated outputs
Mmm weird, calling my hello function seems to record fine?
dagger call -m github.com/shykes/daggerverse/termcast \
exec --cmd 'dagger call --debug -m github.com/shykes/daggerverse/hello hello --giant' \
wait --ms 3000 \
gif export --path hello.gif
Oh maybe the explicit term size fixed it?
nice, yea maybe. I think we would have to be explicitly setting a sane default window size, otherwise (in Dagger or Buildkit)