ssh reconnection logic improvements - fixes #2705, fixes #761, fixes #2662

This commit is contained in:
Eugene Pankov
2020-07-05 12:47:32 +02:00
parent 7b4e6e8f3a
commit d0fe64355b
7 changed files with 36 additions and 25 deletions

View File

@@ -474,7 +474,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
]
}
protected attachSessionHandlers (): void {
protected attachSessionHandlers (destroyOnSessionClose = false): void {
// this.session.output$.bufferTime(10).subscribe((datas) => {
this.session.output$.subscribe(data => {
if (this.enablePassthrough) {
@@ -485,9 +485,11 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
}
})
this.sessionCloseSubscription = this.session.closed$.subscribe(() => {
this.frontend.destroy()
this.destroy()
})
if (destroyOnSessionClose) {
this.sessionCloseSubscription = this.session.closed$.subscribe(() => {
this.frontend.destroy()
this.destroy()
})
}
}
}

View File

@@ -60,7 +60,7 @@ export class TerminalTabComponent extends BaseTerminalTabComponent {
})
)
this.attachSessionHandlers()
this.attachSessionHandlers(true)
}
async getRecoveryToken (): Promise<any> {

View File

@@ -73,6 +73,8 @@ export abstract class BaseSession {
this.open = false
this.closed.next()
this.destroyed.next()
this.closed.complete()
this.destroyed.complete()
this.output.complete()
this.binaryOutput.complete()
await this.gracefullyKillProcess()