Record an interactive session until it exits (asciinema rec-style record) #5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
recordonly captures a non-interactive command. It creates a session runningsh -c <command>, and stops when no frame arrives for--idle-ms(default 700 ms) or when--max-ms(default 5 s) is reached (docs/reference/cli.md:15-35). A demo that someone types by hand cannot be recorded this way:attached id=…(src/main.rs,record), so another tool cannot reliably drive it withfelis sessions send.--idle-msbetween keystrokes ends the recording.--max-msis too short for an interactive demo.What is missing is the
asciinema recworkflow: run one command, use a shell normally,exit, and get a.fcast. felis-reel then turns that into a video, so the two tools split cleanly into "record by hand" and "render".Proposal
An interactive mode for
record, e.g.felis fcast record demo.fcast [-- cmd...]:$SHELL(orcmd) and attach the recorder in the same round trip as today, so the rehydrate burst is not lost.$FELIS_SESSION_IDis set), move the current window onto the new session withfelis sessions switch;felis attach <id>..fcast. The window unwinds back along its trail (felis/docs/reference/cli.md, "Window launches"), i.e. to the session it was switched from.felis already provides the parts this needs:
felis/docs/explanation/architecture/session-lifecycle.md, "Window-size negotiation"). The recorder never sends input, so the window the user types in sets the grid. Resizes during the session end up in the recording, and felis-reel already renders a recording that resizes mid-session (felis-reel#8).switchplus the trail unwind brings the window back without the recorder having to manage it.Changes in
record--idle-msand--max-msand records until the session exits.recordneeds to observe the session's end, which it currently does not.recordcurrently buffers every frame in memory and writes the file at the end. An interactive recording can be long, so write each frame as it arrives. A crash then still leaves a valid prefix.--socketbecomes optional and defaults to the user's daemon, the onefelisitself dials.To decide
--interactive.--commandkeeps today's non-interactive behavior either way.switchdoes unwind back to the original session on exit. The trail rule suggests it does. This has not been tried.No explanation doc covers
recordyet. This decision would start one (for exampledocs/explanation/record.md), with the non-interactive mode and the rejected alternatives recorded there.Status after the felis-cast v1 rework (PR #8):
felis-cast(felis cast record), and the envelope isfelis-castv1.recorddials pull-paced; the daemon closes the connection once the recorded session exits, and the recorder now treats that (including a pull that fails on the closed socket) as the end of the recording instead of an error. Interactive mode can stop on that alone.--idle-ms/--max-msin interactive mode, defaulting--socketto the user's daemon, and the CLI shape.format.mdline references in the description predate the rewrite; the unit rules (docs/reference/format.md"Units") now constrain what an interactive recording writes.