diff options
| author | user <user@clank> | 2026-08-12 14:09:21 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-12 14:09:21 +0200 |
| commit | ea500ea70aa77da57870e8272bab593887819b0b (patch) | |
| tree | 9e73592f03884dba54c3ff1ab3b5ab41cb9721d6 /zellij-server/src/tab | |
| parent | sl0p(pane-finder): find panes hidden in a stack, not just the visible one (diff) | |
| download | sl0ppij-ea500ea70aa77da57870e8272bab593887819b0b.tar.gz sl0ppij-ea500ea70aa77da57870e8272bab593887819b0b.tar.xz sl0ppij-ea500ea70aa77da57870e8272bab593887819b0b.zip | |
sl0p: separate the hover resize hint from the hover highlight
Upstream's mouse_hover_effects governs two unrelated things: the frame highlight
on hover, and the "Ctrl <MouseScroll> or <drag borders> to resize" hint. Its own
comment in default.kdl admits as much. So silencing a beginner reminder you have
outgrown also costs you a highlight that stays useful indefinitely.
mouse_hover_help_text (default true) gates only the hint. One line in
execute_send_to_terminal; the highlight is set in execute_update_hover and is
untouched.
Config-file only, deliberately. The option has no protobuf slot, so it does not
cross the client/server IPC contract -- the roundtrip test asserts exactly that,
with the fixture set to None and a comment explaining why. It still works from
the config file because the server parses the file itself and Options::merge
keeps the file value when the client sends None; a CLI flag would be silently
ignored.
Diffstat (limited to 'zellij-server/src/tab')
| -rw-r--r-- | zellij-server/src/tab/mod.rs | 8 | ||||
| -rw-r--r-- | zellij-server/src/tab/mouse_handler.rs | 2 | ||||
| -rw-r--r-- | zellij-server/src/tab/unit/tab_integration_tests.rs | 10 | ||||
| -rw-r--r-- | zellij-server/src/tab/unit/tab_tests.rs | 3 |
4 files changed, 22 insertions, 1 deletions
diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index 7cda7506..f5c30853 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -368,6 +368,9 @@ pub(crate) struct Tab { advanced_mouse_actions: bool, mouse_scroll_resize: bool, mouse_hover_effects: bool, + /// Whether hovering shows the resize hint. Separate from mouse_hover_effects + /// so the hint can be dropped without losing the hover frame highlight. + mouse_hover_help_text: bool, focus_follows_mouse: bool, mouse_click_through: bool, /// Repeated clicks on pane FRAMES, per client. Separate from the grid's own @@ -1062,6 +1065,7 @@ impl Tab { advanced_mouse_actions: bool, mouse_scroll_resize: bool, mouse_hover_effects: bool, + mouse_hover_help_text: bool, focus_follows_mouse: bool, mouse_click_through: bool, web_server_ip: IpAddr, @@ -1203,6 +1207,7 @@ impl Tab { advanced_mouse_actions, mouse_scroll_resize, mouse_hover_effects, + mouse_hover_help_text, focus_follows_mouse, mouse_click_through, frame_clicks: HashMap::new(), @@ -8049,6 +8054,9 @@ impl Tab { pub fn update_mouse_scroll_resize(&mut self, mouse_scroll_resize: bool) { self.mouse_scroll_resize = mouse_scroll_resize; } + pub fn update_mouse_hover_help_text(&mut self, mouse_hover_help_text: bool) { + self.mouse_hover_help_text = mouse_hover_help_text; + } pub fn update_mouse_hover_effects(&mut self, mouse_hover_effects: bool) { self.mouse_hover_effects = mouse_hover_effects; } diff --git a/zellij-server/src/tab/mouse_handler.rs b/zellij-server/src/tab/mouse_handler.rs index 5e8c38e5..b91ae67a 100644 --- a/zellij-server/src/tab/mouse_handler.rs +++ b/zellij-server/src/tab/mouse_handler.rs @@ -1452,7 +1452,7 @@ impl MouseHandler { .insert(client_id, Instant::now()); let entered_pane = tab.mouse_last_pane_id.get(&client_id) != Some(&pane_id); tab.mouse_last_pane_id.insert(client_id, pane_id); - if entered_pane { + if entered_pane && tab.mouse_hover_help_text { let was_visible = tab .mouse_help_text_visible .get(&client_id) diff --git a/zellij-server/src/tab/unit/tab_integration_tests.rs b/zellij-server/src/tab/unit/tab_integration_tests.rs index eb1df250..47c894bc 100644 --- a/zellij-server/src/tab/unit/tab_integration_tests.rs +++ b/zellij-server/src/tab/unit/tab_integration_tests.rs @@ -279,6 +279,7 @@ fn create_new_tab(size: Size, default_mode: ModeInfo) -> Tab { advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -377,6 +378,7 @@ fn create_new_tab_with_stacked_pane_list( advanced_mouse_actions, mouse_scroll_resize, true, + true, // mouse_hover_help_text false, false, web_server_ip, @@ -471,6 +473,7 @@ fn create_new_tab_without_pane_frames(size: Size, default_mode: ModeInfo) -> Tab advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -582,6 +585,7 @@ fn create_new_tab_with_swap_layouts( advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -690,6 +694,7 @@ fn create_new_tab_with_os_api( advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -784,6 +789,7 @@ fn create_new_tab_with_layout(size: Size, default_mode: ModeInfo, layout: &str) advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -892,6 +898,7 @@ fn create_new_tab_with_mock_pty_writer( advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -991,6 +998,7 @@ fn create_new_tab_with_sixel_support( advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -13363,6 +13371,7 @@ fn create_new_tab_with_plugin_receiver( advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -15151,6 +15160,7 @@ fn create_new_tab_with_server_receiver( true, // advanced_mouse_actions true, // mouse_scroll_resize true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), diff --git a/zellij-server/src/tab/unit/tab_tests.rs b/zellij-server/src/tab/unit/tab_tests.rs index a3713739..65354069 100644 --- a/zellij-server/src/tab/unit/tab_tests.rs +++ b/zellij-server/src/tab/unit/tab_tests.rs @@ -221,6 +221,7 @@ fn create_new_tab(size: Size, stacked_resize: bool) -> Tab { advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -312,6 +313,7 @@ fn create_new_tab_with_layout(size: Size, layout: TiledPaneLayout) -> Tab { advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, @@ -409,6 +411,7 @@ fn create_new_tab_with_cell_size( advanced_mouse_actions, mouse_scroll_resize, true, // mouse_hover_effects + true, // mouse_hover_help_text false, // focus_follows_mouse false, // mouse_click_through web_server_ip, |
