History

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

Kirill Bulatov committed 3 years ago

Commit 80c779b1 parent 139cbbf1 file · +2 −1Browse files

Unified · Split

crates/terminal_view/src/terminal_element.rs+2−1
@@ -400,7 +400,8 @@ impl TerminalElement { · 399 unmodified lines
400 region = region400 region = region
401 // Start selections401 // Start selections
402 .on_down(MouseButton::Left, move |event, v: &mut TerminalView, cx| {402 .on_down(MouseButton::Left, move |event, v: &mut TerminalView, cx| {
403 cx.focus_parent();403 let terminal_view = cx.handle();
404 cx.focus(&terminal_view);
404 v.context_menu.update(cx, |menu, _cx| menu.delay_cancel());405 v.context_menu.update(cx, |menu, _cx| menu.delay_cancel());
405 if let Some(conn_handle) = connection.upgrade(cx) {406 if let Some(conn_handle) = connection.upgrade(cx) {
406 conn_handle.update(cx, |terminal, cx| {407 conn_handle.update(cx, |terminal, cx| {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t