Skip to content

Commit 9ebbafa

Browse files
committed
fix: handle Match directive in SSH config parsing
Add support for Match directive blocks in SSH config files, preventing incorrect host association when Match blocks are encountered. Addresses #2
1 parent 135c71d commit 9ebbafa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/sshfs/core/config.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ function M.parse_hosts_from_configs(ssh_configs)
1818
hosts[host_name] = { ["Config"] = path, ["Name"] = host_name }
1919
end
2020
end
21+
elseif line:match("^%s*Match%s+") then
22+
-- Match directive ends the current host block
23+
current_hosts = {}
2124
else
2225
if #current_hosts > 0 then
2326
local key, value = line:match("^%s*(%S+)%s+(.+)$")

0 commit comments

Comments
 (0)