Load python venv for tasks

This commit is contained in:
Lukas Wirth 2025-08-22 12:06:07 +02:00
parent d2f2142127
commit 333354024d
8 changed files with 236 additions and 115 deletions

View file

@ -1018,8 +1018,15 @@ impl RunningState {
project.create_terminal_task(
task_with_shell.clone(),
cx,
project
.active_entry()
.and_then(|entry_id| project.worktree_id_for_entry(entry_id, cx))
.map(|worktree_id| project::ProjectPath {
worktree_id,
path: Arc::from(std::path::Path::new("")),
}),
)
})??;
})?.await?;
let terminal_view = cx.new_window_entity(|window, cx| {
TerminalView::new(
@ -1186,10 +1193,21 @@ impl RunningState {
let workspace = self.workspace.clone();
let weak_project = project.downgrade();
let terminal_task =
project.update(cx, |project, cx| project.create_terminal_task(kind, cx));
let terminal_task = project.update(cx, |project, cx| {
project.create_terminal_task(
kind,
cx,
project
.active_entry()
.and_then(|entry_id| project.worktree_id_for_entry(entry_id, cx))
.map(|worktree_id| project::ProjectPath {
worktree_id,
path: Arc::from(std::path::Path::new("")),
}),
)
});
let terminal_task = cx.spawn_in(window, async move |_, cx| {
let terminal = terminal_task?;
let terminal = terminal_task.await?;
let terminal_view = cx.new_window_entity(|window, cx| {
TerminalView::new(terminal.clone(), workspace, None, weak_project, window, cx)