Fix terminal height after delayed display metric changes - #200
glenn-jocher wants to merge 1 commit into
Conversation
|
👋 Hello @glenn-jocher, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Reviewed the terminal resize observer change and its cleanup path. Observing xterm’s element alongside the container routes its size changes through the existing debounced fit/PTY resize owner, and the shared observer is disconnected on cleanup. LGTM.
Tracking issue: #201
On hold after independent Claude Code review: this change fixes a synthetic delayed-metrics scenario, but does not establish a fix for the reported display-disconnect bug. The user confirms that manual window resizing, font zoom, and switching sessions all fail to repair it. Both delayed measurements and a missed visibility notification have counterevidence. Further review found the screenshot cannot conclusively distinguish stale rendering/scroll state from blank trailing buffer rows. The real cause remains unverified; do not merge this candidate as the reported bug fix.
After a display transition, xterm can update its cell measurements after Lite has fitted the terminal to its container. The container stays the same size, so its observer does not refit the grid and the rendered terminal can occupy only part of the pane.
Observe xterm’s element with the existing debounced ResizeObserver as well as the container. Rendered size changes now reach the same fit/PTY resize owner; existing observer cleanup covers both targets.
Validation:
bun run check,bun test(32 passing),bun run build, andgit diff --checkpass. An external harness executing the actual resize-owner code reproduced a 480px terminal in a 976px pane after a delayed cell-size change before the fix, then verified fitting with the fix in desktop WebKit and Chromium. Covered foreground/background terminals, alternate screens, shrink/grow transitions, resize-command dimensions, and no repeated fits on idle/output. The harness uses simulated late cell measurements and a stubbed native resize command; a physical Studio Display disconnect remains unverified.