agent: Use current shell (#28470)

Release Notes:

- agent: Replace `bash` tool with `terminal` tool which uses the current
shell

---------

Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
Agus Zubiaga 2025-04-09 23:38:36 -06:00 committed by GitHub
parent 8ac378b86e
commit 90bcde116f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 334 additions and 74 deletions

View file

@ -477,7 +477,7 @@ pub fn iterate_expanded_and_wrapped_usize_range(
}
#[cfg(target_os = "windows")]
pub fn retrieve_system_shell() -> String {
pub fn get_windows_system_shell() -> String {
use std::path::PathBuf;
fn find_pwsh_in_programfiles(find_alternate: bool, find_preview: bool) -> Option<PathBuf> {
@ -994,6 +994,18 @@ pub fn default<D: Default>() -> D {
Default::default()
}
pub fn get_system_shell() -> String {
#[cfg(target_os = "windows")]
{
get_windows_system_shell()
}
#[cfg(not(target_os = "windows"))]
{
std::env::var("SHELL").unwrap_or("/bin/sh".to_string())
}
}
#[cfg(test)]
mod tests {
use super::*;