From 54d71adb262691db7b9bfc98117cfbd748d4e0a6 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sun, 30 Jan 2022 21:08:50 +0100 Subject: [PATCH] debounce terminal resize events --- tabby-terminal/src/api/baseTerminalTab.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tabby-terminal/src/api/baseTerminalTab.component.ts b/tabby-terminal/src/api/baseTerminalTab.component.ts index ffde073f..991b60db 100644 --- a/tabby-terminal/src/api/baseTerminalTab.component.ts +++ b/tabby-terminal/src/api/baseTerminalTab.component.ts @@ -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(() => {