From 9638063359f08bd1c97037ad80b5fab230cdc3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Mon, 24 Apr 2023 12:30:41 +0200 Subject: [PATCH 1/2] fix #4477 --- css/xterm.css | 1 + 1 file changed, 1 insertion(+) diff --git a/css/xterm.css b/css/xterm.css index e9fd8153..2746016b 100644 --- a/css/xterm.css +++ b/css/xterm.css @@ -149,6 +149,7 @@ right: 0; z-index: 10; color: transparent; + pointer-events: none; } .xterm .live-region { From 0a101a01f5ef1f87e504dc09aee18c9d9b45ae07 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Tue, 2 May 2023 15:44:36 -0700 Subject: [PATCH 2/2] Clear whole cursor layer on Firefox Fixes #4487 --- addons/xterm-addon-canvas/src/CursorRenderLayer.ts | 6 ++++-- .../xterm-addon-webgl/src/renderLayer/CursorRenderLayer.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/xterm-addon-canvas/src/CursorRenderLayer.ts b/addons/xterm-addon-canvas/src/CursorRenderLayer.ts index cd05b36e..7efcd74e 100644 --- a/addons/xterm-addon-canvas/src/CursorRenderLayer.ts +++ b/addons/xterm-addon-canvas/src/CursorRenderLayer.ts @@ -13,6 +13,7 @@ import { IEventEmitter } from 'common/EventEmitter'; import { ICoreBrowserService, IThemeService } from 'browser/services/Services'; import { Terminal } from 'xterm'; import { toDisposable } from 'common/Lifecycle'; +import { isFirefox } from 'common/Platform'; interface ICursorState { x: number; @@ -190,8 +191,9 @@ export class CursorRenderLayer extends BaseRenderLayer { private _clearCursor(): void { if (this._state) { - // Avoid potential rounding errors when device pixel ratio is less than 1 - if (this._coreBrowserService.dpr < 1) { + // Avoid potential rounding errors when browser is Firefox (#4487) or device pixel ratio is + // less than 1 + if (isFirefox || this._coreBrowserService.dpr < 1) { this._clearAll(); } else { this._clearCells(this._state.x, this._state.y, this._state.width, 1); diff --git a/addons/xterm-addon-webgl/src/renderLayer/CursorRenderLayer.ts b/addons/xterm-addon-webgl/src/renderLayer/CursorRenderLayer.ts index 9830697c..c6a33a5c 100644 --- a/addons/xterm-addon-webgl/src/renderLayer/CursorRenderLayer.ts +++ b/addons/xterm-addon-webgl/src/renderLayer/CursorRenderLayer.ts @@ -12,6 +12,7 @@ import { IEventEmitter } from 'common/EventEmitter'; import { ICoreBrowserService, IThemeService } from 'browser/services/Services'; import { ICoreService, IOptionsService } from 'common/services/Services'; import { toDisposable } from 'common/Lifecycle'; +import { isFirefox } from 'common/Platform'; interface ICursorState { x: number; @@ -190,8 +191,9 @@ export class CursorRenderLayer extends BaseRenderLayer { private _clearCursor(): void { if (this._state) { - // Avoid potential rounding errors when device pixel ratio is less than 1 - if (this._coreBrowserService.dpr < 1) { + // Avoid potential rounding errors when browser is Firefox (#4487) or device pixel ratio is + // less than 1 + if (isFirefox || this._coreBrowserService.dpr < 1) { this._clearAll(); } else { this._clearCells(this._state.x, this._state.y, this._state.width, 1);