project: Use user configured shells for project env fetching (#41288)
Closes https://github.com/zed-industries/zed/issues/40464 Release Notes: - Fix shell environment sourcing not respecting users remote shells
This commit is contained in:
@@ -49,7 +49,7 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
sync::{Arc, Once},
|
||||
};
|
||||
use task::{DebugScenario, Shell, SpawnInTerminal, TaskContext, TaskTemplate};
|
||||
use task::{DebugScenario, SpawnInTerminal, TaskContext, TaskTemplate};
|
||||
use util::{ResultExt as _, rel_path::RelPath};
|
||||
use worktree::Worktree;
|
||||
|
||||
@@ -267,8 +267,8 @@ impl DapStore {
|
||||
let user_env = dap_settings.map(|s| s.env.clone());
|
||||
|
||||
let delegate = self.delegate(worktree, console, cx);
|
||||
let cwd: Arc<Path> = worktree.read(cx).abs_path().as_ref().into();
|
||||
|
||||
let worktree = worktree.clone();
|
||||
cx.spawn(async move |this, cx| {
|
||||
let mut binary = adapter
|
||||
.get_binary(
|
||||
@@ -287,11 +287,7 @@ impl DapStore {
|
||||
.unwrap()
|
||||
.environment
|
||||
.update(cx, |environment, cx| {
|
||||
environment.get_local_directory_environment(
|
||||
&Shell::System,
|
||||
cwd,
|
||||
cx,
|
||||
)
|
||||
environment.worktree_environment(worktree, cx)
|
||||
})
|
||||
})?
|
||||
.await;
|
||||
@@ -607,9 +603,9 @@ impl DapStore {
|
||||
local_store.node_runtime.clone(),
|
||||
local_store.http_client.clone(),
|
||||
local_store.toolchain_store.clone(),
|
||||
local_store.environment.update(cx, |env, cx| {
|
||||
env.get_worktree_environment(worktree.clone(), cx)
|
||||
}),
|
||||
local_store
|
||||
.environment
|
||||
.update(cx, |env, cx| env.worktree_environment(worktree.clone(), cx)),
|
||||
local_store.is_headless,
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user