Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
util: Honor shell args for shell env fetching on windows (#44615)
Lukas Wirth045c14593fdc
diff --git a/crates/util/src/shell_env.rs b/crates/util/src/shell_env.rsindex c9a9b3515a6..c41a28b4695 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<collections::HashMap<String, String>> {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",