From e4ceb3ee6a37147b44797163ce78d2ebffced2c2 Mon Sep 17 00:00:00 2001 From: Mxmilu Date: Sun, 24 Dec 2023 12:28:47 +0800 Subject: [PATCH] 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 8baace695a..590ea2a322 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 }