Skip to content

Commit

Permalink
Merge pull request #8918 from Clem-Fern/fix#8912
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Oct 6, 2023
2 parents 34aeb79 + 04b53ab commit adeb603
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tabby-terminal/src/api/connectableTerminalTab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export abstract class ConnectableTerminalTabComponent<P extends ConnectableTermi
}

protected onFrontendReady (): void {
this.initializeSession()
this.initializeSession().then(() => {
this.clearServiceMessagesOnConnect()
})
super.onFrontendReady()
}

Expand All @@ -57,9 +59,6 @@ export abstract class ConnectableTerminalTabComponent<P extends ConnectableTermi
async initializeSession (): Promise<void> {
this.reconnectOffered = false
this.isDisconnectedByHand = false
if (this.profile.clearServiceMessagesOnConnect) {
this.frontend?.clear()
}
}

/**
Expand Down Expand Up @@ -119,7 +118,14 @@ export abstract class ConnectableTerminalTabComponent<P extends ConnectableTermi
async reconnect (): Promise<void> {
this.session?.destroy()
await this.initializeSession()
this.clearServiceMessagesOnConnect()
this.session?.releaseInitialDataBuffer()
}

private clearServiceMessagesOnConnect (): void {
if (this.profile.clearServiceMessagesOnConnect && this.session?.open) {
this.frontend?.clear()
}
}

}

0 comments on commit adeb603

Please sign in to comment.