Revert "resolves Eugeny/tabby#7751, Eugeny/tabby#8062, Eugeny/tabby#6617 add configurable behavior when session ends"

This reverts commit 268af8806c.
This commit is contained in:
Clem
2023-04-22 14:36:43 +02:00
parent 8cb75e14a2
commit f423be1510
7 changed files with 32 additions and 79 deletions

View File

@@ -48,23 +48,14 @@ export class TelnetTabComponent extends BaseTerminalTabComponent<TelnetProfile>
this.attachSessionHandler(session.destroyed$, () => {
if (this.frontend) {
// Session was closed abruptly
if (this.config.store.terminal.behaviorOnSessionEnds == 'close') {
// Close the tab
this.destroy()
} else if (this.config.store.terminal.behaviorOnSessionEnds.startsWith('reconnect-or-')) {
// Automatically reconnect the session
this.reconnect()
} else {
// Reconnect Offer
if (!this.reconnectOffered) {
this.reconnectOffered = true
this.write(this.translate.instant(_('Press any key to reconnect')) + '\r\n')
this.input$.pipe(first()).subscribe(() => {
if (!this.session?.open && this.reconnectOffered) {
this.reconnect()
}
})
}
if (!this.reconnectOffered) {
this.reconnectOffered = true
this.write(this.translate.instant(_('Press any key to reconnect')) + '\r\n')
this.input$.pipe(first()).subscribe(() => {
if (!this.session?.open && this.reconnectOffered) {
this.reconnect()
}
})
}
}
})