diff --git a/mux/src/localpane.rs b/mux/src/localpane.rs index 09f72878061..765630f59a7 100644 --- a/mux/src/localpane.rs +++ b/mux/src/localpane.rs @@ -1045,7 +1045,7 @@ impl LocalPane { { let leader = self.get_leader(policy); if let Some(path) = &leader.current_working_dir { - return Url::parse(&format!("file://localhost{}", path.display())).ok(); + return Url::from_directory_path(path).ok(); } return None; } @@ -1055,7 +1055,7 @@ impl LocalPane { // Since windows paths typically start with something like C:\, // we cannot simply stick `localhost` on the front; we have to // omit the hostname otherwise the url parser is unhappy. - return Url::parse(&format!("file://{}", fg.cwd.display())).ok(); + return Url::from_directory_path(fg.cwd).ok(); } #[allow(unreachable_code)]