1
1
mirror of https://github.com/Eugeny/tabby.git synced 2025-01-01 15:11:16 +03:00

support IPv6 in SSH quick connect field - fixes #3957

This commit is contained in:
Eugene Pankov 2021-06-28 22:30:55 +02:00
parent 6d0293975d
commit 6197215500
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -262,8 +262,11 @@ export class SSHService {
host = parts[parts.length - 1]
user = parts.slice(0, parts.length - 1).join('@')
}
if (host.includes(':')) {
port = parseInt(host.split(':')[1])
if (host.includes('[')) {
port = parseInt(host.split(']')[1].substring(1))
host = host.split(']')[0].substring(1)
} else if (host.includes(':')) {
port = parseInt(host.split(/:/g)[1])
host = host.split(':')[0]
}