From 7b87a629ef2b84e7c09e6abe02aa2c51d3612ced Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 11:32:15 +0000 Subject: [PATCH] terminal: Properly apply focus when switching terminal via tabbing hotkey (#53127) (cherry-pick to preview) (#53618) Cherry-pick of #53127 to preview ---- Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #53056. Release Notes: - Fixed terminal tabs losing keyboard focus after switching tabs on Linux X11 Co-authored-by: Andre Roelofs --- crates/terminal_view/src/terminal_view.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rs index acccd6129f75ee2f5213fa359203220a7fee08c0..2f6a984798f35c87e39f51978ad84bfdfa435187 100644 --- a/crates/terminal_view/src/terminal_view.rs +++ b/crates/terminal_view/src/terminal_view.rs @@ -1356,7 +1356,9 @@ impl Item for TerminalView { h_flex() .gap_1() .group("term-tab-icon") - .track_focus(&self.focus_handle) + .when(!params.selected, |this| { + this.track_focus(&self.focus_handle) + }) .on_action(move |action: &RenameTerminal, window, cx| { self_handle .update(cx, |this, cx| this.rename_terminal(action, window, cx))