@xterm/addon-image 0.10.0-beta.164 → 0.10.0-beta.165

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xterm/addon-image",
3
- "version": "0.10.0-beta.164",
3
+ "version": "0.10.0-beta.165",
4
4
  "author": {
5
5
  "name": "The xterm.js authors",
6
6
  "url": "https://xtermjs.org/"
@@ -27,8 +27,8 @@
27
27
  "sixel": "^0.16.0",
28
28
  "xterm-wasm-parts": "^0.3.0"
29
29
  },
30
- "commit": "0b6220e5ea00f429e5fb991922d4ae2c0a2aea10",
30
+ "commit": "d99e6bb2bc6d2c3003673b822b8d8072eb51dd44",
31
31
  "peerDependencies": {
32
- "@xterm/xterm": "^6.1.0-beta.164"
32
+ "@xterm/xterm": "^6.1.0-beta.165"
33
33
  }
34
34
  }
@@ -340,19 +340,22 @@ export class ImageRenderer extends Disposable implements IDisposable {
340
340
  );
341
341
  canvas.classList.add(`xterm-image-layer-${layer}`);
342
342
  const screenElement = this._terminal._core.screenElement;
343
+ // Use isolation to create a stacking context without overriding z-index,
344
+ // which would conflict with integrators (e.g. VS Code) that set their
345
+ // own z-index on the screen element.
346
+ screenElement.style.isolation = 'isolate';
343
347
  if (layer === 'bottom') {
344
348
  // Use z-index:-1 so it paints behind non-positioned text elements.
345
- // The screen element needs to be a stacking context to contain the
346
- // negative z-index, otherwise it would go behind the entire terminal.
349
+ // The screen element needs to be a stacking context (via isolation)
350
+ // to contain the negative z-index, otherwise it would go behind the
351
+ // entire terminal.
347
352
  canvas.style.zIndex = '-1';
348
- screenElement.style.zIndex = '0';
349
353
  screenElement.insertBefore(canvas, screenElement.firstChild);
350
354
  } else {
351
355
  // Explicit z-index ensures the image canvas reliably stacks above
352
356
  // the text layer (DOM renderer rows). z-index: 0 is below the
353
357
  // selection overlay (z-index: 1).
354
358
  canvas.style.zIndex = '0';
355
- screenElement.style.zIndex = '0';
356
359
  screenElement.appendChild(canvas);
357
360
  }
358
361
  const ctx = canvas.getContext('2d', { alpha: true, desynchronized: true });