Skip to content

Render a blank renderer right away while paused - #6240

Open
Bokjan wants to merge 1 commit into
xtermjs:masterfrom
Bokjan:paused-blank-render
Open

Bokjan wants to merge 1 commit into
xtermjs:masterfrom
Bokjan:paused-blank-render

Conversation

@Bokjan

@Bokjan Bokjan commented Oct 17, 2026

Copy link
Copy Markdown

Fixes #6239.

While a terminal is paused, RenderService defers refreshes until the IntersectionObserver reports it back on screen, which happens after the first frame it is visible in is painted. That's harmless while the canvas still holds the last frame, but it leaves the terminal blank for that frame when the renderer has nothing to show:

  • setRenderer while paused: the new renderer starts out empty. Apps that keep the WebGL renderer only for visible terminals, to stay within the WebGL context limit, do this whenever a terminal is shown.
  • A sync redraw while paused: Force a sync render after resize occurs #5529 asks for one when the WebGL addon's ResizeObserver resizes the canvas, which clears it, but refreshRows dropped it while paused.

Both now render synchronously while paused: refreshRows with sync runs the paused resize and renders, still marking a full refresh for when rendering resumes, and setRenderer renders right away when paused. Other refreshes still wait for the pause to end.

Verification

  • npm run test-unit, with the new RenderService.test.ts: while paused, a new renderer and a sync redraw (after a paused resize) render right away, and other refreshes wait for the observer; while not paused, a new renderer renders on the next frame. The first two fail without the change.
  • npm run lint-changes
  • The repro from the issue, built against this branch and against master, in Chrome 155 on Windows 11, recording each frame with Page.startScreencast: in 6 switches each, master showed 6 blank frames at pixel ratios of 1 and 1.75, this branch none.

🤖 Generated with Claude Code

While paused, RenderService defers refreshes until the IntersectionObserver reports the terminal back on screen, a frame after it is visible. A new renderer set while paused, or a sync redraw requested after its canvas was cleared, then showed the terminal blank for that frame. Both now render synchronously while paused.

Fixes xtermjs#6239

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal is blank for a frame when a renderer is set while the render service is paused

1 participant