Skip to content

fix(desktop): guard terminal ResizeObserver against feedback loop#610

Draft
skevetter wants to merge 1 commit into
mainfrom
fix/terminal-resizeobserver-guard
Draft

fix(desktop): guard terminal ResizeObserver against feedback loop#610
skevetter wants to merge 1 commit into
mainfrom
fix/terminal-resizeobserver-guard

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

Defensive hardening for the terminal ResizeObserver. The callback previously called fitAddon.fit(), term.refresh(), and the terminalResize IPC unconditionally on every fire. Because fit() mutates the terminal's dimensions, it can re-fire the observer — the classic ResizeObserver feedback loop that can recompute every frame under an oscillating layout and sustain high CPU.

Track the last propagated cols/rows and early-return when the grid size is unchanged. fit() still runs so layout stays correct, but refresh()/IPC only fire on a genuine size change.

Notes

Split out of #609 (renderer freeze while streaming logs). This change is unrelated to that freeze and is purely preventive — no confirmed reproduction of a ResizeObserver loop.

The ResizeObserver callback unconditionally called fit(), refresh(), and
the terminalResize IPC on every fire. Since fit() mutates the terminal's
dimensions, it could re-fire the observer, sustaining a frame-rate loop
that pins the renderer main thread at 100% CPU and freezes the window.

Track the last propagated cols/rows and early-return when the grid size
is unchanged, so the loop can no longer sustain itself.
@netlify

netlify Bot commented Jul 6, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 32f9638
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a4c2ec8c333c50008ed72d1

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6186eea9-fac1-4683-8d57-7e9e2235be1e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Jul 6, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh ready!

Name Link
🔨 Latest commit 32f9638
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a4c2ec960185200085f4407
😎 Deploy Preview https://deploy-preview-610--images-devsy-sh.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant