aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-12 14:09:21 +0200
committeruser <user@clank>2026-08-12 14:09:21 +0200
commitea500ea70aa77da57870e8272bab593887819b0b (patch)
tree9e73592f03884dba54c3ff1ab3b5ab41cb9721d6 /zellij-utils
parentsl0p(pane-finder): find panes hidden in a stack, not just the visible one (diff)
downloadsl0ppij-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-utils')
-rw-r--r--zellij-utils/src/input/options.rs13
-rw-r--r--zellij-utils/src/ipc/protobuf_conversion.rs2
-rw-r--r--zellij-utils/src/ipc/tests/roundtrip_tests.rs5
-rw-r--r--zellij-utils/src/kdl/mod.rs34
-rw-r--r--zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string_with_comments.snap5
-rw-r--r--zellij-utils/src/kdl/snapshots/zellij_utils__kdl__config_options_to_string_with_comments.snap5
-rw-r--r--zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_config_options.snap2
-rw-r--r--zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_layout_options.snap2
-rw-r--r--zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments-3.snap2
-rw-r--r--zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap1
-rw-r--r--zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap1
-rw-r--r--zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_keybinds_override_config_keybinds.snap1
-rw-r--r--zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_options_override_config_options.snap2
-rw-r--r--zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap1
-rw-r--r--zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap1
15 files changed, 77 insertions, 0 deletions
diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs
index 5937237f..b4621c13 100644
--- a/zellij-utils/src/input/options.rs
+++ b/zellij-utils/src/input/options.rs
@@ -400,6 +400,15 @@ pub struct Options {
#[serde(default)]
pub mouse_hover_effects: Option<bool>,
+ /// Whether hovering a pane shows the "Ctrl <MouseScroll> or <drag borders> to
+ /// resize" hint. Split out from mouse_hover_effects, which also governs the
+ /// hover frame highlight: the hint is a beginner reminder you outgrow, while
+ /// the highlight is useful indefinitely.
+ /// default is true
+ #[clap(long, value_parser)]
+ #[serde(default)]
+ pub mouse_hover_help_text: Option<bool>,
+
/// Whether to show visual bell indicators (pane/tab frame flash and [!] suffix)
/// default is true
#[clap(long, value_parser)]
@@ -552,6 +561,7 @@ impl Options {
let advanced_mouse_actions = other.advanced_mouse_actions.or(self.advanced_mouse_actions);
let mouse_scroll_resize = other.mouse_scroll_resize.or(self.mouse_scroll_resize);
let mouse_hover_effects = other.mouse_hover_effects.or(self.mouse_hover_effects);
+ let mouse_hover_help_text = other.mouse_hover_help_text.or(self.mouse_hover_help_text);
let visual_bell = other.visual_bell.or(self.visual_bell);
let focus_follows_mouse = other.focus_follows_mouse.or(self.focus_follows_mouse);
let mouse_click_through = other.mouse_click_through.or(self.mouse_click_through);
@@ -619,6 +629,7 @@ impl Options {
advanced_mouse_actions,
mouse_scroll_resize,
mouse_hover_effects,
+ mouse_hover_help_text,
visual_bell,
focus_follows_mouse,
mouse_click_through,
@@ -707,6 +718,7 @@ impl Options {
let advanced_mouse_actions = other.advanced_mouse_actions.or(self.advanced_mouse_actions);
let mouse_scroll_resize = other.mouse_scroll_resize.or(self.mouse_scroll_resize);
let mouse_hover_effects = other.mouse_hover_effects.or(self.mouse_hover_effects);
+ let mouse_hover_help_text = other.mouse_hover_help_text.or(self.mouse_hover_help_text);
let visual_bell = other.visual_bell.or(self.visual_bell);
let focus_follows_mouse = merge_bool(other.focus_follows_mouse, self.focus_follows_mouse);
let mouse_click_through = merge_bool(other.mouse_click_through, self.mouse_click_through);
@@ -774,6 +786,7 @@ impl Options {
advanced_mouse_actions,
mouse_scroll_resize,
mouse_hover_effects,
+ mouse_hover_help_text,
visual_bell,
focus_follows_mouse,
mouse_click_through,
diff --git a/zellij-utils/src/ipc/protobuf_conversion.rs b/zellij-utils/src/ipc/protobuf_conversion.rs
index c3cf4d8d..26c78f97 100644
--- a/zellij-utils/src/ipc/protobuf_conversion.rs
+++ b/zellij-utils/src/ipc/protobuf_conversion.rs
@@ -912,6 +912,8 @@ impl TryFrom<crate::client_server_contract::client_server_contract::Options>
advanced_mouse_actions: options.advanced_mouse_actions,
mouse_scroll_resize: options.mouse_scroll_resize,
mouse_hover_effects: options.mouse_hover_effects,
+ // no protobuf slot; a config-only option
+ mouse_hover_help_text: None,
web_server_ip: options
.web_server_ip
.map(|ip| ip.parse())
diff --git a/zellij-utils/src/ipc/tests/roundtrip_tests.rs b/zellij-utils/src/ipc/tests/roundtrip_tests.rs
index fb952d05..a9eadf05 100644
--- a/zellij-utils/src/ipc/tests/roundtrip_tests.rs
+++ b/zellij-utils/src/ipc/tests/roundtrip_tests.rs
@@ -494,6 +494,11 @@ fn test_client_messages() {
post_command_discovery_hook: Some("post_command_discovery_hook".to_owned()),
client_async_worker_tasks: Some(16),
mouse_hover_effects: Some(false),
+ // Deliberately None: mouse_hover_help_text has no protobuf slot,
+ // so it does not cross this contract. The server reads it from the
+ // config file itself and merge() keeps the file value when the
+ // client sends None -- so config works, a CLI flag would not.
+ mouse_hover_help_text: None,
visual_bell: Some(true),
focus_follows_mouse: Some(false),
mouse_click_through: Some(false),
diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs
index b2b576dc..88ea7dbe 100644
--- a/zellij-utils/src/kdl/mod.rs
+++ b/zellij-utils/src/kdl/mod.rs
@@ -2885,6 +2885,9 @@ impl Options {
let mouse_hover_effects =
kdl_property_first_arg_as_bool_or_error!(kdl_options, "mouse_hover_effects")
.map(|(v, _)| v);
+ let mouse_hover_help_text =
+ kdl_property_first_arg_as_bool_or_error!(kdl_options, "mouse_hover_help_text")
+ .map(|(v, _)| v);
let web_server_ip =
match kdl_property_first_arg_as_string_or_error!(kdl_options, "web_server_ip") {
Some((string, entry)) => Some(IpAddr::from_str(string).map_err(|_| {
@@ -3022,6 +3025,7 @@ impl Options {
advanced_mouse_actions,
mouse_scroll_resize,
mouse_hover_effects,
+ mouse_hover_help_text,
visual_bell,
focus_follows_mouse,
mouse_click_through,
@@ -4308,6 +4312,33 @@ impl Options {
None
}
}
+ fn mouse_hover_help_text_to_kdl(&self, add_comments: bool) -> Option<KdlNode> {
+ let comment_text = format!(
+ "{}\n{}\n{}",
+ " ",
+ "// Whether hovering a pane shows the \"Ctrl <MouseScroll> or <drag borders> to resize\" hint",
+ "// default is true",
+ );
+
+ let create_node = |node_value: bool| -> KdlNode {
+ let mut node = KdlNode::new("mouse_hover_help_text");
+ node.push(KdlValue::Bool(node_value));
+ node
+ };
+ if let Some(mouse_hover_help_text) = self.mouse_hover_help_text {
+ let mut node = create_node(mouse_hover_help_text);
+ if add_comments {
+ node.set_leading(format!("{}\n", comment_text));
+ }
+ Some(node)
+ } else if add_comments {
+ let mut node = create_node(false);
+ node.set_leading(format!("{}\n// ", comment_text));
+ Some(node)
+ } else {
+ None
+ }
+ }
fn mouse_hover_effects_to_kdl(&self, add_comments: bool) -> Option<KdlNode> {
let comment_text = format!(
"{}\n{}\n{}",
@@ -4794,6 +4825,9 @@ impl Options {
if let Some(mouse_hover_effects) = self.mouse_hover_effects_to_kdl(add_comments) {
nodes.push(mouse_hover_effects);
}
+ if let Some(mouse_hover_help_text) = self.mouse_hover_help_text_to_kdl(add_comments) {
+ nodes.push(mouse_hover_help_text);
+ }
if let Some(visual_bell) = self.visual_bell_to_kdl(add_comments) {
nodes.push(visual_bell);
}
diff --git a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string_with_comments.snap b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string_with_comments.snap
index 1311a824..8413e638 100644
--- a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string_with_comments.snap
+++ b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string_with_comments.snap
@@ -1,5 +1,6 @@
---
source: zellij-utils/src/kdl/mod.rs
+assertion_line: 8001
expression: fake_config_stringified
---
keybinds clear-defaults=true {
@@ -574,6 +575,10 @@ web_client {
// default is true
// mouse_hover_effects false
+// Whether hovering a pane shows the "Ctrl <MouseScroll> or <drag borders> to resize" hint
+// default is true
+// mouse_hover_help_text false
+
// Whether to show visual bell indicators (pane/tab frame flash and [!] suffix)
// default is true
// visual_bell true
diff --git a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__config_options_to_string_with_comments.snap b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__config_options_to_string_with_comments.snap
index 2e9364b1..5c694d96 100644
--- a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__config_options_to_string_with_comments.snap
+++ b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__config_options_to_string_with_comments.snap
@@ -1,5 +1,6 @@
---
source: zellij-utils/src/kdl/mod.rs
+assertion_line: 7877
expression: fake_document.to_string()
---
@@ -288,6 +289,10 @@ web_sharing "disabled"
// default is true
// mouse_hover_effects false
+// Whether hovering a pane shows the "Ctrl <MouseScroll> or <drag borders> to resize" hint
+// default is true
+// mouse_hover_help_text false
+
// Whether to show visual bell indicators (pane/tab frame flash and [!] suffix)
// default is true
// visual_bell true
diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_config_options.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_config_options.snap
index 782d4644..2bb77aeb 100644
--- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_config_options.snap
+++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_config_options.snap
@@ -1,5 +1,6 @@
---
source: zellij-utils/src/setup.rs
+assertion_line: 703
expression: "format!(\"{:#?}\", options)"
---
Options {
@@ -46,6 +47,7 @@ Options {
advanced_mouse_actions: None,
mouse_scroll_resize: None,
mouse_hover_effects: None,
+ mouse_hover_help_text: None,
visual_bell: None,
focus_follows_mouse: None,
mouse_click_through: None,
diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_layout_options.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_layout_options.snap
index fc82f281..fd2ced24 100644
--- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_layout_options.snap
+++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__cli_arguments_override_layout_options.snap
@@ -1,5 +1,6 @@
---
source: zellij-utils/src/setup.rs
+assertion_line: 737
expression: "format!(\"{:#?}\", options)"
---
Options {
@@ -46,6 +47,7 @@ Options {
advanced_mouse_actions: None,
mouse_scroll_resize: None,
mouse_hover_effects: None,
+ mouse_hover_help_text: None,
visual_bell: None,
focus_follows_mouse: None,
mouse_click_through: None,
diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments-3.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments-3.snap
index 16e628ed..c351948f 100644
--- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments-3.snap
+++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments-3.snap
@@ -1,5 +1,6 @@
---
source: zellij-utils/src/setup.rs
+assertion_line: 693
expression: "format!(\"{:#?}\", options)"
---
Options {
@@ -44,6 +45,7 @@ Options {
advanced_mouse_actions: None,
mouse_scroll_resize: None,
mouse_hover_effects: None,
+ mouse_hover_help_text: None,
visual_bell: None,
focus_follows_mouse: None,
mouse_click_through: None,
diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap
index ba0a450f..56798240 100644
--- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap
+++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments.snap
@@ -6076,6 +6076,7 @@ Config {
advanced_mouse_actions: None,
mouse_scroll_resize: None,
mouse_hover_effects: None,
+ mouse_hover_help_text: None,
visual_bell: None,
focus_follows_mouse: None,
mouse_click_through: None,
diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap
index c1aade01..1541d678 100644
--- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap
+++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_env_vars_override_config_env_vars.snap
@@ -6076,6 +6076,7 @@ Config {
advanced_mouse_actions: None,
mouse_scroll_resize: None,
mouse_hover_effects: None,
+ mouse_hover_help_text: None,
visual_bell: None,
focus_follows_mouse: None,
mouse_click_through: None,
diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_keybinds_override_config_keybinds.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_keybinds_override_config_keybinds.snap
index 692ffc41..126a7274 100644
--- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_keybinds_override_config_keybinds.snap
+++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_keybinds_override_config_keybinds.snap
@@ -132,6 +132,7 @@ Config {
advanced_mouse_actions: None,
mouse_scroll_resize: None,
mouse_hover_effects: None,
+ mouse_hover_help_text: None,
visual_bell: None,
focus_follows_mouse: None,
mouse_click_through: None,
diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_options_override_config_options.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_options_override_config_options.snap
index da4f16b6..6716af69 100644
--- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_options_override_config_options.snap
+++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_options_override_config_options.snap
@@ -1,5 +1,6 @@
---
source: zellij-utils/src/setup.rs
+assertion_line: 713
expression: "format!(\"{:#?}\", options)"
---
Options {
@@ -46,6 +47,7 @@ Options {
advanced_mouse_actions: None,
mouse_scroll_resize: None,
mouse_hover_effects: None,
+ mouse_hover_help_text: None,
visual_bell: None,
focus_follows_mouse: None,
mouse_click_through: None,
diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap
index e39b5a54..a83dd9f6 100644
--- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap
+++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_themes_override_config_themes.snap
@@ -6076,6 +6076,7 @@ Config {
advanced_mouse_actions: None,
mouse_scroll_resize: None,
mouse_hover_effects: None,
+ mouse_hover_help_text: None,
visual_bell: None,
focus_follows_mouse: None,
mouse_click_through: None,
diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap
index 515d46b1..79f1c716 100644
--- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap
+++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__layout_ui_config_overrides_config_ui_config.snap
@@ -6076,6 +6076,7 @@ Config {
advanced_mouse_actions: None,
mouse_scroll_resize: None,
mouse_hover_effects: None,
+ mouse_hover_help_text: None,
visual_bell: None,
focus_follows_mouse: None,
mouse_click_through: None,