Release Notes: - N/A
Unified · Split
| @@ -93,6 +93,7 @@ struct Args { · 92 unmodified lines | ||
| 93 | 93 | /// Example: `me@Ubuntu` or `Ubuntu`. |
| 94 | 94 | /// |
| 95 | 95 | /// WARN: You should not fill in this field by hand. |
| 96 | + #[cfg(target_os = "windows")] | |
| 96 | 97 | #[arg(long, value_name = "USER@DISTRO")] |
| 97 | 98 | wsl: Option<String>, |
| 98 | 99 | /// Not supported in Zed CLI, only supported on Zed binary |
| @@ -303,6 +304,11 @@ fn main() -> Result<()> { · 204 unmodified lines | ||
| 303 | 304 | ]); |
| 304 | 305 | } |
| 305 | 306 | |
| 307 | + #[cfg(target_os = "windows")] | |
| 308 | + let wsl = args.wsl.as_ref(); | |
| 309 | + #[cfg(not(target_os = "windows"))] | |
| 310 | + let wsl = None; | |
| 311 | + | |
| 306 | 312 | for path in args.paths_with_position.iter() { |
| 307 | 313 | if path.starts_with("zed://") |
| 308 | 314 | || path.starts_with("http://") |
| @@ -321,7 +327,7 @@ fn main() -> Result<()> { · 12 unmodified lines | ||
| 321 | 327 | paths.push(tmp_file.path().to_string_lossy().to_string()); |
| 322 | 328 | let (tmp_file, _) = tmp_file.keep()?; |
| 323 | 329 | anonymous_fd_tmp_files.push((file, tmp_file)); |
| 324 | − } else if let Some(wsl) = &args.wsl { | |
| 330 | + } else if let Some(wsl) = wsl { | |
| 325 | 331 | urls.push(format!("file://{}", parse_path_in_wsl(path, wsl)?)); |
| 326 | 332 | } else { |
| 327 | 333 | paths.push(parse_path_with_position(path)?); |
| @@ -340,11 +346,16 @@ fn main() -> Result<()> { · 12 unmodified lines | ||
| 340 | 346 | let (_, handshake) = server.accept().context("Handshake after Zed spawn")?; |
| 341 | 347 | let (tx, rx) = (handshake.requests, handshake.responses); |
| 342 | 348 | |
| 349 | + #[cfg(target_os = "windows")] | |
| 350 | + let wsl = args.wsl; | |
| 351 | + #[cfg(not(target_os = "windows"))] | |
| 352 | + let wsl = None; | |
| 353 | + | |
| 343 | 354 | tx.send(CliRequest::Open { |
| 344 | 355 | paths, |
| 345 | 356 | urls, |
| 346 | 357 | diff_paths, |
| 347 | − wsl: args.wsl, | |
| 358 | + wsl, | |
| 348 | 359 | wait: args.wait, |
| 349 | 360 | open_new_workspace, |
| 350 | 361 | env, |
| @@ -707,11 +707,16 @@ pub fn main() { · 706 unmodified lines | ||
| 707 | 707 | .map(|chunk| [chunk[0].clone(), chunk[1].clone()]) |
| 708 | 708 | .collect(); |
| 709 | 709 | |
| 710 | + #[cfg(target_os = "windows")] | |
| 711 | + let wsl = args.wsl; | |
| 712 | + #[cfg(not(target_os = "windows"))] | |
| 713 | + let wsl = None; | |
| 714 | + | |
| 710 | 715 | if !urls.is_empty() || !diff_paths.is_empty() { |
| 711 | 716 | open_listener.open(RawOpenRequest { |
| 712 | 717 | urls, |
| 713 | 718 | diff_paths, |
| 714 | − wsl: args.wsl, | |
| 719 | + wsl, | |
| 715 | 720 | }) |
| 716 | 721 | } |
| 717 | 722 | |
| @@ -1192,6 +1197,7 @@ struct Args { · 474 unmodified lines | ||
| 1192 | 1197 | /// Example: `me@Ubuntu` or `Ubuntu`. |
| 1193 | 1198 | /// |
| 1194 | 1199 | /// WARN: You should not fill in this field by hand. |
| 1200 | + #[cfg(target_os = "windows")] | |
| 1195 | 1201 | #[arg(long, value_name = "USER@DISTRO")] |
| 1196 | 1202 | wsl: Option<String>, |
| 1197 | 1203 | |