1
1
mirror of https://github.com/wez/wezterm.git synced 2024-08-16 17:50:28 +03:00

feat(ssh/config): handle absolute path includes in ssh config

This commit is contained in:
Bojin Li 2024-03-18 18:52:33 +11:00
parent 889f8a9cd7
commit 3d9112ac88
No known key found for this signature in database

View File

@ -175,7 +175,13 @@ impl ParsedConfigFile {
groups: &mut Vec<MatchGroup>,
loaded_files: &mut Vec<PathBuf>,
) {
match filenamegen::Glob::new(&pattern) {
let home = dirs_next::home_dir().unwrap_or_default();
let (cwd, pattern) = match pattern {
p if p.starts_with("~/") => (Some(home.as_path()), &p[2..]),
p if p.starts_with('/') => (Some(Path::new("/")), &p[1..]),
_ => (cwd, pattern),
};
match filenamegen::Glob::new(pattern) {
Ok(g) => {
match cwd
.as_ref()