From 881c73c79f31b7b53d37870e83a992df1506a135 Mon Sep 17 00:00:00 2001 From: oudecheng <13802883547@139.com> Date: Wed, 20 May 2026 15:55:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=BF=E7=94=A8=20platform=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=8E=B7=E5=8F=96=20Shell=20=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA=E8=AF=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agent/system_prompt.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/agent/system_prompt.rs b/src/agent/system_prompt.rs index 00f48f9..7927358 100644 --- a/src/agent/system_prompt.rs +++ b/src/agent/system_prompt.rs @@ -84,7 +84,9 @@ pub fn generate_system_env_prompt(config: &crate::config::LLMProviderConfig) -> _ => OS, }; - let shell = env::var("SHELL").unwrap_or_else(|_| "unknown".to_string()); + // 使用 platform 模块获取 Shell 信息,与 bash 工具保持一致 + let shell_info = crate::platform::ShellInfo::default(); + let shell = shell_info.executable; let cwd = env::current_dir() .map(|p| p.display().to_string()) .unwrap_or_else(|_| "unknown".to_string());