Pass project environment to runInTerminal requests (#32720)
Closes #ISSUE Release Notes: - debugger: Pass environment to run in terminal requests
This commit is contained in:
parent
d7db4d4e0a
commit
92addb005a
5 changed files with 29 additions and 7 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue