debounce terminal resize events

This commit is contained in:
Eugene Pankov 2022-01-30 21:08:50 +01:00
parent 13eebd8957
commit 54d71adb26
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -1,4 +1,4 @@
import { Observable, Subject, Subscription, first } from 'rxjs'
import { Observable, Subject, Subscription, first, auditTime } from 'rxjs'
import { Spinner } from 'cli-spinner'
import colors from 'ansi-colors'
import { NgZone, OnInit, OnDestroy, Injector, ViewChild, HostBinding, Input, ElementRef, InjectFlags } from '@angular/core'
@ -664,7 +664,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
this.sendInput(data)
})
this.termContainerSubscriptions.subscribe(this.frontend.resize$, ({ columns, rows }) => {
this.termContainerSubscriptions.subscribe(this.frontend.resize$.pipe(auditTime(100)), ({ columns, rows }) => {
this.logger.debug(`Resizing to ${columns}x${rows}`)
this.size = { columns, rows }
this.zone.run(() => {