From cba6e3d191cb1418dad76aaaa3d589996ed9f823 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Tue, 3 Feb 2026 15:49:07 -0800 Subject: [PATCH 1/3] Add api to expose screenElement --- src/browser/public/Terminal.ts | 1 + test/playwright/TestUtils.ts | 1 + typings/xterm.d.ts | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/src/browser/public/Terminal.ts b/src/browser/public/Terminal.ts index 4a77fd4a..f25da387 100644 --- a/src/browser/public/Terminal.ts +++ b/src/browser/public/Terminal.ts @@ -83,6 +83,7 @@ export class Terminal extends Disposable implements ITerminalApi { public get onDimensionsChange(): IEvent { return this._core.onDimensionsChange; } public get element(): HTMLElement | undefined { return this._core.element; } + public get screenElement(): HTMLElement | undefined { return this._core.screenElement; } public get parser(): IParser { return this._parser ??= new ParserApi(this._core); } diff --git a/test/playwright/TestUtils.ts b/test/playwright/TestUtils.ts index 59bcc1e8..f1569d41 100644 --- a/test/playwright/TestUtils.ts +++ b/test/playwright/TestUtils.ts @@ -115,6 +115,7 @@ type TerminalProxyAsyncMethodOverrides = 'hasSelection' | 'getSelection' | 'getS type TerminalProxyCustomOverrides = 'buffer' | 'dimensions' | ( // The below are not implemented yet 'element' | + 'screenElement' | 'textarea' | 'markers' | 'unicode' | diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 62de0ab2..5f645ee8 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -911,6 +911,12 @@ declare module '@xterm/xterm' { */ readonly element: HTMLElement | undefined; + /** + * The screen element containing the terminal's canvas rendering layers and decorations, + * excluding the viewport and the scrollbar. + */ + readonly screenElement: HTMLElement | undefined; + /** * The textarea that accepts input for the terminal. */ From 32e77c3b8111c05eda14ecb4e87b1ab6af0c7560 Mon Sep 17 00:00:00 2001 From: Anthony Kim Date: Tue, 3 Feb 2026 23:24:57 -0800 Subject: [PATCH 2/3] Lint --- typings/xterm.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 5f645ee8..4bc4c148 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -912,8 +912,8 @@ declare module '@xterm/xterm' { readonly element: HTMLElement | undefined; /** - * The screen element containing the terminal's canvas rendering layers and decorations, - * excluding the viewport and the scrollbar. + * The screen element containing the terminal's canvas rendering layers + * and decorations, excluding the viewport and the scrollbar. */ readonly screenElement: HTMLElement | undefined; From b0d0bf81871541506f7279ecc03fdb64c19c75a2 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 4 Feb 2026 04:32:37 -0800 Subject: [PATCH 3/3] Update typings/xterm.d.ts --- typings/xterm.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 4bc4c148..39b0d592 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -912,9 +912,9 @@ declare module '@xterm/xterm' { readonly element: HTMLElement | undefined; /** - * The screen element containing the terminal's canvas rendering layers - * and decorations, excluding the viewport and the scrollbar. - */ + * The screen element containing the terminal's canvas rendering layers and + * decorations, excluding the viewport and the scrollbar. + */ readonly screenElement: HTMLElement | undefined; /**