Skip to content

Fix terminal height after delayed display metric changes - #200

Draft
glenn-jocher wants to merge 1 commit into
mainfrom
fix/display-resize
Draft

glenn-jocher wants to merge 1 commit into
mainfrom
fix/display-resize

Conversation

@glenn-jocher

@glenn-jocher glenn-jocher commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

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, and git diff --check pass. 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.

@UltralyticsAssistant UltralyticsAssistant added bug Something isn't working fixed Bug has been resolved labels Sep 24, 2026
@UltralyticsAssistant

Copy link
Copy Markdown
Member

👋 Hello @glenn-jocher, thank you for submitting a ultralytics/lite 🚀 PR! This automated message confirms your contribution was received, and an Ultralytics engineer will assist with the review. To ensure a seamless integration of your work, please review the following checklist:

  • ✅ Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions.
  • ✅ Synchronize with Source: Confirm your PR is synchronized with the ultralytics/lite main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
  • ✅ Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
  • ✅ Update Documentation: Update the relevant documentation for any new or modified features.
  • ✅ Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
  • ✅ Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR by writing "I have read the CLA Document and I sign the CLA" in a new message.
  • ✅ Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

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 UltralyticsAssistant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fixed Bug has been resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants