zot/internal
patriceckhart 8b4b62f240 tui: suppress \x1b[3J scrollback-clear on VS Code's terminal
VS Code's integrated terminal (xterm.js) interprets the
erase-in-display-3 escape (\x1b[3J) as "drop scrollback rows AND
snap the viewport to the top of the remaining buffer." Once the
user has reopened a terminal with VS Code's persistent-sessions
feature on, there is real replayed scrollback above the live
cursor, so the snap is visible: the host scrollbar yanks to the
top on every full repaint — first paint, Ctrl+L (Renderer.Clear),
and any writeFull(true) shrink.

Every other terminal we tested (iTerm, Ghostty, Kitty, Alacritty,
Apple Terminal) treats \x1b[3J as "drop scrollback rows without
moving the viewport," which is what we want.

Detect VS Code (and Cursor, which shares xterm.js) via
$TERM_PROGRAM == "vscode" in NewRenderer and stash the result on
the Renderer as keepScrollback. Gate all three emission sites
(resize handler, Clear(), writeFull(true)) through a single
helper clearScrollbackSeq() that returns "" when keepScrollback
is true and SeqClearScrollback otherwise.

Trade-off on VS Code: stale zot frames remain visible if you
scroll up in the terminal's scrollback. Strictly less disruptive
than the scrollbar yanking on every Ctrl+L, and limited to the
one terminal that actually has the bug.
2026-05-13 10:37:48 +02:00
..
agent agent: add 'zot update' subcommand for in-place self-update 2026-05-12 21:27:11 +02:00
assets assets: refresh zot logo to cleaner pixel-art Z 2026-04-20 12:01:43 +02:00
auth add deepseek provider (api-key, openai-compatible v4 catalog) 2026-05-10 16:49:31 +02:00
core Persist compaction checkpoints in sessions 2026-05-09 23:02:54 +02:00
extproto feat(ext): interactive extension panels + persistence 2026-04-22 08:53:21 +02:00
provider add deepseek provider (api-key, openai-compatible v4 catalog) 2026-05-10 16:49:31 +02:00
skills perf(prompt): cut system prompt to the bone (410 -> 54 tokens) 2026-04-19 17:39:38 +02:00
tui tui: suppress \x1b[3J scrollback-clear on VS Code's terminal 2026-05-13 10:37:48 +02:00