From ce7512b115504a38f988dc7cc8306acacc1ca3e2 Mon Sep 17 00:00:00 2001 From: Mohammad Razeghi Date: Mon, 30 Mar 2026 09:24:26 +0200 Subject: [PATCH] Fix terminal rename not working from context menu on inactive tabs (#50031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #49939 Before you mark this PR as ready for review, make sure that you have: - [x] Added a solid test coverage and/or screenshots from doing manual testing Screenshot 2026-02-24 at 11 53 57 PM - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Fix terminal rename not working from context menu on inactive tabs --- crates/terminal_view/src/terminal_view.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rs index 3f38ee2f0fd7f64fd996d9011d28ec942d02c86d..f3188f0f3ab4e7288d406fb43b0d3a416a76771f 100644 --- a/crates/terminal_view/src/terminal_view.rs +++ b/crates/terminal_view/src/terminal_view.rs @@ -1350,9 +1350,16 @@ impl Item for TerminalView { None => (IconName::Terminal, Color::Muted, None), }; + let self_handle = self.self_handle.clone(); h_flex() .gap_1() .group("term-tab-icon") + .track_focus(&self.focus_handle) + .on_action(move |action: &RenameTerminal, window, cx| { + self_handle + .update(cx, |this, cx| this.rename_terminal(action, window, cx)) + .ok(); + }) .child( h_flex() .group("term-tab-icon")