Skip to content

chore(deps): bump @xterm/* to beta.213 to pick up overview ruler dispose fix#313817

Merged
bryanchen-d merged 2 commits into
mainfrom
bryanchen-d/bump-xterm-overview-ruler-fix
May 4, 2026
Merged

chore(deps): bump @xterm/* to beta.213 to pick up overview ruler dispose fix#313817
bryanchen-d merged 2 commits into
mainfrom
bryanchen-d/bump-xterm-overview-ruler-fix

Conversation

@bryanchen-d
Copy link
Copy Markdown
Contributor

Fixes #303546

What

Bumps all @xterm/* dependencies (root, remote/, and remote/web/) to beta.213 (webgl to beta.212, the latest published). Previously pinned at beta.197 / beta.196.

Why

#303546 (Cannot read properties of undefined (reading ''dimensions'')) is caused by a race in xterm.js OverviewRulerRenderer: a requestAnimationFrame queued by _queueRefresh could fire after the renderer was disposed, ending up in RenderService.get dimensions() which does return this._renderer.value!.dimensions;_renderer.value is undefined post-dispose, hence the TypeError.

The upstream fix is xtermjs/xterm.js#5826 / commit 08ae141 "Improve overview ruler lifecycle":

  • Adds if (this._store.isDisposed || !this._renderService.hasRenderer()) return; guards to _refreshCanvasDimensions and _refreshDecorations.
  • Cancels the pending requestAnimationFrame via a toDisposable registered on the renderer''s store.
  • Adds an early-return in _queueRefresh and an isDisposed re-check inside the rAF callback.

That fix shipped in @xterm/xterm@6.1.0-beta.198. We were pinned at beta.197, so this issue has continued to be reported against 1.115 → 1.118.1 (~5M+ hits in 1.118.1 alone across the four related buckets).

Related buckets

Bucket Note
8612c55d tracked since 1.112.0
4826565b ~444K hits / 216K users at 1.113.0
1e83a096 ~370K hits / 98.5K users at 1.113.0
aaa283a2 seen in 1.115.0+

How to test

  • npm install at the workspace root, run a dev build, open an integrated terminal, exercise terminal lifecycle (open / close / split / window resize / DPR change).
  • Telemetry: monitor the four bucket IDs above on the next stable release; expected to drop to zero new occurrences.

Risk

  • Pure dependency bump — no source changes. Diff is exclusively the version pins and corresponding package-lock.json updates in the three lockfiles.
  • xterm.js master 2026-04-062026-05-01 covered. Notable changes are lifecycle/perf hardening (7a6e724, 08ae141, 0911688) with no public API change. Image addon defaults were tweaked (41938b3); flag if a compatibility concern.
  • extensions/copilot/package.json still pins @xterm/headless@^5.5.0 — left untouched (stable major, unrelated).

Written by Copilot

…ose fix

Picks up xterm.js commit 08ae141 (xtermjs/xterm.js#5826) which adds dispose / hasRenderer guards in OverviewRulerRenderer and cancels its pending requestAnimationFrame on dispose. This addresses the long-standing 'Cannot read properties of undefined (reading ''dimensions'')' crash tracked in #303546.
Copilot AI review requested due to automatic review settings May 1, 2026 23:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repo’s xterm.js dependency set to pick up the upstream OverviewRuler dispose/rAF race fix that caused Cannot read properties of undefined (reading 'dimensions') in terminal lifecycle scenarios.

Changes:

  • Bump @xterm/xterm and related @xterm/* addons to 6.1.0-beta.213 / *-beta.213 across root, remote/, and remote/web/.
  • Keep @xterm/addon-webgl on 0.20.0-beta.212 (latest published) while aligning its peer dependency range with @xterm/xterm@beta.213.
  • Update the corresponding package-lock.json files to reflect the new resolved tarballs and integrity hashes.
Show a summary per file
File Description
package.json Bumps root @xterm/* dependency versions (webgl to beta.212; others to beta.213).
package-lock.json Updates root lock entries/resolutions for the bumped @xterm/* packages.
remote/package.json Bumps remote/ @xterm/* dependency versions to match root.
remote/package-lock.json Updates remote/ lock entries/resolutions for the bumped @xterm/* packages.
remote/web/package.json Bumps remote/web/ @xterm/* dependency versions to match root (no headless here).
remote/web/package-lock.json Updates remote/web/ lock entries/resolutions for the bumped @xterm/* packages.

Copilot's findings

Files not reviewed (2)
  • remote/package-lock.json: Language not supported
  • remote/web/package-lock.json: Language not supported
  • Files reviewed: 3/6 changed files
  • Comments generated: 0

@bryanchen-d bryanchen-d requested a review from anthonykim1 May 1, 2026 23:16
@bryanchen-d bryanchen-d marked this pull request as ready for review May 1, 2026 23:16
@anthonykim1
Copy link
Copy Markdown
Contributor

Lets merge this Monday

@bryanchen-d bryanchen-d enabled auto-merge May 4, 2026 20:11
@bryanchen-d bryanchen-d merged commit a2d447b into main May 4, 2026
25 of 27 checks passed
@bryanchen-d bryanchen-d deleted the bryanchen-d/bump-xterm-overview-ruler-fix branch May 4, 2026 20:20
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 4, 2026
bryanchen-d added a commit that referenced this pull request May 7, 2026
After bumping xterm.js to beta.213 (#313817), three error buckets keep firing the same Cannot read properties of undefined (reading 'dimensions') TypeError on the latest insider builds (1.120.0-insider 79d6cea / 0aed0a9):

- aaa283a2 - resize -> _resizeYCallback -> _updatePtyDimensions, triggered by config-change -> setVisible -> _resize. - 4826565b - debounced _debounceResizeX timer firing after the renderer is gone. - 1e83a096 - _onProcessExit -> dispose -> setVisible(false) -> _resize -> _resizeBothCallback.

All three reach RenderService.get dimensions() in xterm.js, which dereferences this._renderer.value (undefined post-dispose) and throws synchronously. The optional chaining on rawXterm.dimensions doesn't help because the getter itself throws.

The upstream beta.213 fix added isDisposed guards at the OverviewRuler call sites, not inside the getter, so the correct symmetrical fix here is to guard the call sites that VS Code owns:

* terminalInstance.ts: bail out of the resize closures and _updatePtyDimensions when the instance is already disposed; defensively wrap the dimensions read in try/catch so a future renderer-dispose race fails silently instead of bubbling as an unhandled error.

* terminalResizeDebouncer.ts: bail out of resize/flush and the runWhenWindowIdle / @debounce-scheduled callbacks when the debouncer's store is disposed - the @debounce decorator schedules a setTimeout that isn't tied to the disposable store.

Refs #303546, #313817
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.

[Unhandled Error] Uncaught TypeError: Cannot read properties of undefined (reading 'dimensions')

3 participants