fix(tui): clear terminal on resize to prevent ghost separator lines#23034
fix(tui): clear terminal on resize to prevent ghost separator lines#23034KhanCold wants to merge 1 commit into
Conversation
Fixes NousResearch#22976 Ink's VDOM reconciliation does not handle terminal geometry changes. Old separator lines accumulate. This adds a raw ANSI clear sequence to the resize handler.
|
This PR addresses one specific symptom of a broader issue: the CLI/TUI does not reflow content on terminal resize. There are 34+ open bugs about various manifestations of this problem. I've opened a tracking feature request (#24164) that proposes a comprehensive solution — a SIGWINCH handler triggering full re-render at new viewport dimensions, comparable to how opencode and Claude Code handle resize smoothly. If this PR gets merged, please consider whether the underlying architecture supports full reflow, or if we still need a systematic fix. The tracking issue consolidates all related work: |
|
Closing as superseded — the Ink renderer already handles this atomically inside the alt-screen path. |
Problem
When the terminal is resized while the TUI is running, Ink's VDOM reconciliation does not handle geometry changes. Old separator lines (──────) accumulate on screen, creating visual garbage.
Solution
Add a raw ANSI escape sequence (
\x1b[2J\x1b[H) to the resize handler to clear the terminal before Ink re-renders. This is a targeted fix that does not affect normal rendering.Testing
Fixes #22976