Uh oh!
There was an error while loading. Please reload this page.
fix(tui): make mini resize replay opt-in (v2) - #37974
Conversation
Port of the dev-branch change to the v2 mini. Terminal resize wiped the screen and saved scrollback, refetched the session, and reprinted every message on every SIGWINCH. Resize replay only benefits terminals that do not reflow scrollback, so it is now gated behind RunInput.resizeReplay (default off); resume replay and reconnect hydration are unchanged. With the replay off, a widening resize during streaming skipped content; the active scrollback entry now restarts in a fresh surface on widen and narrowing re-emits only the wrap seam.
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
The following comment was made by an LLM, it may be inaccurate: Potential Related PR Found:
Why they're related: PR #37973 implements the same fix but for These are not duplicates — they're complementary PRs addressing the same issue in two separate mini implementations. |
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes#37971
Same change as #37973, ported to the v2 mini (
packages/tui/src/mini/).Type of change
What does this PR do?
Problem. Same as #37973: every terminal resize wiped the screen and saved scrollback, refetched the session, and reprinted it; a widening resize during streaming dropped output.
Fix. Resize replay is gated behind
RunInput.resizeReplay, default off (no CLI flag here, the opencode2 CLI wires mini options separately). Mid-stream resizes are handled in the scrollback surface: narrowing re-emits the wrap seam, widening restarts the active entry.Why gate it instead of deleting it. The mechanism has one legitimate use, terminals that do not reflow scrollback (essentially plain xterm today; measurements in #37971), so it stays available without everyone else paying for it by default. Resume replay, reconnect hydration, and the session-switch reset are unchanged.
How did you verify your code works?
bun typecheck+bun test test/minifrompackages/tui: 183 tests, 0 fail. New tests: resize replays only when opted in; mid-stream narrow/widen behavior.Screenshots / recordings
Behavior is identical to the recordings in #37973.
Checklist