Skip to content

Commit

Permalink
fix(terminal) #8912: move frontend clear after session initialization…
Browse files Browse the repository at this point in the history
… (ref ef6b8a4 #8726)
  • Loading branch information
Clem-Fern committed Sep 2, 2023
1 parent cb71c79 commit 7cde5c0
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.frontend?.clear()
}
}

}

0 comments on commit 7cde5c0

Please sign in to comment.