From b31b500727a46fb8f88c0856f41180c7818ccfdb Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Tue, 8 Mar 2022 20:47:21 +0100 Subject: [PATCH] fixed .ssh/config port binding parsing - fixes #5906 --- tabby-electron/src/sshImporters.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tabby-electron/src/sshImporters.ts b/tabby-electron/src/sshImporters.ts index 457bd727..c41a0e17 100644 --- a/tabby-electron/src/sshImporters.ts +++ b/tabby-electron/src/sshImporters.ts @@ -76,8 +76,8 @@ export class OpenSSHImporter extends SSHProfileImporter { target.forwardedPorts.push({ type: PortForwardType.Local, description: value, - host: bind.split(':')[0] ?? '127.0.0.1', - port: parseInt(bind.split(':')[1] ?? bind), + host: bind.includes(':') ? bind.split(':')[0] : '127.0.0.1', + port: parseInt(bind.split(':').at(-1)), targetAddress: tgt.split(':')[0], targetPort: parseInt(tgt.split(':')[1]), }) @@ -87,8 +87,8 @@ export class OpenSSHImporter extends SSHProfileImporter { target.forwardedPorts.push({ type: PortForwardType.Dynamic, description: value, - host: bind.split(':')[0] ?? '127.0.0.1', - port: parseInt(bind.split(':')[1] ?? bind), + host: bind.includes(':') ? bind.split(':')[0] : '127.0.0.1', + port: parseInt(bind.split(':').at(-1)), targetAddress: '', targetPort: 22, })