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:
parent
8ac378b86e
commit
90bcde116f
15 changed files with 334 additions and 74 deletions
|
@ -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::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue