sumi
Chapters

Terminal support

Sumi drives the terminal with a small set of widely-implemented escape sequences and is designed to degrade gracefully: every capability below is either ignored harmlessly by terminals that lack it, or has a legacy fallback that sumi keeps active at all times.

Sequences sumi emits

CapabilitySequence(s)Fallback when unsupported
Alternate screenCSI ?1049h / CSI ?1049lnone (fullscreen apps assume it)
Cursor visibilityCSI ?25l / CSI ?25hcosmetic
Bracketed pasteCSI ?2004h / CSI ?2004lpaste arrives as keystrokes
SGR mouse + any-eventCSI ?1006h CSI ?1003hno mouse events; keyboard still works
Kitty keyboard (flag 1)CSI >1u push / CSI <u popignored; legacy key encoding decoded as always
Synchronized outputCSI ?2026h / CSI ?2026l around framesignored; frames may tear
Clipboard writeOSC 52 ;c;<base64> BEL (plus pbcopy / wl-copy / xclip / clip)platform tool alone
Colour-scheme probeOSC 11 ;? BELdark scheme assumed
Window titleOSC 2, CSI 22;2t / CSI 23;2t save/restoreignored
CellsCUP + SGR (truecolor, 256, or 16 per detected depth)depth quantized at emission

Sequences sumi decodes

Legacy CSI keys (arrows, Home/End, ~ extendeds, F1–F12 incl. SS3 and modifier params), kitty CSI <codepoint>;<mods>u key reports, SGR mouse (CSI <…M/m), bracketed paste, OSC 11 colour reports, and the modifier bitmask+1 encoding shared by both key paths.

Terminal matrix

”✓” = works with sumi’s sequences; ”–” = capability missing but sumi degrades as described above.

TerminalKitty keysOSC 52Sync outputSGR mouseOSC 11
kitty
Ghostty
WezTerm
iTerm2 (3.5+)
Alacritty (0.13+)
foot
Terminal.app
tmux (3.3+)pass-through¹needs set-clipboard²outer terminal

¹ tmux forwards kitty-protocol sequences when extended-keys is enabled; otherwise sumi’s legacy decoding applies. ² set -s set-clipboard on lets tmux forward OSC 52 to the outer terminal.

CI round-trip verification

runtime/tui/roundtrip_test.go runs real apps against injected streams and replays every emitted byte through the in-repo terminal model (runtime/vt100), asserting the reconstructed screen — content, styles, and diffed updates — matches the intended frame. The model is kept in sync with the sequences sumi emits (it consumes private-marker CSI, OSC, and SGR forms), so any new emission that a terminal parser would misread fails CI immediately.