Is your feature request related to a problem? Please describe.
A tape often documents a sequence of steps (install → configure → run → verify) that I'd like to embed as separate short clips in different places (per-step README sections, tutorial pages, docs). Today VHS emits exactly one artifact per Output, so the only options are:
- Copy the tape into N separate files — duplicating
Set blocks, prompts, and any prerequisite state, and letting them diverge over time.
- Post-process the single artifact with ffmpeg using hand-counted timestamps — which drift every time I edit the tape.
Both fight against the "one tape = one reproducible session" model that makes VHS pleasant to use.
Describe the solution you'd like
A new Split "<path>" command that closes the current video segment at the point it's executed and writes it to the given file. The extension picks the encoder path (.mp4 / .gif / .webm), matching how Output already works.
Output all.mp4 # optional: full recording still emitted
Type "brew install foo"
Enter
Sleep 2s
Split "install.mp4"
Type "foo configure"
Enter
Sleep 1s
Split "configure.gif"
Type "foo run"
Enter
Sleep 1s
Split "run.webm"
Semantics:
- Frames captured since the previous
Split (or since recording started) form one segment.
- Segments can mix formats.
Split and Output are independent — you can have neither, either, or both.
- Works cleanly with
Hide/Show: Hide-period frames are not captured, so they don't affect segment boundaries.
- Boundaries are frame-exact and non-overlapping, so they don't drift on tape edits.
Describe alternatives you've considered
- Multiple
Output lines — would redefine "final file for the whole tape" to also mean "chapter delimiter", breaking existing tapes.
- Post-process with ffmpeg
-ss/-to — works but timestamps drift every time the tape is edited (add a Sleep and everything shifts).
- Multiple tape files sharing state via
Source — each tape still needs its own Set header and there's no clean way to preserve terminal state (cwd, env vars, running processes) across tape boundaries.
Additional context
I have a working prototype in a fork: tsuzu/vhs @ feat/split-command. Diff is ~170 lines across parser, executor, and render; all existing tests pass.
Is your feature request related to a problem? Please describe.
A tape often documents a sequence of steps (install → configure → run → verify) that I'd like to embed as separate short clips in different places (per-step README sections, tutorial pages, docs). Today VHS emits exactly one artifact per
Output, so the only options are:Setblocks, prompts, and any prerequisite state, and letting them diverge over time.Both fight against the "one tape = one reproducible session" model that makes VHS pleasant to use.
Describe the solution you'd like
A new
Split "<path>"command that closes the current video segment at the point it's executed and writes it to the given file. The extension picks the encoder path (.mp4/.gif/.webm), matching howOutputalready works.Semantics:
Split(or since recording started) form one segment.SplitandOutputare independent — you can have neither, either, or both.Hide/Show: Hide-period frames are not captured, so they don't affect segment boundaries.Describe alternatives you've considered
Outputlines — would redefine "final file for the whole tape" to also mean "chapter delimiter", breaking existing tapes.-ss/-to— works but timestamps drift every time the tape is edited (add aSleepand everything shifts).Source— each tape still needs its ownSetheader and there's no clean way to preserve terminal state (cwd, env vars, running processes) across tape boundaries.Additional context
I have a working prototype in a fork: tsuzu/vhs @
feat/split-command. Diff is ~170 lines across parser, executor, and render; all existing tests pass.