mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-20 02:18:01 +00:00
ref(connectable tab) on session destroyed
This commit is contained in:
@@ -148,21 +148,13 @@ export class SSHTabComponent extends ConnectableTerminalTabComponent<SSHProfile>
|
||||
return session
|
||||
}
|
||||
|
||||
protected attachSessionHandlers (): void {
|
||||
const session = this.session!
|
||||
this.attachSessionHandler(session.destroyed$, () => {
|
||||
if (this.frontend) {
|
||||
// Session was closed abruptly
|
||||
this.write('\r\n' + colors.black.bgWhite(' SSH ') + ` ${this.sshSession?.profile.options.host}: session closed\r\n`)
|
||||
protected onSessionDestroyed() {
|
||||
if (this.frontend) {
|
||||
// Session was closed abruptly
|
||||
this.write('\r\n' + colors.black.bgWhite(' SSH ') + ` ${this.sshSession?.profile.options.host}: 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()
|
||||
super.onSessionDestroyed()
|
||||
}
|
||||
}
|
||||
|
||||
private async initializeSessionMaybeMultiplex (multiplex = true): Promise<void> {
|
||||
|
Reference in New Issue
Block a user