diff --git a/default-plugins/status-bar/src/one_line_ui.rs b/default-plugins/status-bar/src/one_line_ui.rs index 3b7eec10..b230a25b 100644 --- a/default-plugins/status-bar/src/one_line_ui.rs +++ b/default-plugins/status-bar/src/one_line_ui.rs @@ -682,9 +682,22 @@ fn render_secondary_info( } } +fn should_show_focus_and_resize_shortcuts(tab_info: Option<&TabInfo>) -> bool { + let Some(tab_info) = tab_info else { + return false; + }; + let are_floating_panes_visible = tab_info.are_floating_panes_visible; + if are_floating_panes_visible { + tab_info.selectable_floating_panes_count > 1 + } else { + tab_info.selectable_tiled_panes_count > 1 + } +} + fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usize) -> LinePart { let mut secondary_info = LinePart::default(); let binds = &help.get_mode_keybinds(); + let should_show_focus_and_resize_shortcuts = should_show_focus_and_resize_shortcuts(tab_info); // New Pane let new_pane_action_key = action_key(binds, &[Action::NewPane(None, None, false)]); let mut new_pane_key_to_display = new_pane_action_key @@ -698,6 +711,25 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz vec![] }; + // Resize + let resize_increase_action_key = action_key(binds, &[Action::Resize(Resize::Increase, None)]); + let resize_increase_key = resize_increase_action_key + .iter() + .find(|k| k.bare_key == BareKey::Char('+')) + .or_else(|| resize_increase_action_key.iter().next()); + let resize_decrease_action_key = action_key(binds, &[Action::Resize(Resize::Decrease, None)]); + let resize_decrease_key = resize_decrease_action_key + .iter() + .find(|k| k.bare_key == BareKey::Char('-')) + .or_else(|| resize_increase_action_key.iter().next()); + let mut resize_shortcuts = vec![]; + if let Some(resize_increase_key) = resize_increase_key { + resize_shortcuts.push(resize_increase_key.clone()); + } + if let Some(resize_decrease_key) = resize_decrease_key { + resize_shortcuts.push(resize_decrease_key.clone()); + } + // Move focus let mut move_focus_shortcuts: Vec = vec![]; @@ -757,6 +789,7 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz [ new_pane_key_to_display.clone(), move_focus_shortcuts.clone(), + resize_shortcuts.clone(), toggle_floating_key_to_display.clone(), ] .iter() @@ -773,13 +806,22 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz false, Some(0), )); - secondary_info.append(&add_shortcut( - help, - "Change Focus", - &move_focus_shortcuts, - false, - Some(0), - )); + if should_show_focus_and_resize_shortcuts { + secondary_info.append(&add_shortcut( + help, + "Change Focus", + &move_focus_shortcuts, + false, + Some(0), + )); + secondary_info.append(&add_shortcut( + help, + "Resize", + &resize_shortcuts, + false, + Some(0), + )); + } secondary_info.append(&add_shortcut( help, "Floating", @@ -808,6 +850,10 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz .iter() .map(|k| k.strip_common_modifiers(&common_modifiers)) .collect(); + let resize_shortcuts: Vec = resize_shortcuts + .iter() + .map(|k| k.strip_common_modifiers(&common_modifiers)) + .collect(); let toggle_floating_key_to_display: Vec = toggle_floating_key_to_display .iter() .map(|k| k.strip_common_modifiers(&common_modifiers)) @@ -818,12 +864,20 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz new_pane_key_to_display, false, )); - secondary_info.append(&add_shortcut_with_inline_key( - help, - "Change Focus", - move_focus_shortcuts, - false, - )); + if should_show_focus_and_resize_shortcuts { + secondary_info.append(&add_shortcut_with_inline_key( + help, + "Change Focus", + move_focus_shortcuts, + false, + )); + secondary_info.append(&add_shortcut_with_inline_key( + help, + "Resize", + resize_shortcuts, + false, + )); + } secondary_info.append(&add_shortcut_with_inline_key( help, "Floating", @@ -844,13 +898,22 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz false, Some(0), )); - short_line.append(&add_shortcut( - help, - "Focus", - &move_focus_shortcuts, - false, - Some(0), - )); + if should_show_focus_and_resize_shortcuts { + short_line.append(&add_shortcut( + help, + "Focus", + &move_focus_shortcuts, + false, + Some(0), + )); + short_line.append(&add_shortcut( + help, + "Resize", + &resize_shortcuts, + false, + Some(0), + )); + } short_line.append(&add_shortcut( help, "Floating", @@ -879,6 +942,10 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz .iter() .map(|k| k.strip_common_modifiers(&common_modifiers)) .collect(); + let resize_shortcuts: Vec = resize_shortcuts + .iter() + .map(|k| k.strip_common_modifiers(&common_modifiers)) + .collect(); let toggle_floating_key_to_display: Vec = toggle_floating_key_to_display .iter() @@ -890,12 +957,20 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz new_pane_key_to_display, false, )); - short_line.append(&add_shortcut_with_inline_key( - help, - "Focus", - move_focus_shortcuts, - false, - )); + if should_show_focus_and_resize_shortcuts { + short_line.append(&add_shortcut_with_inline_key( + help, + "Focus", + move_focus_shortcuts, + false, + )); + short_line.append(&add_shortcut_with_inline_key( + help, + "Resize", + resize_shortcuts, + false, + )); + } short_line.append(&add_shortcut_with_inline_key( help, "Floating", @@ -903,7 +978,21 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz are_floating_panes_visible, )); } - short_line + if short_line.len <= max_len { + short_line + } else { + let part = serialize_text( + &Text::new(format!( + "{:>width$}", + "...", + width = max_len.saturating_sub(3) + )) + .color_range(0, ..) + .opaque(), + ); + let len = max_len.saturating_sub(3); + LinePart { part, len } + } } } @@ -982,6 +1071,7 @@ fn add_shortcut_with_inline_key( "←→" => "", "↓↑" => "", "[]" => "", + "+-" => "", _ => "|", }; diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__bracketed_paste.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__bracketed_paste.snap index 77031624..ae19e21a 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__bracketed_paste.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__bracketed_paste.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1975 +assertion_line: 2000 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__cannot_split_terminals_vertically_when_active_terminal_is_too_small.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__cannot_split_terminals_vertically_when_active_terminal_is_too_small.snap index 98b108ed..0fcc6a97 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__cannot_split_terminals_vertically_when_active_terminal_is_too_small.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__cannot_split_terminals_vertically_when_active_terminal_is_too_small.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 243 +assertion_line: 239 expression: last_snapshot --- Zellij @@ -22,4 +22,4 @@ expression: last_snapshot │ │ │ │ └──────┘ - Ctrl + +... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_pane.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_pane.snap index 8ad2ef36..1446dcec 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_pane.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__close_pane.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 707 +assertion_line: 714 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap index 705a746e..d1108acc 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__detach_and_attach_session.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1138 +assertion_line: 1154 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_pane_with_mouse.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_pane_with_mouse.snap index 173f8914..dc28b8ed 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_pane_with_mouse.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__focus_pane_with_mouse.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1352 +assertion_line: 1373 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__load_plugins_in_background_on_startup.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__load_plugins_in_background_on_startup.snap index cabf017a..60540b3b 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__load_plugins_in_background_on_startup.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__load_plugins_in_background_on_startup.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 2426 +assertion_line: 2424 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl g  UNLOCK  Alt +  New Pane  <←↓↑→> Change Focus  Floating  + Ctrl g  UNLOCK  Alt +  New Pane  Floating  diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__mirrored_sessions.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__mirrored_sessions.snap index 9fb84667..66b38f8a 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__mirrored_sessions.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__mirrored_sessions.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1624 +assertion_line: 1650 expression: first_runner_snapshot --- Zellij (mirrored_sessions)  Tab #1  Tab #2  @@ -26,4 +26,4 @@ expression: first_runner_snapshot │ ││ │ │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_left.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_left.snap index c0d32cdd..373974fe 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_left.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_left.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 558 +assertion_line: 562 expression: account_for_races_in_snapshot(last_snapshot) --- Zellij (e2e-test)  Tab #1  Tab #3  Tab #2  @@ -26,4 +26,4 @@ expression: account_for_races_in_snapshot(last_snapshot) │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_left_until_it_wraps_around.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_left_until_it_wraps_around.snap index b7898ffb..95d77566 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_left_until_it_wraps_around.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_left_until_it_wraps_around.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 620 +assertion_line: 624 expression: account_for_races_in_snapshot(last_snapshot) --- Zellij (e2e-test)  Tab #2  Tab #1  Tab #3  @@ -26,4 +26,4 @@ expression: account_for_races_in_snapshot(last_snapshot) │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_right.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_right.snap index dfe09d2e..1b56f139 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_right.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_right.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 592 +assertion_line: 596 expression: account_for_races_in_snapshot(last_snapshot) --- Zellij (e2e-test)  Tab #1  Tab #3  Tab #2  @@ -26,4 +26,4 @@ expression: account_for_races_in_snapshot(last_snapshot) │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_right_until_it_wraps_around.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_right_until_it_wraps_around.snap index 0baedb2a..7e183faf 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_right_until_it_wraps_around.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__move_tab_to_right_until_it_wraps_around.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 644 +assertion_line: 648 expression: account_for_races_in_snapshot(last_snapshot) --- Zellij (e2e-test)  Tab #3  Tab #2  Tab #1  @@ -26,4 +26,4 @@ expression: account_for_races_in_snapshot(last_snapshot) │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab-2.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab-2.snap index daf4e132..ebbcdab3 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab-2.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab-2.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1809 +assertion_line: 1836 expression: second_runner_snapshot --- Zellij (multiple_users_in_same_pane_and_tab)  Tab #1 [ ] @@ -26,4 +26,4 @@ expression: second_runner_snapshot │ ││ │ │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab.snap index ee6b7f0c..5a36f54f 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_panes_and_same_tab.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1808 +assertion_line: 1835 expression: first_runner_snapshot --- Zellij (multiple_users_in_same_pane_and_tab)  Tab #1 [ ] @@ -26,4 +26,4 @@ expression: first_runner_snapshot │ ││ │ │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs-2.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs-2.snap index dc5de24b..709201a5 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs-2.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs-2.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1907 +assertion_line: 1936 expression: second_runner_snapshot --- Zellij (multiple_users_in_different_tabs)  Tab #1 [ ] Tab #2  @@ -26,4 +26,4 @@ expression: second_runner_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs.snap index c6ef6230..ab4b8cb0 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_different_tabs.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1906 +assertion_line: 1935 expression: first_runner_snapshot --- Zellij (multiple_users_in_different_tabs)  Tab #1  Tab #2 [ ] @@ -26,4 +26,4 @@ expression: first_runner_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab-2.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab-2.snap index 3049701b..e26aab19 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab-2.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab-2.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1716 +assertion_line: 1741 expression: second_runner_snapshot --- Zellij (multiple_users_in_same_pane_and_tab)  Tab #1 [ ] @@ -26,4 +26,4 @@ expression: second_runner_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab.snap index e3830eb6..f41f6e33 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__multiple_users_in_same_pane_and_tab.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1718 +assertion_line: 1740 expression: first_runner_snapshot --- Zellij (multiple_users_in_same_pane_and_tab)  Tab #1 [ ] @@ -26,4 +26,4 @@ expression: first_runner_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__open_new_tab.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__open_new_tab.snap index 93be29fc..1d10a813 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__open_new_tab.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__open_new_tab.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 452 +assertion_line: 454 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  Tab #2  @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__pin_floating_panes.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__pin_floating_panes.snap index 91233bb1..3ee33c28 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__pin_floating_panes.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__pin_floating_panes.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 2524 +assertion_line: 2521 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_pane.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_pane.snap index 79b5028a..5c99ad82 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_pane.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_pane.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 923 +assertion_line: 935 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ │ ││ │ └────────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_terminal_window.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_terminal_window.snap index b2401f43..cabfa1b0 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_terminal_window.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__resize_terminal_window.snap @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ │ ││ │ └────────────────────────────────────────────────┘└────────────────────────────────────────────────┘ - Ctrl + g  p  t  n  h  s  o  q  Alt +  New  <←↓↑→> Focus  Floating  + Ctrl + g  p  t  n  h  s  o  q  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__scrolling_inside_a_pane_with_mouse.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__scrolling_inside_a_pane_with_mouse.snap index a8ec256e..faf9e7db 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__scrolling_inside_a_pane_with_mouse.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__scrolling_inside_a_pane_with_mouse.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1428 +assertion_line: 1451 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ ││line18 │ │ ││li█e19 │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap index 623bfb73..06df9196 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__send_command_through_the_cli.snap @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ │ ││ │ └─────────────────────────────────────────────────────────────────────────┘└ [ EXIT CODE: 0 ] re-run, drop to shell, exit ────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__split_terminals_vertically.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__split_terminals_vertically.snap index 1ca3ee0a..952ec419 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__split_terminals_vertically.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__split_terminals_vertically.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 194 +assertion_line: 195 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__start_without_pane_frames.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__start_without_pane_frames.snap index 2d048e02..8bf6c292 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__start_without_pane_frames.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__start_without_pane_frames.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1476 +assertion_line: 1500 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ $ │ │ │ │ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__starts_with_one_terminal.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__starts_with_one_terminal.snap index a78c91c2..d192ad71 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__starts_with_one_terminal.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__starts_with_one_terminal.snap @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__tmux_mode.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__tmux_mode.snap index dc180a12..8ac4c1d1 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__tmux_mode.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__tmux_mode.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 2070 +assertion_line: 2099 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_floating_panes.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_floating_panes.snap index 81bf5771..d14b66f4 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_floating_panes.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_floating_panes.snap @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_pane_fullscreen.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_pane_fullscreen.snap index 58371d4e..3f5815f9 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_pane_fullscreen.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_pane_fullscreen.snap @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__typing_exit_closes_pane.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__typing_exit_closes_pane.snap index 33ffd4b5..81ea9934 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__typing_exit_closes_pane.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__typing_exit_closes_pane.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 858 +assertion_line: 867 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__undo_rename_pane.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__undo_rename_pane.snap index 859a9763..03485381 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__undo_rename_pane.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__undo_rename_pane.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 2240 +assertion_line: 2263 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__undo_rename_tab.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__undo_rename_tab.snap index 7fa61630..14aa5856 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__undo_rename_tab.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__undo_rename_tab.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 2183 +assertion_line: 2206 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  @@ -26,4 +26,4 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  ... diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs index 244f188b..08c023da 100644 --- a/zellij-server/src/screen.rs +++ b/zellij-server/src/screen.rs @@ -1540,6 +1540,8 @@ impl Screen { let (active_swap_layout_name, is_swap_layout_dirty) = tab.swap_layout_info(); let tab_viewport = tab.get_viewport(); let tab_display_area = tab.get_display_area(); + let selectable_tiled_panes_count = tab.get_selectable_tiled_panes_count(); + let selectable_floating_panes_count = tab.get_selectable_floating_panes_count(); let tab_info_for_screen = TabInfo { position: tab.position, name: tab.name.clone(), @@ -1555,6 +1557,8 @@ impl Screen { viewport_columns: tab_viewport.cols, display_area_rows: tab_display_area.rows, display_area_columns: tab_display_area.cols, + selectable_tiled_panes_count, + selectable_floating_panes_count, }; tab_infos_for_screen_state.insert(tab.position, tab_info_for_screen); } @@ -1576,6 +1580,8 @@ impl Screen { let (active_swap_layout_name, is_swap_layout_dirty) = tab.swap_layout_info(); let tab_viewport = tab.get_viewport(); let tab_display_area = tab.get_display_area(); + let selectable_tiled_panes_count = tab.get_selectable_tiled_panes_count(); + let selectable_floating_panes_count = tab.get_selectable_floating_panes_count(); let tab_info_for_plugins = TabInfo { position: tab.position, name: tab.name.clone(), @@ -1591,6 +1597,8 @@ impl Screen { viewport_columns: tab_viewport.cols, display_area_rows: tab_display_area.rows, display_area_columns: tab_display_area.cols, + selectable_tiled_panes_count, + selectable_floating_panes_count, }; plugin_tab_updates.push(tab_info_for_plugins); } diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index e5a7e217..8a79ca00 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -2271,6 +2271,9 @@ impl Tab { pub fn get_selectable_tiled_panes_count(&self) -> usize { self.get_selectable_tiled_panes().count() } + pub fn get_selectable_floating_panes_count(&self) -> usize { + self.get_selectable_floating_panes().count() + } pub fn get_visible_selectable_floating_panes_count(&self) -> usize { if self.are_floating_panes_visible() { self.get_selectable_floating_panes().count() diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_rename_tab.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_rename_tab.snap index d54784c1..15eaadfe 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_rename_tab.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_rename_tab.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 2926 +assertion_line: 2929 expression: "format!(\"{:#?}\", plugin_rename_tab_instruction)" --- Some( @@ -30,6 +30,8 @@ Some( viewport_columns: 80, display_area_rows: 10, display_area_columns: 80, + selectable_tiled_panes_count: 2, + selectable_floating_panes_count: 0, }, ], ), diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_undo_rename_tab.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_undo_rename_tab.snap index bc53d171..dc05c40b 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_undo_rename_tab.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_undo_rename_tab.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 2976 +assertion_line: 2979 expression: "format!(\"{:#?}\", plugin_undo_rename_tab_instruction)" --- Some( @@ -30,6 +30,8 @@ Some( viewport_columns: 80, display_area_rows: 10, display_area_columns: 80, + selectable_tiled_panes_count: 2, + selectable_floating_panes_count: 0, }, ], ), diff --git a/zellij-utils/assets/plugins/about.wasm b/zellij-utils/assets/plugins/about.wasm index e1bb7aae..e82b30f0 100755 Binary files a/zellij-utils/assets/plugins/about.wasm and b/zellij-utils/assets/plugins/about.wasm differ diff --git a/zellij-utils/assets/plugins/compact-bar.wasm b/zellij-utils/assets/plugins/compact-bar.wasm index a0d40d9f..bb60a1a0 100755 Binary files a/zellij-utils/assets/plugins/compact-bar.wasm and b/zellij-utils/assets/plugins/compact-bar.wasm differ diff --git a/zellij-utils/assets/plugins/configuration.wasm b/zellij-utils/assets/plugins/configuration.wasm index 51a029aa..24040bc7 100755 Binary files a/zellij-utils/assets/plugins/configuration.wasm and b/zellij-utils/assets/plugins/configuration.wasm differ diff --git a/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm b/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm index 991a74fc..70b8431c 100755 Binary files a/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm and b/zellij-utils/assets/plugins/fixture-plugin-for-tests.wasm differ diff --git a/zellij-utils/assets/plugins/plugin-manager.wasm b/zellij-utils/assets/plugins/plugin-manager.wasm index 10d05d9b..6b9960cd 100755 Binary files a/zellij-utils/assets/plugins/plugin-manager.wasm and b/zellij-utils/assets/plugins/plugin-manager.wasm differ diff --git a/zellij-utils/assets/plugins/session-manager.wasm b/zellij-utils/assets/plugins/session-manager.wasm index 57dce9b6..97153fc1 100755 Binary files a/zellij-utils/assets/plugins/session-manager.wasm and b/zellij-utils/assets/plugins/session-manager.wasm differ diff --git a/zellij-utils/assets/plugins/status-bar.wasm b/zellij-utils/assets/plugins/status-bar.wasm index cc7668f5..9b192295 100755 Binary files a/zellij-utils/assets/plugins/status-bar.wasm and b/zellij-utils/assets/plugins/status-bar.wasm differ diff --git a/zellij-utils/assets/plugins/strider.wasm b/zellij-utils/assets/plugins/strider.wasm index 15123089..e6b45094 100755 Binary files a/zellij-utils/assets/plugins/strider.wasm and b/zellij-utils/assets/plugins/strider.wasm differ diff --git a/zellij-utils/assets/plugins/tab-bar.wasm b/zellij-utils/assets/plugins/tab-bar.wasm index db09ceab..82729fda 100755 Binary files a/zellij-utils/assets/plugins/tab-bar.wasm and b/zellij-utils/assets/plugins/tab-bar.wasm differ diff --git a/zellij-utils/assets/prost/api.event.rs b/zellij-utils/assets/prost/api.event.rs index 85db2531..493e0dc4 100644 --- a/zellij-utils/assets/prost/api.event.rs +++ b/zellij-utils/assets/prost/api.event.rs @@ -422,6 +422,10 @@ pub struct TabInfo { pub display_area_rows: u32, #[prost(uint32, tag = "14")] pub display_area_columns: u32, + #[prost(uint32, tag = "15")] + pub selectable_tiled_panes_count: u32, + #[prost(uint32, tag = "16")] + pub selectable_floating_panes_count: u32, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/zellij-utils/src/data.rs b/zellij-utils/src/data.rs index 5bc1732d..8399b199 100644 --- a/zellij-utils/src/data.rs +++ b/zellij-utils/src/data.rs @@ -1663,6 +1663,10 @@ pub struct TabInfo { /// Column count in the display area (including all panes, will typically be larger than the /// viewport) pub display_area_columns: usize, + /// The number of selectable (eg. not the UI bars) tiled panes currently in this tab + pub selectable_tiled_panes_count: usize, + /// The number of selectable (eg. not the UI bars) floating panes currently in this tab + pub selectable_floating_panes_count: usize, } /// The `PaneManifest` contains a dictionary of panes, indexed by the tab position (0 indexed). diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs index eeabb520..27230c2f 100644 --- a/zellij-utils/src/kdl/mod.rs +++ b/zellij-utils/src/kdl/mod.rs @@ -4594,6 +4594,10 @@ impl TabInfo { let display_area_rows = optional_int_node!("display_area_rows", usize).unwrap_or(0); let display_area_columns = optional_int_node!("display_area_columns", usize).unwrap_or(0); let is_swap_layout_dirty = bool_node!("is_swap_layout_dirty"); + let selectable_tiled_panes_count = + optional_int_node!("selectable_tiled_panes_count", usize).unwrap_or(0); + let selectable_floating_panes_count = + optional_int_node!("selectable_floating_panes_count", usize).unwrap_or(0); Ok(TabInfo { position, name, @@ -4609,6 +4613,8 @@ impl TabInfo { viewport_columns, display_area_rows, display_area_columns, + selectable_tiled_panes_count, + selectable_floating_panes_count, }) } pub fn encode_to_kdl(&self) -> KdlDocument { @@ -4676,6 +4682,16 @@ impl TabInfo { is_swap_layout_dirty.push(self.is_swap_layout_dirty); kdl_doucment.nodes_mut().push(is_swap_layout_dirty); + let mut selectable_tiled_panes_count = KdlNode::new("selectable_tiled_panes_count"); + selectable_tiled_panes_count.push(self.selectable_tiled_panes_count as i64); + kdl_doucment.nodes_mut().push(selectable_tiled_panes_count); + + let mut selectable_floating_panes_count = KdlNode::new("selectable_floating_panes_count"); + selectable_floating_panes_count.push(self.selectable_floating_panes_count as i64); + kdl_doucment + .nodes_mut() + .push(selectable_floating_panes_count); + kdl_doucment } } @@ -5020,6 +5036,8 @@ fn serialize_and_deserialize_session_info_with_data() { viewport_columns: 10, display_area_rows: 10, display_area_columns: 10, + selectable_tiled_panes_count: 10, + selectable_floating_panes_count: 10, }, TabInfo { position: 1, @@ -5036,6 +5054,8 @@ fn serialize_and_deserialize_session_info_with_data() { viewport_columns: 10, display_area_rows: 10, display_area_columns: 10, + selectable_tiled_panes_count: 10, + selectable_floating_panes_count: 10, }, ], panes: PaneManifest { panes }, diff --git a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__serialize_and_deserialize_session_info_with_data.snap b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__serialize_and_deserialize_session_info_with_data.snap index f2637243..6e0ba4c5 100644 --- a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__serialize_and_deserialize_session_info_with_data.snap +++ b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__serialize_and_deserialize_session_info_with_data.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/kdl/mod.rs -assertion_line: 4728 +assertion_line: 5070 expression: serialized --- name "my session name" @@ -20,6 +20,8 @@ tabs { display_area_columns 10 display_area_rows 10 is_swap_layout_dirty true + selectable_tiled_panes_count 10 + selectable_floating_panes_count 10 } tab { position 1 @@ -35,6 +37,8 @@ tabs { display_area_columns 10 display_area_rows 10 is_swap_layout_dirty false + selectable_tiled_panes_count 10 + selectable_floating_panes_count 10 } } panes { diff --git a/zellij-utils/src/plugin_api/event.proto b/zellij-utils/src/plugin_api/event.proto index b07562e2..7269cc47 100644 --- a/zellij-utils/src/plugin_api/event.proto +++ b/zellij-utils/src/plugin_api/event.proto @@ -315,6 +315,8 @@ message TabInfo { uint32 viewport_columns = 12; uint32 display_area_rows = 13; uint32 display_area_columns = 14; + uint32 selectable_tiled_panes_count = 15; + uint32 selectable_floating_panes_count = 16; } message ModeUpdatePayload { diff --git a/zellij-utils/src/plugin_api/event.rs b/zellij-utils/src/plugin_api/event.rs index 495060a6..743e1569 100644 --- a/zellij-utils/src/plugin_api/event.rs +++ b/zellij-utils/src/plugin_api/event.rs @@ -1109,6 +1109,9 @@ impl TryFrom for TabInfo { viewport_columns: protobuf_tab_info.viewport_columns as usize, display_area_rows: protobuf_tab_info.display_area_rows as usize, display_area_columns: protobuf_tab_info.display_area_columns as usize, + selectable_tiled_panes_count: protobuf_tab_info.selectable_tiled_panes_count as usize, + selectable_floating_panes_count: protobuf_tab_info.selectable_floating_panes_count + as usize, }) } } @@ -1135,6 +1138,8 @@ impl TryFrom for ProtobufTabInfo { viewport_columns: tab_info.viewport_columns as u32, display_area_rows: tab_info.display_area_rows as u32, display_area_columns: tab_info.display_area_columns as u32, + selectable_tiled_panes_count: tab_info.selectable_tiled_panes_count as u32, + selectable_floating_panes_count: tab_info.selectable_floating_panes_count as u32, }) } } @@ -1540,6 +1545,8 @@ fn serialize_tab_update_event_with_non_default_values() { viewport_columns: 10, display_area_rows: 10, display_area_columns: 10, + selectable_tiled_panes_count: 10, + selectable_floating_panes_count: 10, }, TabInfo { position: 1, @@ -1556,6 +1563,8 @@ fn serialize_tab_update_event_with_non_default_values() { viewport_columns: 10, display_area_rows: 10, display_area_columns: 10, + selectable_tiled_panes_count: 10, + selectable_floating_panes_count: 10, }, TabInfo::default(), ]); @@ -1827,6 +1836,8 @@ fn serialize_session_update_event_with_non_default_values() { viewport_columns: 10, display_area_rows: 10, display_area_columns: 10, + selectable_tiled_panes_count: 10, + selectable_floating_panes_count: 10, }, TabInfo { position: 1, @@ -1843,6 +1854,8 @@ fn serialize_session_update_event_with_non_default_values() { viewport_columns: 10, display_area_rows: 10, display_area_columns: 10, + selectable_tiled_panes_count: 10, + selectable_floating_panes_count: 10, }, TabInfo::default(), ];