diff --git a/src/AccessibilityManager.ts b/src/AccessibilityManager.ts index 74b5ab9a..6ff595ce 100644 --- a/src/AccessibilityManager.ts +++ b/src/AccessibilityManager.ts @@ -7,7 +7,7 @@ import * as Strings from './Strings'; import { ITerminal, IBuffer } from './Types'; import { isMac } from './shared/utils/Browser'; import { RenderDebouncer } from './utils/RenderDebouncer'; -import { addDisposableListener } from './ui/Lifecycle'; +import { addDisposableDomListener } from './ui/Lifecycle'; import { IDisposable } from 'xterm'; const MAX_ROWS_TO_READ = 20; @@ -89,7 +89,7 @@ export class AccessibilityManager implements IDisposable { this._disposables.push(this._terminal.renderer.addDisposableListener('resize', () => this._refreshRowsDimensions())); // This shouldn't be needed on modern browsers but is present in case the // media query that drives the dprchange event isn't supported - this._disposables.push(addDisposableListener(window, 'resize', () => this._refreshRowsDimensions())); + this._disposables.push(addDisposableDomListener(window, 'resize', () => this._refreshRowsDimensions())); } public dispose(): void { diff --git a/src/Terminal.ts b/src/Terminal.ts index 38d152e5..55f3b493 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -688,7 +688,7 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II this.on('dprchange', () => this.renderer.onWindowResize(window.devicePixelRatio)); // dprchange should handle this case, we need this as well for browsers that don't support the // matchMedia query. - this._disposables.push(Dom.addDisposableListener(window, 'resize', () => this.renderer.onWindowResize(window.devicePixelRatio))); + this._disposables.push(Dom.addDisposableDomListener(window, 'resize', () => this.renderer.onWindowResize(window.devicePixelRatio))); this.charMeasure.on('charsizechanged', () => this.renderer.onCharSizeChanged()); this.renderer.on('resize', (dimensions) => this.viewport.syncScrollArea()); diff --git a/src/ui/Lifecycle.ts b/src/ui/Lifecycle.ts index 889c88c2..d8367113 100644 --- a/src/ui/Lifecycle.ts +++ b/src/ui/Lifecycle.ts @@ -10,7 +10,7 @@ import { IDisposable } from 'xterm'; * @param type The event type. * @param handler The handler for the listener. */ -export function addDisposableListener( +export function addDisposableDomListener( node: Element | Window | Document, type: string, handler: (e: any) => void,