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:
@@ -784,7 +784,7 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
||||
})
|
||||
|
||||
this.attachSessionHandler(this.session.destroyed$, () => {
|
||||
this.setSession(null)
|
||||
this.onSessionDestroyed()
|
||||
})
|
||||
|
||||
this.attachSessionHandler(this.session.oscProcessor.copyRequested$, content => {
|
||||
@@ -793,6 +793,13 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called when session is destroyed. Set the session to null
|
||||
*/
|
||||
protected onSessionDestroyed() {
|
||||
this.setSession(null)
|
||||
}
|
||||
|
||||
protected detachSessionHandlers (): void {
|
||||
this.sessionHandlers.cancelAll()
|
||||
}
|
||||
|
@@ -32,6 +32,21 @@ export abstract class ConnectableTerminalTabComponent<P extends BaseTerminalProf
|
||||
async initializeSession (): Promise<void> {
|
||||
this.reconnectOffered = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called when session is destroyed. Handle the tab behavior on session end for connectable tab
|
||||
*/
|
||||
protected onSessionDestroyed() {
|
||||
super.onSessionDestroyed()
|
||||
|
||||
if (this.frontend) {
|
||||
if (this.profile.behaviorOnSessionEnd === 'reconnect') {
|
||||
this.reconnect()
|
||||
} else if (this.profile.behaviorOnSessionEnd === 'keep' || this.profile.behaviorOnSessionEnd === 'auto' && !this.isSessionExplicitlyTerminated()) {
|
||||
this.offerReconnection()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Offering reconnection to the user if it hasn't been done yet.
|
||||
|
Reference in New Issue
Block a user