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..39b0d592 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. */