From e4ceb3ee6a37147b44797163ce78d2ebffced2c2 Mon Sep 17 00:00:00 2001 From: Mxmilu Date: Sun, 24 Dec 2023 12:28:47 +0800 Subject: [PATCH 1/5] Fix Connection error while opening WinSCP session using IPV6 address --- tabby-ssh/src/services/ssh.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tabby-ssh/src/services/ssh.service.ts b/tabby-ssh/src/services/ssh.service.ts index 8baace69..590ea2a3 100644 --- a/tabby-ssh/src/services/ssh.service.ts +++ b/tabby-ssh/src/services/ssh.service.ts @@ -37,7 +37,12 @@ export class SSHService { if (password) { uri += ':' + encodeURIComponent(password) } - uri += `@${profile.options.host}:${profile.options.port}${cwd ?? '/'}` + if (profile.options.host.includes(':')) { + uri += `@[${profile.options.host}]:${profile.options.port}${cwd ?? '/'}`; + } else { + uri += `@${profile.options.host}:${profile.options.port}${cwd ?? '/'}`; + } + console.log(uri); return uri } From 76931e69adc4b5226c736c943f3c8ac5ce898a6d Mon Sep 17 00:00:00 2001 From: Mxmilu Date: Sun, 24 Dec 2023 12:37:11 +0800 Subject: [PATCH 2/5] Fix Connection error while opening WinSCP session using IPV6 address --- tabby-ssh/src/services/ssh.service.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tabby-ssh/src/services/ssh.service.ts b/tabby-ssh/src/services/ssh.service.ts index 590ea2a3..89df5629 100644 --- a/tabby-ssh/src/services/ssh.service.ts +++ b/tabby-ssh/src/services/ssh.service.ts @@ -38,11 +38,10 @@ export class SSHService { uri += ':' + encodeURIComponent(password) } if (profile.options.host.includes(':')) { - uri += `@[${profile.options.host}]:${profile.options.port}${cwd ?? '/'}`; - } else { - uri += `@${profile.options.host}:${profile.options.port}${cwd ?? '/'}`; + uri += `@[${profile.options.host}]:${profile.options.port}${cwd ?? '/'}`; + } else { + uri += `@${profile.options.host}:${profile.options.port}${cwd ?? '/'}`; } - console.log(uri); return uri } From 1369b5b29957f7d089b9afb4754e99291ec3a5b6 Mon Sep 17 00:00:00 2001 From: Mxmilu Date: Sun, 24 Dec 2023 12:43:18 +0800 Subject: [PATCH 3/5] Fix Connection error while opening WinSCP session using IPV6 address --- tabby-ssh/src/services/ssh.service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tabby-ssh/src/services/ssh.service.ts b/tabby-ssh/src/services/ssh.service.ts index 89df5629..bc983d09 100644 --- a/tabby-ssh/src/services/ssh.service.ts +++ b/tabby-ssh/src/services/ssh.service.ts @@ -37,12 +37,12 @@ export class SSHService { if (password) { uri += ':' + encodeURIComponent(password) } - if (profile.options.host.includes(':')) { - uri += `@[${profile.options.host}]:${profile.options.port}${cwd ?? '/'}`; - } else { - uri += `@${profile.options.host}:${profile.options.port}${cwd ?? '/'}`; - } - return uri + if (profile.options.host.includes(':')) { + uri += `@[${profile.options.host}]:${profile.options.port}${cwd ?? '/'}` + } + else { + uri += `@${profile.options.host}:${profile.options.port}${cwd ?? '/'}` + } } async launchWinSCP (session: SSHSession): Promise { From 78a64a9025ab4c75a40de63a171ab98a7feb8450 Mon Sep 17 00:00:00 2001 From: Mxmilu Date: Sun, 24 Dec 2023 12:48:16 +0800 Subject: [PATCH 4/5] Fix Connection error while opening WinSCP session using IPV6 address --- tabby-ssh/src/services/ssh.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tabby-ssh/src/services/ssh.service.ts b/tabby-ssh/src/services/ssh.service.ts index bc983d09..234b2400 100644 --- a/tabby-ssh/src/services/ssh.service.ts +++ b/tabby-ssh/src/services/ssh.service.ts @@ -39,8 +39,7 @@ export class SSHService { } if (profile.options.host.includes(':')) { uri += `@[${profile.options.host}]:${profile.options.port}${cwd ?? '/'}` - } - else { + }else { uri += `@${profile.options.host}:${profile.options.port}${cwd ?? '/'}` } } From 2507317d6b346885343aefb0bd5fba576cd6d2ce Mon Sep 17 00:00:00 2001 From: Mxmilu Date: Sun, 24 Dec 2023 12:55:00 +0800 Subject: [PATCH 5/5] Fix Connection error while opening WinSCP session using IPV6 address --- tabby-ssh/src/services/ssh.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tabby-ssh/src/services/ssh.service.ts b/tabby-ssh/src/services/ssh.service.ts index 234b2400..f8a3b0fc 100644 --- a/tabby-ssh/src/services/ssh.service.ts +++ b/tabby-ssh/src/services/ssh.service.ts @@ -42,6 +42,7 @@ export class SSHService { }else { uri += `@${profile.options.host}:${profile.options.port}${cwd ?? '/'}` } + return uri } async launchWinSCP (session: SSHSession): Promise {