Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

acp: Update terminal tool call updates if we recieve a new one (#49456)

Ben Brandtd5d49c17175f
diff --git a/crates/acp_thread/src/acp_thread.rs b/crates/acp_thread/src/acp_thread.rs
index 57cad634864..433abfb12e2 100644
--- a/crates/acp_thread/src/acp_thread.rs
+++ b/crates/acp_thread/src/acp_thread.rs
@@ -314,6 +314,13 @@ impl ToolCall {
}
if let Some(title) = title {
+ if self.kind == acp::ToolKind::Execute {
+ for terminal in self.terminals() {
+ terminal.update(cx, |terminal, cx| {
+ terminal.update_command_label(&title, cx);
+ });
+ }
+ }
self.label.update(cx, |label, cx| {
if self.kind == acp::ToolKind::Execute {
label.replace(title, cx);
diff --git a/crates/acp_thread/src/terminal.rs b/crates/acp_thread/src/terminal.rs
index 61da3c27b55..fceb816f7f1 100644
--- a/crates/acp_thread/src/terminal.rs
+++ b/crates/acp_thread/src/terminal.rs
@@ -167,6 +167,12 @@ impl Terminal {
&self.command
}
+ pub fn update_command_label(&self, label: &str, cx: &mut App) {
+ self.command.update(cx, |command, cx| {
+ command.replace(format!("```\n{}\n```", label), cx);
+ });
+ }
+
pub fn working_dir(&self) -> &Option<PathBuf> {
&self.working_dir
}