Skip to content

feat: add opt-in sixel image capture - #783

Open
jchook wants to merge 2 commits into
charmbracelet:mainfrom
jchook:fix/sixel-recording
Open

jchook wants to merge 2 commits into
charmbracelet:mainfrom
jchook:fix/sixel-recording

Conversation

@jchook

@jchook jchook commented Sep 7, 2026

Copy link
Copy Markdown

VHS enables sixel in ttyd but omits the image canvas when capturing frames. Set Sixel true now captures that layer and includes it in videos, screenshots, and exported frames. It defaults to false, following the performance concern in #43 (comment).

The addon creates and removes its canvas as images enter and leave the screen. Capture queries and reads the current canvas in one browser evaluation, writes transparent frames when it is absent, and scales image pixels to the text canvas dimensions when needed. FFmpeg overlays text, image, then cursor. Loop offsets move all layers and update screenshot references.

The first commit fixes a prerequisite regression: Evaluate canceled its recording context before passing it to FFmpeg, producing no output files. Recording now uses a child context while rendering retains the parent. The new end-to-end output test failed before that fix and passes with it.

Related to #43; completes the image-capture step described in #137.

Standalone example

Run vhs examples/sixel.tape from the repository root. The tape emits sixel using shell printf; it needs no image encoder or ttyd fork.

Sixel capture

@jchook
jchook marked this pull request as ready for review September 7, 2026 07:55
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

Successfully merging this pull request may close these issues.

1 participant