From 72c22b564e3aaa7ef308f11967fef72680d4d074 Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 11:16:23 +0000 Subject: [PATCH] acp: Update terminal tool call updates if we recieve a new one (#49456) (cherry-pick to preview) (#49458) Cherry-pick of #49456 to preview ---- This showed up mostly in agents that stream terminal output to Zed that the title wasn't updated in time to see the command when needing to provide permissions. Release Notes: - acp: Fix for ACP terminal titles not always being updated to their latest value. Co-authored-by: Bennet Bo Fenner Co-authored-by: Ben Brandt Co-authored-by: Bennet Bo Fenner --- crates/acp_thread/src/acp_thread.rs | 7 +++++++ crates/acp_thread/src/terminal.rs | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/crates/acp_thread/src/acp_thread.rs b/crates/acp_thread/src/acp_thread.rs index ea99df204145d563ce41401de64a7598f63d59d8..c414184a75ed763874841537c40fc75f8d847ee7 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 61da3c27b551cbdb156a86f120a8a7af4799af96..fceb816f7f1471af1e5e2fb87f82bf66978c3df7 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 { &self.working_dir }