1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-02 11:44:01 +03:00

close forwarded ports when session dies (fixes #2143)

This commit is contained in:
Eugene Pankov 2020-03-16 22:47:26 +01:00
parent 50959f4490
commit 0ca0996493

View File

@ -87,6 +87,13 @@ export class SSHSession extends BaseSession {
constructor (public connection: SSHConnection) { constructor (public connection: SSHConnection) {
super() super()
this.scripts = connection.scripts || [] this.scripts = connection.scripts || []
this.destroyed$.subscribe(() => {
for (const port of this.forwardedPorts) {
if (port.type === PortForwardType.Local) {
port.stopLocalListener()
}
}
})
} }
async start (): Promise<void> { async start (): Promise<void> {