diff --git a/src/Terminal.ts b/src/Terminal.ts index 1a02fe2a..f6e38594 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -630,7 +630,7 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II this._colorManager.setTheme(this._theme); const renderer = this._createRenderer(); - this._renderCoordinator = new RenderCoordinator(renderer, this.rows, this.screenElement, this.optionsService); + this._renderCoordinator = new RenderCoordinator(renderer, this.rows, this.screenElement, this.optionsService, this._charSizeService); this._renderCoordinator.onRender(e => this._onRender.fire(e)); this.onResize(e => this._renderCoordinator.resize(e.cols, e.rows)); @@ -642,8 +642,6 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II this.register(this.onResize(() => this._renderCoordinator.onResize(this.cols, this.rows))); this.register(this.addDisposableListener('blur', () => this._renderCoordinator.onBlur())); this.register(this.addDisposableListener('focus', () => this._renderCoordinator.onFocus())); - // TODO: Move to RenderCoordinator - this.register(this._charSizeService.onCharSizeChange(() => this._renderCoordinator.onCharSizeChanged())); this.register(this._renderCoordinator.onDimensionsChange(() => this.viewport.syncScrollArea())); this.selectionManager = new SelectionManager(this, this._charSizeService); diff --git a/src/renderer/RenderCoordinator.ts b/src/renderer/RenderCoordinator.ts index 98c9ae86..9136b063 100644 --- a/src/renderer/RenderCoordinator.ts +++ b/src/renderer/RenderCoordinator.ts @@ -12,6 +12,7 @@ import { addDisposableDomListener } from 'ui/Lifecycle'; import { IColorSet } from 'ui/Types'; import { CharacterJoinerHandler } from '../Types'; import { IOptionsService } from 'common/options/Types'; +import { ICharSizeService } from 'ui/services/Services'; export class RenderCoordinator extends Disposable { private _renderDebouncer: RenderDebouncer; @@ -35,7 +36,8 @@ export class RenderCoordinator extends Disposable { private _renderer: IRenderer, private _rowCount: number, screenElement: HTMLElement, - optionsService: IOptionsService + optionsService: IOptionsService, + charSizeService: ICharSizeService ) { super(); this._renderDebouncer = new RenderDebouncer((start, end) => this._renderRows(start, end)); @@ -46,6 +48,7 @@ export class RenderCoordinator extends Disposable { this.register(this._screenDprMonitor); this.register(optionsService.onOptionChange(() => this._renderer.onOptionsChanged())); + this.register(charSizeService.onCharSizeChange(() => this.onCharSizeChanged())); // dprchange should handle this case, we need this as well for browsers that don't support the // matchMedia query.