diff --git a/crates/util/src/shell_env.rs b/crates/util/src/shell_env.rs index c9a9b3515a699b55a84456bc1f5a139a54ccf614..c41a28b46953bdb87f319bfbbb84b7ebd22be245 100644 --- a/crates/util/src/shell_env.rs +++ b/crates/util/src/shell_env.rs @@ -132,7 +132,7 @@ async fn spawn_and_read_fd( #[cfg(windows)] async fn capture_windows( shell_path: &Path, - _args: &[String], + args: &[String], directory: &Path, ) -> Result> { use std::process::Stdio; @@ -141,17 +141,17 @@ async fn capture_windows( std::env::current_exe().context("Failed to determine current zed executable path.")?; let shell_kind = ShellKind::new(shell_path, true); - if let ShellKind::Csh | ShellKind::Tcsh | ShellKind::Rc | ShellKind::Fish | ShellKind::Xonsh = - shell_kind - { - return Err(anyhow::anyhow!("unsupported shell kind")); - } let mut cmd = crate::command::new_smol_command(shell_path); + cmd.args(args); let cmd = match shell_kind { - ShellKind::Csh | ShellKind::Tcsh | ShellKind::Rc | ShellKind::Fish | ShellKind::Xonsh => { - unreachable!() - } - ShellKind::Posix => cmd.args([ + ShellKind::Csh + | ShellKind::Tcsh + | ShellKind::Rc + | ShellKind::Fish + | ShellKind::Xonsh + | ShellKind::Posix => cmd.args([ + "-l", + "-i", "-c", &format!( "cd '{}'; '{}' --printenv",