diff --git a/tabby-terminal/src/api/connectableTerminalTab.component.ts b/tabby-terminal/src/api/connectableTerminalTab.component.ts index cefd3e71..cd22817e 100644 --- a/tabby-terminal/src/api/connectableTerminalTab.component.ts +++ b/tabby-terminal/src/api/connectableTerminalTab.component.ts @@ -46,7 +46,9 @@ export abstract class ConnectableTerminalTabComponent

{ + this.clearServiceMessagesOnConnect() + }) super.onFrontendReady() } @@ -57,9 +59,6 @@ export abstract class ConnectableTerminalTabComponent

{ this.reconnectOffered = false this.isDisconnectedByHand = false - if (this.profile.clearServiceMessagesOnConnect) { - this.frontend?.clear() - } } /** @@ -119,7 +118,14 @@ export abstract class ConnectableTerminalTabComponent

{ this.session?.destroy() await this.initializeSession() + this.clearServiceMessagesOnConnect() this.session?.releaseInitialDataBuffer() } + private clearServiceMessagesOnConnect (): void { + if (this.profile.clearServiceMessagesOnConnect && this.session?.open) { + this.frontend?.clear() + } + } + }