The dual-theme trick from v0.3.0 — one SVG carrying a light and a dark palette, switched by the viewer's prefers-color-scheme — now works for animated recordings too. One set of frames serves both palettes, so the dual file below costs 22 bytes more than its single-theme twin. If you're reading this in GitHub's dark mode it's already dark; flip your theme and it follows.
Highlights
- Animated dual-theme —
--theme-light github-light --theme-dark github-darknow works for.castinputs andrecsessions, not just stills. Frames are rendered once with palette classes and the colours live in a CSS block per theme, so a dual animation is ~100% the size of a single-theme one instead of double. - asciicast v3 — recordings from asciinema 3.0 load directly (v2 keeps working). v3 files embed the recording terminal's colours, so
-t autorenders a session with the palette of the terminal it was recorded in. - Trim the replay —
--from 12 --to 31animates just a slice of a recording. The first frame opens on the screen as of--from, so the lead-in is skipped, not fast-forwarded. - Cursor styles and reduced motion —
--cursor <block|bar|underline|none>picks the cursor shape, and every animated SVG now respectsprefers-reduced-motionby showing the final frame as a still poster. - Completions, man page, config file —
terminal-svg --completions zsh(and bash/fish/elvish/powershell), a generated man page, and personal defaults in~/.config/terminal-svg/config.toml— flags always beat the config, and typo'd keys fail loudly instead of silently doing nothing. - A
--helpworth reading — flags are grouped into the same sections as the docs (Output & themes, Window, Layout & fonts, Capture, Animation) with human value names and a set of examples at the bottom.
Existing invocations all keep working. Rendered output is unchanged apart from animated SVGs gaining the reduced-motion CSS block.
Install
brew install russmckendrick/tap/terminal-svg # or: brew upgrade terminal-svgOr grab a binary below (macOS arm64/amd64, Linux arm64/amd64, Windows amd64 — each with a SHA-256 checksum). rec is macOS/Linux only for now; rendering .cast files works everywhere.
Quick start
# an animated README demo that follows the viewer's light/dark mode
terminal-svg demo.cast --theme-light github-light --theme-dark github-dark
# render an asciinema 3 recording with its own terminal's colours
terminal-svg session.cast -t auto
# animate just the good bit
terminal-svg demo.cast --from 12 --to 31 -o highlight.svgDocs: README · CLI reference · theme format · how it works
Bundled JetBrainsMono Nerd Font faces are under the SIL OFL; the code is MIT.
Full Changelog: v0.3.0...v0.4.0