Pass project environment to runInTerminal requests (#32720)

Closes #ISSUE

Release Notes:

- debugger: Pass environment to run in terminal requests
This commit is contained in:
Conrad Irwin 2025-06-16 09:34:50 -06:00 committed by GitHub
parent d7db4d4e0a
commit 92addb005a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 29 additions and 7 deletions

View file

@ -49,7 +49,7 @@ use std::{
path::{Path, PathBuf},
sync::{Arc, Once},
};
use task::{DebugScenario, SpawnInTerminal, TaskTemplate};
use task::{DebugScenario, SpawnInTerminal, TaskContext, TaskTemplate};
use util::ResultExt as _;
use worktree::Worktree;
@ -362,6 +362,7 @@ impl DapStore {
&mut self,
label: SharedString,
adapter: DebugAdapterName,
task_context: TaskContext,
parent_session: Option<Entity<Session>>,
cx: &mut Context<Self>,
) -> Entity<Session> {
@ -379,6 +380,7 @@ impl DapStore {
parent_session,
label,
adapter,
task_context,
cx,
);
@ -889,7 +891,9 @@ impl dap::adapters::DapDelegate for DapAdapterDelegate {
}
async fn which(&self, command: &OsStr) -> Option<PathBuf> {
which::which(command).ok()
let worktree_abs_path = self.worktree.abs_path();
let shell_path = self.shell_env().await.get("PATH").cloned();
which::which_in(command, shell_path.as_ref(), worktree_abs_path).ok()
}
async fn shell_env(&self) -> HashMap<String, String> {