windows: Prefer Git Bash for external agent terminals (#40150)

Cole Miller and Max Brunsfeld created

This applies the same change as #39466 to the terminal codepath for
external agents.

Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

Change summary

crates/agent_servers/src/acp.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

crates/agent_servers/src/acp.rs 🔗

@@ -10,7 +10,7 @@ use project::Project;
 use project::agent_server_store::AgentServerCommand;
 use serde::Deserialize;
 use task::Shell;
-use util::ResultExt as _;
+use util::{ResultExt as _, get_default_system_shell_preferring_bash};
 
 use std::path::PathBuf;
 use std::{any::Any, cell::RefCell};
@@ -834,7 +834,7 @@ impl acp::Client for ClientDelegate {
                     .and_then(|r| r.read(cx).default_system_shell())
                     .map(Shell::Program)
             })?
-            .unwrap_or(task::Shell::System);
+            .unwrap_or_else(|| Shell::Program(get_default_system_shell_preferring_bash()));
         let is_windows = project
             .read_with(&self.cx, |project, cx| project.path_style(cx).is_windows())
             .unwrap_or(cfg!(windows));