From 80c779b95e610ade8258cf5dcf28fa4f8ac7cd2c Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 16 Aug 2023 15:06:42 +0300 Subject: [PATCH] Focus terminal view on mouse click in terminal Before, terminal view focused the parent (pane) instead and, if terminal's search bar was open and focused, pane transferred the focus back --- crates/terminal_view/src/terminal_element.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/terminal_view/src/terminal_element.rs b/crates/terminal_view/src/terminal_element.rs index 232d3c5535..0ac189db0b 100644 --- a/crates/terminal_view/src/terminal_element.rs +++ b/crates/terminal_view/src/terminal_element.rs @@ -400,7 +400,8 @@ impl TerminalElement { region = region // Start selections .on_down(MouseButton::Left, move |event, v: &mut TerminalView, cx| { - cx.focus_parent(); + let terminal_view = cx.handle(); + cx.focus(&terminal_view); v.context_menu.update(cx, |menu, _cx| menu.delay_cancel()); if let Some(conn_handle) = connection.upgrade(cx) { conn_handle.update(cx, |terminal, cx| {