Remove wsl command line args on non-windows platforms (#37422)
Release Notes: - N/A
This commit is contained in:
+13
-2
@@ -93,6 +93,7 @@ struct Args {
|
|||||||
/// Example: `me@Ubuntu` or `Ubuntu`.
|
/// Example: `me@Ubuntu` or `Ubuntu`.
|
||||||
///
|
///
|
||||||
/// WARN: You should not fill in this field by hand.
|
/// WARN: You should not fill in this field by hand.
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
#[arg(long, value_name = "USER@DISTRO")]
|
#[arg(long, value_name = "USER@DISTRO")]
|
||||||
wsl: Option<String>,
|
wsl: Option<String>,
|
||||||
/// Not supported in Zed CLI, only supported on Zed binary
|
/// Not supported in Zed CLI, only supported on Zed binary
|
||||||
@@ -303,6 +304,11 @@ fn main() -> Result<()> {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
let wsl = args.wsl.as_ref();
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
let wsl = None;
|
||||||
|
|
||||||
for path in args.paths_with_position.iter() {
|
for path in args.paths_with_position.iter() {
|
||||||
if path.starts_with("zed://")
|
if path.starts_with("zed://")
|
||||||
|| path.starts_with("http://")
|
|| path.starts_with("http://")
|
||||||
@@ -321,7 +327,7 @@ fn main() -> Result<()> {
|
|||||||
paths.push(tmp_file.path().to_string_lossy().to_string());
|
paths.push(tmp_file.path().to_string_lossy().to_string());
|
||||||
let (tmp_file, _) = tmp_file.keep()?;
|
let (tmp_file, _) = tmp_file.keep()?;
|
||||||
anonymous_fd_tmp_files.push((file, tmp_file));
|
anonymous_fd_tmp_files.push((file, tmp_file));
|
||||||
} else if let Some(wsl) = &args.wsl {
|
} else if let Some(wsl) = wsl {
|
||||||
urls.push(format!("file://{}", parse_path_in_wsl(path, wsl)?));
|
urls.push(format!("file://{}", parse_path_in_wsl(path, wsl)?));
|
||||||
} else {
|
} else {
|
||||||
paths.push(parse_path_with_position(path)?);
|
paths.push(parse_path_with_position(path)?);
|
||||||
@@ -340,11 +346,16 @@ fn main() -> Result<()> {
|
|||||||
let (_, handshake) = server.accept().context("Handshake after Zed spawn")?;
|
let (_, handshake) = server.accept().context("Handshake after Zed spawn")?;
|
||||||
let (tx, rx) = (handshake.requests, handshake.responses);
|
let (tx, rx) = (handshake.requests, handshake.responses);
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
let wsl = args.wsl;
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
let wsl = None;
|
||||||
|
|
||||||
tx.send(CliRequest::Open {
|
tx.send(CliRequest::Open {
|
||||||
paths,
|
paths,
|
||||||
urls,
|
urls,
|
||||||
diff_paths,
|
diff_paths,
|
||||||
wsl: args.wsl,
|
wsl,
|
||||||
wait: args.wait,
|
wait: args.wait,
|
||||||
open_new_workspace,
|
open_new_workspace,
|
||||||
env,
|
env,
|
||||||
|
|||||||
@@ -707,11 +707,16 @@ pub fn main() {
|
|||||||
.map(|chunk| [chunk[0].clone(), chunk[1].clone()])
|
.map(|chunk| [chunk[0].clone(), chunk[1].clone()])
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
let wsl = args.wsl;
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
let wsl = None;
|
||||||
|
|
||||||
if !urls.is_empty() || !diff_paths.is_empty() {
|
if !urls.is_empty() || !diff_paths.is_empty() {
|
||||||
open_listener.open(RawOpenRequest {
|
open_listener.open(RawOpenRequest {
|
||||||
urls,
|
urls,
|
||||||
diff_paths,
|
diff_paths,
|
||||||
wsl: args.wsl,
|
wsl,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1192,6 +1197,7 @@ struct Args {
|
|||||||
/// Example: `me@Ubuntu` or `Ubuntu`.
|
/// Example: `me@Ubuntu` or `Ubuntu`.
|
||||||
///
|
///
|
||||||
/// WARN: You should not fill in this field by hand.
|
/// WARN: You should not fill in this field by hand.
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
#[arg(long, value_name = "USER@DISTRO")]
|
#[arg(long, value_name = "USER@DISTRO")]
|
||||||
wsl: Option<String>,
|
wsl: Option<String>,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user