Skip to content

fix(tui): reconcile terminal size before inline redraws - #408

Merged
srothgan merged 3 commits into
mainfrom
fix/407-inline-chat-resize
Oct 2, 2026
Merged

srothgan merged 3 commits into
mainfrom
fix/407-inline-chat-resize

Conversation

@srothgan

@srothgan srothgan commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Summary

Route live terminal size changes through the existing resize handler before rebuilding or drawing a surface. Inline chat draws use the recorded size, preserving the purge/replay decision and the existing checks for a resize during drawing.

Include the existing CLAUDE_CONFIG_DIR support as a separate prerequisite commit so the real terminal regression test uses an isolated profile for settings, trust, and file credentials.

Why

When the terminal grows taller during a streamed reply, drawing could record the new size before the resize event arrived. The resize handler then classified that event as unchanged, skipped the required purge/replay, and allowed the viewport to outgrow the owned region, causing the app to exit.

Closes #407.

Validation

  • Automated: Real claude-rs binary in a PTY with a deterministic fixture bridge: stream 1,500 lines, alternate between 87×38 and 87×55 for 200 resizes, verify the completed reply and a subsequent prompt on the rendered screen, and exit through Ctrl+Q with status zero. The test uses an existing terminal parser and cleans up its child on failure.
  • Automated: All 1,984 tests pass with cargo test --all-features --quiet on Windows. Formatting, Clippy with warnings denied, locked dependency fetching, dependency policy/advisories, and duplicate-code checks pass. Rust 1.88.0 also passes checks with all features and all targets.
  • Manual: macOS/tmux reproduction from the issue has not been verified in this Windows workspace.
  • Screenshot/video: N/A.

Notes

  • Breaking changes: N/A.
  • Docs updated: Document the selected profile paths in docs/src/settings.md.
  • Governance/release impact: N/A.
  • The terminal fixture uses no model or subscription requests. Bun or Node must be available on PATH.

- centralize Claude profile path resolution
- use the selected profile for settings, trust, and file credentials
- resolve auto memory under the selected configuration directory
- add profile isolation regression coverage and documentation
- route live size changes through resize handling before surface rebuilds
- keep inline draws on the recorded size to preserve purge and replay decisions
- cover streaming, 200 PTY resizes, subsequent input, and graceful shutdown
@srothgan srothgan added type: fix Fixes a bug or regression area: tui Terminal UI, rendering, input, and keymap area: core App lifecycle, runtime, agent, and session core labels Oct 2, 2026
- stream a short follow-up reply from the fake bridge so its start marker stays in the visible viewport
- set the follow-up length explicitly in the terminal resize test
- fix the Ubuntu failure where a slower debug build drew the marker and scrolled it off between screen polls
@srothgan
srothgan merged commit 7732578 into main Oct 2, 2026
17 checks passed
@srothgan
srothgan deleted the fix/407-inline-chat-resize branch October 2, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core App lifecycle, runtime, agent, and session core area: tui Terminal UI, rendering, input, and keymap type: fix Fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Inline chat exits when the terminal grows taller during a streamed reply

1 participant