acp_thread: Respect terminal settings shell for terminal tool environment (#39349)

When sourcing the project environment for the terminal tool, we will now
do so by spawning the shell specified by the users `terminal.shell`
setting (or as usual fall back to the login shell).

Closes #37687 

Release Notes:

- N/A
This commit is contained in:
Lukas Wirth
2025-10-02 22:10:55 +02:00
committed by GitHub
parent 7c3a21f732
commit bf48a95344
13 changed files with 615 additions and 499 deletions
+4 -2
View File
@@ -27,6 +27,7 @@ use std::{
time::{Duration, Instant},
};
use task::{Shell, ShellBuilder};
use terminal::terminal_settings::TerminalSettings;
use terminal_view::TerminalView;
use theme::ThemeSettings;
use ui::{CommonAnimationExt, Disclosure, Tooltip, prelude::*};
@@ -119,9 +120,10 @@ impl Tool for TerminalTool {
};
let cwd = working_dir.clone();
let env = match &working_dir {
let env = match &cwd {
Some(dir) => project.update(cx, |project, cx| {
project.directory_environment(dir.as_path().into(), cx)
let shell = TerminalSettings::get_global(cx).shell.clone();
project.directory_environment(&shell, dir.as_path().into(), cx)
}),
None => Task::ready(None).shared(),
};