Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

windows: Fix path parsing issue when launching Zed from command line (#15856)

张小白e6d5f4406fc7
diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs
index d9ffb29c391..0770918120e 100644
--- a/crates/zed/src/main.rs
+++ b/crates/zed/src/main.rs
@@ -1071,7 +1071,10 @@ struct Args {
fn parse_url_arg(arg: &str, cx: &AppContext) -> Result<String> {
match std::fs::canonicalize(Path::new(&arg)) {
- Ok(path) => Ok(format!("file://{}", path.to_string_lossy())),
+ Ok(path) => Ok(format!(
+ "file://{}",
+ path.to_string_lossy().trim_start_matches(r#"\\?\"#)
+ )),
Err(error) => {
if arg.starts_with("file://")
|| arg.starts_with("zed-cli://")