detect user@domain style usernames in ssh quick connect - fixes #3026

This commit is contained in:
Eugene Pankov 2021-03-13 21:02:49 +01:00
parent d03211631a
commit c290633e7e
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -420,7 +420,9 @@ export class SSHService {
let host = query
let port = 22
if (host.includes('@')) {
[user, host] = host.split('@')
const parts = host.split(/@/g)
host = parts[parts.length - 1]
user = parts.slice(0, parts.length - 1).join('@')
}
if (host.includes(':')) {
port = parseInt(host.split(':')[1])