Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
util: Support shell env fetching for git bash (#42208)
Lukas Wirth585c440e6ec5
diff --git a/crates/util/src/shell_env.rs b/crates/util/src/shell_env.rsindex 1b4d32851a2..de9e1a0b260 100644--- a/crates/util/src/shell_env.rs+++ b/crates/util/src/shell_env.rs@@ -136,25 +136,24 @@ 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::Posix- | ShellKind::Csh- | ShellKind::Tcsh- | ShellKind::Rc- | ShellKind::Fish- | ShellKind::Xonsh = shell_kind+ 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);let cmd = match shell_kind {- ShellKind::Posix- | ShellKind::Csh- | ShellKind::Tcsh- | ShellKind::Rc- | ShellKind::Fish- | ShellKind::Xonsh => {+ ShellKind::Csh | ShellKind::Tcsh | ShellKind::Rc | ShellKind::Fish | ShellKind::Xonsh => {unreachable!()}+ ShellKind::Posix => cmd.args([+ "-c",+ &format!(+ "cd '{}'; '{}' --printenv",+ directory.display(),+ zed_path.display()+ ),+ ]),ShellKind::PowerShell => cmd.args(["-NonInteractive","-NoProfile",@@ -168,7 +167,7 @@ async fn capture_windows(ShellKind::Elvish => cmd.args(["-c",&format!(- "cd '{}'; {} --printenv",+ "cd '{}'; '{}' --printenv",directory.display(),zed_path.display()),