fix: Handle users and groups with spaces over SSH (#448)

This commit is contained in:
Anna Arad 2024-07-22 02:07:10 +03:00 committed by GitHub
parent 9e5eb2fcd1
commit a6cea1a5b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -156,7 +156,7 @@ function SSHConnection.new(url)
else
self.jid = jid
end
self:run("whoami", function(err, lines)
self:run("id -u", function(err, lines)
if err then
vim.notify(string.format("Error fetching ssh connection user: %s", err), vim.log.levels.WARN)
else
@ -164,7 +164,7 @@ function SSHConnection.new(url)
self.meta.user = vim.trim(table.concat(lines, ""))
end
end)
self:run("groups", function(err, lines)
self:run("id -G", function(err, lines)
if err then
vim.notify(
string.format("Error fetching ssh connection user groups: %s", err),