re-fixed session restarting

This commit is contained in:
Eugene Pankov 2021-02-13 12:47:21 +01:00
parent 9c87cf3f3a
commit 9b5b5a9d00
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
2 changed files with 12 additions and 11 deletions

View File

@ -97,13 +97,11 @@ export class SerialTabComponent extends BaseTerminalTabComponent {
}))
this.attachSessionHandler(this.session!.destroyed$.subscribe(() => {
this.write('Press any key to reconnect\r\n')
setTimeout(() => {
this.input$.pipe(first()).subscribe(() => {
if (!this.session?.open) {
this.reconnect()
}
})
}, 100)
this.input$.pipe(first()).subscribe(() => {
if (!this.session?.open) {
this.reconnect()
}
})
}))
super.attachSessionHandlers()
}

View File

@ -54,6 +54,9 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
case 'end':
this.sendInput('\x1b[F' )
break
case 'restart-ssh-session':
this.reconnect()
break
}
})
@ -157,11 +160,11 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
if (!this.reconnectOffered) {
this.reconnectOffered = true
this.write('Press any key to reconnect\r\n')
setTimeout(() => {
this.attachSessionHandler(this.input$.pipe(first()).subscribe(() => {
this.input$.pipe(first()).subscribe(() => {
if (!this.session?.open) {
this.reconnect()
}))
}, 100)
}
})
}
}
}))