mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-19 18:07:58 +00:00
ref(connectable tab) on session destroyed
This commit is contained in:
@@ -83,21 +83,18 @@ export class SerialTabComponent extends ConnectableTerminalTabComponent<SerialPr
|
||||
this.write(`\r\n${colors.black.bgWhite(' Serial ')} ${msg}\r\n`)
|
||||
this.session?.resize(this.size.columns, this.size.rows)
|
||||
})
|
||||
this.attachSessionHandler(this.session!.destroyed$, () => {
|
||||
if (this.frontend) {
|
||||
// Session was closed abruptly
|
||||
this.write('\r\n' + colors.black.bgWhite(' SERIAL ') + ` session closed\r\n`)
|
||||
|
||||
if (this.profile.behaviorOnSessionEnd === 'reconnect') {
|
||||
this.reconnect()
|
||||
} else if (this.profile.behaviorOnSessionEnd === 'keep' || this.profile.behaviorOnSessionEnd === 'auto' && !this.isSessionExplicitlyTerminated()) {
|
||||
this.offerReconnection()
|
||||
}
|
||||
}
|
||||
})
|
||||
super.attachSessionHandlers()
|
||||
}
|
||||
|
||||
protected onSessionDestroyed() {
|
||||
if (this.frontend) {
|
||||
// Session was closed abruptly
|
||||
this.write('\r\n' + colors.black.bgWhite(' SERIAL ') + ` session closed\r\n`)
|
||||
|
||||
super.onSessionDestroyed()
|
||||
}
|
||||
}
|
||||
|
||||
async getRecoveryToken (options?: GetRecoveryTokenOptions): Promise<any> {
|
||||
return {
|
||||
type: 'app:serial-tab',
|
||||
|
Reference in New Issue
Block a user