This commit is contained in:
Lukas Wirth 2025-08-27 00:39:16 +08:00 committed by GitHub
commit 2bc349a9f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 899 additions and 722 deletions

View file

@ -2,7 +2,7 @@ use agent_client_protocol as acp;
use anyhow::Result;
use futures::{FutureExt as _, future::Shared};
use gpui::{App, AppContext, Entity, SharedString, Task};
use project::{Project, terminals::TerminalKind};
use project::Project;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::{
@ -144,15 +144,22 @@ impl AgentTool for TerminalTool {
let terminal = self
.project
.update(cx, |project, cx| {
project.create_terminal(
TerminalKind::Task(task::SpawnInTerminal {
project.create_terminal_task(
task::SpawnInTerminal {
command: Some(program),
args,
cwd: working_dir.clone(),
env,
..Default::default()
}),
},
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(Path::new("")),
}),
)
})?
.await?;