From dd291e2a1f9b4ee3eb1a947e1501a54b10663ea7 Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Mon, 16 Dec 2024 16:03:20 +0100 Subject: [PATCH] feat(ux): pin floating panes (#3876) * working * ui indication * add keybinding * add to plugin panes * fix with multiple cursors * toggle with the mouse * fix e2e tests and add new one * some cleanups * add to layouts * make mouse click more lenient * allow setting a new floating pane as pinned * make toggle work throughthe command line * add to plugin api * get tests to pass * style(fmt): rustfmt --- default-plugins/configuration/src/presets.rs | 6 + example/default.kdl | 1 + src/main.rs | 6 + src/tests/e2e/cases.rs | 97 ++++++++++++++ src/tests/e2e/remote_runner.rs | 8 ++ ...tests__e2e__cases__pin_floating_panes.snap | 29 +++++ ...2e__cases__quit_and_resurrect_session.snap | 8 +- ...t_session_with_viewport_serialization.snap | 8 +- ...ts__e2e__cases__toggle_floating_panes.snap | 4 +- src/tests/fixtures/e2e/fill_for_pinned_pane | 13 ++ zellij-server/src/output/mod.rs | 24 ++++ .../floating_panes/floating_pane_grid.rs | 5 + zellij-server/src/panes/floating_panes/mod.rs | 92 +++++++++++++- zellij-server/src/panes/plugin_pane.rs | 24 +++- zellij-server/src/panes/terminal_pane.rs | 24 +++- zellij-server/src/panes/tiled_panes/mod.rs | 15 ++- zellij-server/src/plugins/zellij_exports.rs | 13 ++ zellij-server/src/route.rs | 5 + zellij-server/src/screen.rs | 36 ++++++ zellij-server/src/tab/mod.rs | 89 +++++++++++-- ...ng_layout_is_included_in_swap_layouts.snap | 6 +- ...__can_swap_floating_layout_at_runtime.snap | 4 +- ...ests__close_suppressing_floating_pane.snap | 4 +- ...on_tests__decrease_floating_pane_size.snap | 4 +- ...tegration_tests__drag_pane_with_mouse.snap | 8 +- ...ration_tests__five_new_floating_panes.snap | 12 +- ...ntegration_tests__float_embedded_pane.snap | 4 +- ...oat_embedded_pane_without_pane_frames.snap | 4 +- ..._plugins_and_commands_swaped_properly.snap | 6 +- ...ests__floating_pane_above_sixel_image.snap | 4 +- ...floating_panes_persist_across_toggles.snap | 4 +- ...on_tests__increase_floating_pane_size.snap | 4 +- ...tests__mark_text_inside_floating_pane.snap | 12 +- ..._tests__move_floating_pane_focus_down.snap | 12 +- ..._tests__move_floating_pane_focus_left.snap | 10 +- ...tests__move_floating_pane_focus_right.snap | 12 +- ...on_tests__move_floating_pane_focus_up.snap | 10 +- ...__move_floating_pane_focus_with_mouse.snap | 12 +- ...__move_floating_pane_with_sixel_image.snap | 4 +- ..._integration_tests__new_floating_pane.snap | 4 +- ...s__new_floating_pane_in_auto_layout-2.snap | 4 +- ...s__new_floating_pane_in_auto_layout-3.snap | 6 +- ...sts__new_floating_pane_in_auto_layout.snap | 4 +- ...tegration_tests__rename_floating_pane.snap | 3 +- ...tion_tests__resize_floating_pane_down.snap | 4 +- ...tion_tests__resize_floating_pane_left.snap | 4 +- ...ion_tests__resize_floating_pane_right.snap | 4 +- ...ration_tests__resize_floating_pane_up.snap | 4 +- ...tests__resize_tab_with_floating_panes.snap | 8 +- ..._tab_while_floting_pane_is_suppressed.snap | 4 +- ...__search_floating_tab_highlight_fring.snap | 4 +- ...arch_floating_tab_nothing_highlighted.snap | 3 +- ...ing_panes_horizontally_and_vertically.snap | 6 +- ...ntally_and_vertically_and_expand_back.snap | 12 +- ...gration_tests__suppress_floating_pane.snap | 4 +- ...and_panes_absent_from_existing_layout.snap | 10 +- ...gin_panes_absent_from_existing_layout.snap | 8 +- ...mand_panes_present_in_existing_layout.snap | 12 +- ...ugin_panes_present_in_existing_layout.snap | 8 +- ...b_with_layout_that_has_floating_panes.snap | 6 +- ...ation_tests__toggle_floating_panes_on.snap | 4 +- ...t_the_focus_goes_to_last_focused_pane.snap | 6 +- ...oating_panes_the_layout_is_maintained.snap | 8 +- ...e_layout_and_pane_focus_are_unchanged.snap | 8 +- ...ed_state_pane_focuses_on_focused_node.snap | 8 +- ...cus_node_pane_focuses_on_deepest_node.snap | 8 +- zellij-server/src/ui/pane_boundaries_frame.rs | 120 ++++++++++++++---- zellij-server/src/ui/pane_contents_and_ui.rs | 33 +++-- zellij-server/src/unit/screen_tests.rs | 9 ++ ...an_break_floating_pane_to_a_new_tab-2.snap | 4 +- ...an_break_floating_pane_to_a_new_tab-4.snap | 4 +- ..._can_break_floating_pane_to_a_new_tab.snap | 4 +- ...on_with_floating_pane_and_coordinates.snap | 4 +- ...sts__send_cli_toggle_floating_panes-2.snap | 4 +- ...sts__send_cli_toggle_floating_panes-4.snap | 4 +- ...send_cli_toggle_pane_embed_or_float-2.snap | 4 +- zellij-tile/src/shim.rs | 7 + zellij-utils/assets/config/default.kdl | 1 + zellij-utils/assets/prost/api.action.rs | 3 + .../assets/prost/api.plugin_command.rs | 17 ++- zellij-utils/src/cli.rs | 16 +++ zellij-utils/src/data.rs | 6 +- zellij-utils/src/errors.rs | 2 + zellij-utils/src/input/actions.rs | 12 +- zellij-utils/src/input/layout.rs | 4 + ...__layout_with_tabs_and_floating_panes.snap | 5 +- zellij-utils/src/kdl/kdl_layout_parser.rs | 23 +++- zellij-utils/src/kdl/mod.rs | 6 +- ..._config_from_default_assets_to_string.snap | 3 +- ...efault_assets_to_string_with_comments.snap | 3 +- zellij-utils/src/pane_size.rs | 17 ++- zellij-utils/src/plugin_api/action.proto | 1 + zellij-utils/src/plugin_api/action.rs | 8 ++ .../src/plugin_api/plugin_command.proto | 8 ++ zellij-utils/src/plugin_api/plugin_command.rs | 36 +++++- zellij-utils/src/session_serialization.rs | 34 +++++ ...efault_config_with_no_cli_arguments-2.snap | 22 +++- ..._default_config_with_no_cli_arguments.snap | 13 +- ...out_env_vars_override_config_env_vars.snap | 13 +- ..._layout_themes_override_config_themes.snap | 13 +- ..._ui_config_overrides_config_ui_config.snap | 13 +- 101 files changed, 1039 insertions(+), 244 deletions(-) create mode 100644 src/tests/e2e/snapshots/zellij__tests__e2e__cases__pin_floating_panes.snap create mode 100644 src/tests/fixtures/e2e/fill_for_pinned_pane diff --git a/default-plugins/configuration/src/presets.rs b/default-plugins/configuration/src/presets.rs index b703ef99db..eb9a55bbb5 100644 --- a/default-plugins/configuration/src/presets.rs +++ b/default-plugins/configuration/src/presets.rs @@ -37,6 +37,7 @@ keybinds clear-defaults=true {{ bind "w" {{ ToggleFloatingPanes; SwitchToMode "Locked"; }} bind "e" {{ TogglePaneEmbedOrFloating; SwitchToMode "Locked"; }} bind "c" {{ SwitchToMode "RenamePane"; PaneNameInput 0;}} + bind "i" {{ TogglePanePinned; SwitchToMode "Locked"; }} }} move {{ bind "m" {{ SwitchToMode "Normal"; }} @@ -233,6 +234,7 @@ keybinds clear-defaults=true {{ bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }} bind "e" {{ TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }} bind "c" {{ SwitchToMode "RenamePane"; PaneNameInput 0;}} + bind "i" {{ TogglePanePinned; SwitchToMode "Normal"; }} }} move {{ bind "{primary_modifier} h" {{ SwitchToMode "Normal"; }} @@ -440,6 +442,7 @@ keybinds clear-defaults=true {{ bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }} bind "e" {{ TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }} bind "c" {{ SwitchToMode "RenamePane"; PaneNameInput 0;}} + bind "i" {{ TogglePanePinned; SwitchToMode "Normal"; }} }} move {{ bind "n" "Tab" {{ MovePane; }} @@ -618,6 +621,7 @@ keybinds clear-defaults=true {{ bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }} bind "e" {{ TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }} bind "c" {{ SwitchToMode "RenamePane"; PaneNameInput 0;}} + bind "i" {{ TogglePanePinned; SwitchToMode "Normal"; }} }} move {{ bind "{primary_modifier} h" {{ SwitchToMode "Normal"; }} @@ -805,6 +809,7 @@ keybinds clear-defaults=true {{ bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }} bind "e" {{ TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }} bind "c" {{ SwitchToMode "RenamePane"; PaneNameInput 0;}} + bind "i" {{ TogglePanePinned; SwitchToMode "Normal"; }} }} move {{ bind "n" "Tab" {{ MovePane; }} @@ -967,6 +972,7 @@ keybinds clear-defaults=true {{ bind "w" {{ ToggleFloatingPanes; SwitchToMode "Normal"; }} bind "e" {{ TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }} bind "c" {{ SwitchToMode "RenamePane"; PaneNameInput 0;}} + bind "i" {{ TogglePanePinned; SwitchToMode "Normal"; }} }} move {{ bind "{primary_modifier} m" {{ SwitchToMode "Normal"; }} diff --git a/example/default.kdl b/example/default.kdl index e7dfcf5da9..15f1fd54a5 100644 --- a/example/default.kdl +++ b/example/default.kdl @@ -36,6 +36,7 @@ keybinds { bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; } bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; } bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;} + bind "i" { TogglePanePinned; SwitchToMode "Normal"; } } move { bind "Ctrl h" { SwitchToMode "Normal"; } diff --git a/src/main.rs b/src/main.rs index 1be0555336..b3a5ce965a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,6 +37,7 @@ fn main() { y, width, height, + pinned, })) = opts.command { let cwd = cwd.or_else(|| std::env::current_dir().ok()); @@ -57,6 +58,7 @@ fn main() { y, width, height, + pinned, }; commands::send_action_to_session(command_cli_action, opts.session, config); std::process::exit(0); @@ -71,6 +73,7 @@ fn main() { y, width, height, + pinned, })) = opts.command { let cwd = None; @@ -90,6 +93,7 @@ fn main() { y, width, height, + pinned, }; commands::send_action_to_session(command_cli_action, opts.session, config); std::process::exit(0); @@ -105,6 +109,7 @@ fn main() { y, width, height, + pinned, })) = opts.command { let mut file = file; @@ -125,6 +130,7 @@ fn main() { y, width, height, + pinned, }; commands::send_action_to_session(command_cli_action, opts.session, config); std::process::exit(0); diff --git a/src/tests/e2e/cases.rs b/src/tests/e2e/cases.rs index bb652ef970..e8e30dd766 100644 --- a/src/tests/e2e/cases.rs +++ b/src/tests/e2e/cases.rs @@ -2423,3 +2423,100 @@ pub fn load_plugins_in_background_on_startup() { ); assert_snapshot!(last_snapshot); } + +#[test] +#[ignore] +pub fn pin_floating_panes() { + let fake_win_size = Size { + cols: 120, + rows: 24, + }; + let mut test_attempts = 10; + let last_snapshot = loop { + RemoteRunner::kill_running_sessions(fake_win_size); + let mut runner = RemoteRunner::new(fake_win_size) + .add_step(Step { + name: "Toggle floating panes", + instruction: |mut remote_terminal: RemoteTerminal| -> bool { + let mut step_is_complete = false; + if remote_terminal.status_bar_appears() + && remote_terminal.cursor_position_is(3, 2) + { + remote_terminal.send_key(&PANE_MODE); + std::thread::sleep(std::time::Duration::from_millis(100)); + remote_terminal.send_key(&TOGGLE_FLOATING_PANES); + step_is_complete = true; + } + step_is_complete + }, + }) + .add_step(Step { + name: "Pin floating pane", + instruction: |mut remote_terminal: RemoteTerminal| -> bool { + let mut step_is_complete = false; + if remote_terminal.snapshot_contains("PIN [ ]") { + remote_terminal.send_key(&sgr_mouse_report(Position::new(8, 87), 0)); + step_is_complete = true; + } + step_is_complete + }, + }) + .add_step(Step { + name: "Focus underlying pane", + instruction: |mut remote_terminal: RemoteTerminal| -> bool { + let mut step_is_complete = false; + if remote_terminal.snapshot_contains("PIN [+]") { + remote_terminal.send_key(&PANE_MODE); + std::thread::sleep(std::time::Duration::from_millis(100)); + remote_terminal.send_key(&TOGGLE_FLOATING_PANES); + step_is_complete = true; + } + step_is_complete + }, + }) + .add_step(Step { + name: "Fill tiled pane with text", + instruction: |mut remote_terminal: RemoteTerminal| -> bool { + let mut step_is_complete = false; + if remote_terminal.cursor_position_is(3, 2) { + remote_terminal.load_fixture("e2e/fill_for_pinned_pane"); + step_is_complete = true; + } + step_is_complete + }, + }) + .add_step(Step { + name: "Move cursor behind pinned pane", + instruction: |mut remote_terminal: RemoteTerminal| -> bool { + let mut step_is_complete = false; + if remote_terminal.snapshot_contains("line") { + remote_terminal + .send_key(&format!(" hide_me").as_bytes().to_vec()); + step_is_complete = true; + } + step_is_complete + }, + }); + + runner.run_all_steps(); + let last_snapshot = runner.take_snapshot_after(Step { + name: "Wait for cursor to be behind pinned pane", + instruction: |remote_terminal: RemoteTerminal| -> bool { + let mut step_is_complete = false; + if remote_terminal.snapshot_contains("hide") { + // terminal has been filled with fixture text + step_is_complete = true; + } + step_is_complete + }, + }); + if runner.test_timed_out && test_attempts > 0 { + test_attempts -= 1; + continue; + } else { + break last_snapshot; + } + }; + let last_snapshot = account_for_races_in_snapshot(last_snapshot); + assert_snapshot!(last_snapshot); +} diff --git a/src/tests/e2e/remote_runner.rs b/src/tests/e2e/remote_runner.rs index 6b702f018b..c2b94cc6ae 100644 --- a/src/tests/e2e/remote_runner.rs +++ b/src/tests/e2e/remote_runner.rs @@ -456,6 +456,7 @@ impl RemoteRunner { rows, cols, is_stacked: false, + is_pinned: false, }; setup_remote_environment(&mut channel, win_size); start_zellij(&mut channel); @@ -492,6 +493,7 @@ impl RemoteRunner { rows, cols, is_stacked: false, + is_pinned: false, }; setup_remote_environment(&mut channel, win_size); start_zellij_mirrored_session(&mut channel); @@ -528,6 +530,7 @@ impl RemoteRunner { rows, cols, is_stacked: false, + is_pinned: false, }; setup_remote_environment(&mut channel, win_size); start_zellij_mirrored_session_with_layout(&mut channel, layout_file_name); @@ -567,6 +570,7 @@ impl RemoteRunner { rows, cols, is_stacked: false, + is_pinned: false, }; setup_remote_environment(&mut channel, win_size); start_zellij_mirrored_session_with_layout_and_viewport_serialization( @@ -613,6 +617,7 @@ impl RemoteRunner { rows, cols, is_stacked: false, + is_pinned: false, }; setup_remote_environment(&mut channel, win_size); start_zellij_in_session(&mut channel, session_name, mirrored); @@ -649,6 +654,7 @@ impl RemoteRunner { rows, cols, is_stacked: false, + is_pinned: false, }; setup_remote_environment(&mut channel, win_size); attach_to_existing_session(&mut channel, session_name); @@ -685,6 +691,7 @@ impl RemoteRunner { rows, cols, is_stacked: false, + is_pinned: false, }; setup_remote_environment(&mut channel, win_size); start_zellij_without_frames(&mut channel); @@ -722,6 +729,7 @@ impl RemoteRunner { rows, cols, is_stacked: false, + is_pinned: false, }; setup_remote_environment(&mut channel, win_size); start_zellij_with_config(&mut channel, &remote_path.to_string_lossy()); 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 new file mode 100644 index 0000000000..91233bb121 --- /dev/null +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__pin_floating_panes.snap @@ -0,0 +1,29 @@ +--- +source: src/tests/e2e/cases.rs +assertion_line: 2524 +expression: last_snapshot +--- + Zellij (e2e-test)  Tab #1  +┌ Pane #1 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│$ cat /usr/src/zellij/fixtures/e2e/fill_for_pinned_pane │ +│line1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa │ +│line2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa │ +│line3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa │ +│line4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa │ +│line5aaaaaaaaaaaaaaaaaaaaaaaa┌ Pane #2 ──────────────────────────────────────── PIN [+] ┐aaaaaaaaaaaaaaaaaaaaaaaaaaaa │ +│line6aaaaaaaaaaaaaaaaaaaaaaaa│$ │aaaaaaaaaaaaaaaaaaaaaaaaaaaa │ +│line7aaaaaaaaaaaaaaaaaaaaaaaa│ │aaaaaaaaaaaaaaaaaaaaaaaaaaaa │ +│line8aaaaaaaaaaaaaaaaaaaaaaaa│ │aaaaaaaaaaaaaaaaaaaaaaaaaaaa │ +│line9aaaaaaaaaaaaaaaaaaaaaaaa│ │aaaaaaaaaaaaaaaaaaaaaaaaaaaa │ +│line10aaaaaaaaaaaaaaaaaaaaaaa│ │aaaaaaaaaaaaaaaaaaaaaaaaaaaaa│ +│line11aaaaaaaaaaaaaaaaaaaaaaa│ │aaaaaaaaaaaaaaaaaaaaaaaaaaaaa│ +│line12aaaaaaaaaaaaaaaaaaaaaaa│ │aaaaaaaaaaaaaaaaaaaaaaaaaaaaa│ +│line13aaaaaaaaaaaaaaaaaaaaaaa│ │aaaaaaaaaaaaaaaaaaaaaaaaaaaaa│ +│$ hide_m│ │ │ +│ └──────────────────────────────────────────────────────────┘ │ +│ │ +│ │ +│ │ +│ │ +└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + Ctrl + LOCK 

PANE  TAB  RESIZE  MOVE  SEARCH  SESSION  QUIT  diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session.snap index 857f417d52..2cc662bb86 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1191 +assertion_line: 1212 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  Tab #2  Tab #3  Tab #4  @@ -9,11 +9,11 @@ expression: last_snapshot │ ││ │ │ ││ │ │ ││ │ -│ ┌ Pane #4 ───────────────────────────────────────────────┐ │ +│ ┌ Pane #4 ────────────────────────────────────── PIN [ ] ┐ │ │ │$ │ │ -│ │ ┌ top ───────────────────────────────────────────────────┐ │ +│ │ ┌ top ────────────────────────────────────────── PIN [ ] ┐ │ │ │ │ │ │ -│ │ │ │─┐ │ +│ │ │ │ ┐ │ │ │ │ │ │────────────────────────────┘ │ │ │ Waiting to run: top │ │────────────────────────────┐ │ │ │ │ │ │ diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session_with_viewport_serialization.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session_with_viewport_serialization.snap index dff8858bd2..0897618dce 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session_with_viewport_serialization.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session_with_viewport_serialization.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1252 +assertion_line: 1273 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  Tab #2  Tab #3  Tab #4  @@ -9,11 +9,11 @@ expression: last_snapshot │$ ││$ │ │$ ││$ │ │ ││ │ -│ ┌ Pane #4 ───────────────────────────────────────────────┐ │ +│ ┌ Pane #4 ────────────────────────────────────── PIN [ ] ┐ │ │ │ │ │ -│ │$┌ top ───────────────────────────────────────────────────┐ │ +│ │$┌ top ────────────────────────────────────────── PIN [ ] ┐ │ │ │$│ │ │ -│ │ │ │─┐ │ +│ │ │ │ ┐ │ │ │ │ │ │────────────────────────────┘ │ │ │ Waiting to run: top │ │────────────────────────────┐ │ │ │ │ │ │ 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 d5231a04b6..81bf57710c 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 @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 2027 +assertion_line: 2049 expression: last_snapshot --- Zellij (e2e-test)  Tab #1  Alt <[]>  STAGGERED  @@ -10,7 +10,7 @@ expression: last_snapshot │ │ │ │ │ │ -│ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +│ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ │ │$ █ │ │ │ │ │ │ │ │ │ │ diff --git a/src/tests/fixtures/e2e/fill_for_pinned_pane b/src/tests/fixtures/e2e/fill_for_pinned_pane new file mode 100644 index 0000000000..41b373c232 --- /dev/null +++ b/src/tests/fixtures/e2e/fill_for_pinned_pane @@ -0,0 +1,13 @@ +line1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line3aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line4aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line5aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line6aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line9aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line10aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line11aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line12aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +line13aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/zellij-server/src/output/mod.rs b/zellij-server/src/output/mod.rs index ccb5f66530..32192a203a 100644 --- a/zellij-server/src/output/mod.rs +++ b/zellij-server/src/output/mod.rs @@ -449,6 +449,12 @@ impl Output { self.client_character_chunks.values().any(|c| !c.is_empty()) || self.sixel_chunks.values().any(|c| !c.is_empty()) } + pub fn cursor_is_visible(&self, cursor_x: usize, cursor_y: usize) -> bool { + self.floating_panes_stack + .as_ref() + .map(|s| s.cursor_is_visible(cursor_x, cursor_y)) + .unwrap_or(true) + } } // this struct represents the geometry of a group of floating panes @@ -740,6 +746,24 @@ impl FloatingPanesStack { } uncovered_chunks } + pub fn cursor_is_visible(&self, cursor_x: usize, cursor_y: usize) -> bool { + let z_index = 0; // TODO: receive z_index + let panes_to_check = self.layers.iter().skip(z_index); + for pane_geom in panes_to_check { + let pane_top_edge = pane_geom.y; + let pane_left_edge = pane_geom.x; + let pane_bottom_edge = pane_geom.y + pane_geom.rows.as_usize().saturating_sub(1); + let pane_right_edge = pane_geom.x + pane_geom.cols.as_usize().saturating_sub(1); + if pane_top_edge <= cursor_y + && pane_bottom_edge >= cursor_y + && pane_left_edge <= cursor_x + && pane_right_edge >= cursor_x + { + return false; + } + } + true + } } #[derive(Debug, Clone, Default)] diff --git a/zellij-server/src/panes/floating_panes/floating_pane_grid.rs b/zellij-server/src/panes/floating_panes/floating_pane_grid.rs index 75da894e27..d8d9e64eca 100644 --- a/zellij-server/src/panes/floating_panes/floating_pane_grid.rs +++ b/zellij-server/src/panes/floating_panes/floating_pane_grid.rs @@ -861,6 +861,7 @@ pub fn half_size_middle_geom(space: &Viewport, offset: usize) -> PaneGeom { cols: Dimension::fixed(space.cols / 2), rows: Dimension::fixed(space.rows / 2), is_stacked: false, + is_pinned: false, }; geom.cols.set_inner(space.cols / 2); geom.rows.set_inner(space.rows / 2); @@ -874,6 +875,7 @@ fn half_size_top_left_geom(space: &Viewport, offset: usize) -> PaneGeom { cols: Dimension::fixed(space.cols / 3), rows: Dimension::fixed(space.rows / 3), is_stacked: false, + is_pinned: false, }; geom.cols.set_inner(space.cols / 3); geom.rows.set_inner(space.rows / 3); @@ -887,6 +889,7 @@ fn half_size_top_right_geom(space: &Viewport, offset: usize) -> PaneGeom { cols: Dimension::fixed(space.cols / 3), rows: Dimension::fixed(space.rows / 3), is_stacked: false, + is_pinned: false, }; geom.cols.set_inner(space.cols / 3); geom.rows.set_inner(space.rows / 3); @@ -900,6 +903,7 @@ fn half_size_bottom_left_geom(space: &Viewport, offset: usize) -> PaneGeom { cols: Dimension::fixed(space.cols / 3), rows: Dimension::fixed(space.rows / 3), is_stacked: false, + is_pinned: false, }; geom.cols.set_inner(space.cols / 3); geom.rows.set_inner(space.rows / 3); @@ -913,6 +917,7 @@ fn half_size_bottom_right_geom(space: &Viewport, offset: usize) -> PaneGeom { cols: Dimension::fixed(space.cols / 3), rows: Dimension::fixed(space.rows / 3), is_stacked: false, + is_pinned: false, }; geom.cols.set_inner(space.cols / 3); geom.rows.set_inner(space.rows / 3); diff --git a/zellij-server/src/panes/floating_panes/mod.rs b/zellij-server/src/panes/floating_panes/mod.rs index e896364bd7..d0ce41e8b9 100644 --- a/zellij-server/src/panes/floating_panes/mod.rs +++ b/zellij-server/src/panes/floating_panes/mod.rs @@ -94,10 +94,27 @@ impl FloatingPanes { .map(|pane_id| self.panes.get(pane_id).unwrap().position_and_size()) .collect(); Some(FloatingPanesStack { layers }) + } else if self.has_pinned_panes() { + let layers = self + .z_indices + .iter() + .filter_map(|pane_id| { + self.panes + .get(pane_id) + .map(|p| p.position_and_size()) + .and_then(|p| if p.is_pinned { Some(p) } else { None }) + }) + .collect(); + Some(FloatingPanesStack { layers }) } else { None } } + pub fn has_pinned_panes(&self) -> bool { + self.panes + .iter() + .any(|(_, p)| p.position_and_size().is_pinned) + } pub fn pane_ids(&self) -> impl Iterator { self.panes.keys() } @@ -262,6 +279,9 @@ impl FloatingPanes { if let Some(height) = &floating_pane_layout.height { position.rows = Dimension::fixed(height.to_position(viewport.rows)); } + if let Some(is_pinned) = &floating_pane_layout.pinned { + position.is_pinned = *is_pinned; + } if position.cols.as_usize() > viewport.cols { position.cols = Dimension::fixed(viewport.cols); } @@ -317,7 +337,21 @@ impl FloatingPanes { let err_context = || "failed to render output"; let connected_clients: Vec = { self.connected_clients.borrow().iter().copied().collect() }; - let mut floating_panes: Vec<_> = self.panes.iter_mut().collect(); + let active_panes = if self.panes_are_visible() { + self.active_panes.clone_active_panes() + } else { + Default::default() + }; + let mut floating_panes: Vec<_> = if self.panes_are_visible() { + self.panes.iter_mut().collect() + } else if self.has_pinned_panes() { + self.panes + .iter_mut() + .filter(|(_, p)| p.position_and_size().is_pinned) + .collect() + } else { + vec![] + }; floating_panes.sort_by(|(a_id, _a_pane), (b_id, _b_pane)| { self.z_indices .iter() @@ -335,7 +369,7 @@ impl FloatingPanes { }); for (z_index, (kind, pane)) in floating_panes.iter_mut().enumerate() { - let mut active_panes = self.active_panes.clone_active_panes(); + let mut active_panes = active_panes.clone(); let multiple_users_exist_in_session = { self.connected_clients_in_app.borrow().len() > 1 }; active_panes.retain(|c_id, _| self.connected_clients.borrow().contains(c_id)); @@ -357,8 +391,14 @@ impl FloatingPanes { .get(client_id) .unwrap_or(&self.default_mode_info) .mode; + let is_floating = true; pane_contents_and_ui - .render_pane_frame(*client_id, client_mode, self.session_is_mirrored) + .render_pane_frame( + *client_id, + client_mode, + self.session_is_mirrored, + is_floating, + ) .with_context(err_context)?; if let PaneId::Plugin(..) = kind { pane_contents_and_ui @@ -767,6 +807,52 @@ impl FloatingPanes { .find(|(_, p)| p.contains(point)) .map(|(&id, _)| id)) } + pub fn get_pinned_pane_id_at( + &self, + point: &Position, + search_selectable: bool, + ) -> Result> { + let _err_context = || format!("failed to determine floating pane at point {point:?}"); + + let mut panes: Vec<_> = if search_selectable { + self.panes + .iter() + .filter(|(_, p)| p.selectable()) + .filter(|(_, p)| p.current_geom().is_pinned) + .collect() + } else { + self.panes + .iter() + .filter(|(_, p)| p.current_geom().is_pinned) + .collect() + }; + panes.sort_by(|(a_id, _a_pane), (b_id, _b_pane)| { + // TODO: continue + Ord::cmp( + &self.z_indices.iter().position(|id| id == *b_id).unwrap(), + &self.z_indices.iter().position(|id| id == *a_id).unwrap(), + ) + }); + Ok(panes + .iter() + .find(|(_, p)| p.contains(point)) + .map(|(&id, _)| id)) + } + pub fn has_pinned_pane_at(&self, point: &Position) -> bool { + let mut panes: Vec<_> = self + .panes + .iter() + .filter(|(_, p)| p.current_geom().is_pinned) + .collect(); + + panes.sort_by(|(a_id, _a_pane), (b_id, _b_pane)| { + Ord::cmp( + &self.z_indices.iter().position(|id| id == *b_id).unwrap(), + &self.z_indices.iter().position(|id| id == *a_id).unwrap(), + ) + }); + panes.iter().find(|(_, p)| p.contains(point)).is_some() + } pub fn get_pane_at_mut( &mut self, position: &Position, diff --git a/zellij-server/src/panes/plugin_pane.rs b/zellij-server/src/panes/plugin_pane.rs index 7e16ee2d24..7bc2a9724c 100644 --- a/zellij-server/src/panes/plugin_pane.rs +++ b/zellij-server/src/panes/plugin_pane.rs @@ -202,7 +202,9 @@ impl Pane for PluginPane { self.set_should_render(true); } fn set_geom(&mut self, position_and_size: PaneGeom) { + let is_pinned = self.geom.is_pinned; self.geom = position_and_size; + self.geom.is_pinned = is_pinned; self.resize_grids(); self.set_should_render(true); } @@ -394,12 +396,14 @@ impl Pane for PluginPane { .cols .set_inner(frame_geom.cols.as_usize().saturating_sub(1)); } + let is_pinned = frame_geom.is_pinned; let mut frame = PaneFrame::new( frame_geom.into(), grid.scrollback_position_and_length(), pane_title, frame_params, - ); + ) + .is_pinned(is_pinned); if let Some((frame_color_override, _text)) = self.pane_frame_color_override.as_ref() { frame.override_color(*frame_color_override); } @@ -700,6 +704,24 @@ impl Pane for PluginPane { fn query_should_be_suppressed(&self) -> bool { self.should_be_suppressed } + fn toggle_pinned(&mut self) { + self.geom.is_pinned = !self.geom.is_pinned; + } + fn set_pinned(&mut self, should_be_pinned: bool) { + self.geom.is_pinned = should_be_pinned; + } + fn intercept_left_mouse_click(&mut self, position: &Position, client_id: ClientId) -> bool { + if self.position_is_on_frame(position) { + let relative_position = self.relative_position(position); + if let Some(client_frame) = self.frame.get_mut(&client_id) { + if client_frame.clicked_on_pinned(relative_position) { + self.toggle_pinned(); + return true; + } + } + } + false + } } impl PluginPane { diff --git a/zellij-server/src/panes/terminal_pane.rs b/zellij-server/src/panes/terminal_pane.rs index ad9714a43b..fe1a96ae4f 100644 --- a/zellij-server/src/panes/terminal_pane.rs +++ b/zellij-server/src/panes/terminal_pane.rs @@ -177,7 +177,9 @@ impl Pane for TerminalPane { self.reflow_lines(); } fn set_geom(&mut self, position_and_size: PaneGeom) { + let is_pinned = self.geom.is_pinned; self.geom = position_and_size; + self.geom.is_pinned = is_pinned; self.reflow_lines(); self.render_full_viewport(); } @@ -376,12 +378,14 @@ impl Pane for TerminalPane { }; let frame_geom = self.current_geom(); + let is_pinned = frame_geom.is_pinned; let mut frame = PaneFrame::new( frame_geom.into(), self.grid.scrollback_position_and_length(), pane_title, frame_params, - ); + ) + .is_pinned(is_pinned); if let Some((exit_status, is_first_run, _run_command)) = &self.is_held { if *is_first_run { frame.indicate_first_run(); @@ -820,6 +824,24 @@ impl Pane for TerminalPane { None } } + fn toggle_pinned(&mut self) { + self.geom.is_pinned = !self.geom.is_pinned; + } + fn set_pinned(&mut self, should_be_pinned: bool) { + self.geom.is_pinned = should_be_pinned; + } + fn intercept_left_mouse_click(&mut self, position: &Position, client_id: ClientId) -> bool { + if self.position_is_on_frame(position) { + let relative_position = self.relative_position(position); + if let Some(client_frame) = self.frame.get_mut(&client_id) { + if client_frame.clicked_on_pinned(relative_position) { + self.toggle_pinned(); + return true; + } + } + } + false + } } impl TerminalPane { diff --git a/zellij-server/src/panes/tiled_panes/mod.rs b/zellij-server/src/panes/tiled_panes/mod.rs index 7fcd7a4060..0223a79ecb 100644 --- a/zellij-server/src/panes/tiled_panes/mod.rs +++ b/zellij-server/src/panes/tiled_panes/mod.rs @@ -699,15 +699,26 @@ impl TiledPanes { .render_pane_contents_for_client(*client_id) .with_context(err_context)?; } + let is_floating = false; if self.draw_pane_frames { pane_contents_and_ui - .render_pane_frame(*client_id, client_mode, self.session_is_mirrored) + .render_pane_frame( + *client_id, + client_mode, + self.session_is_mirrored, + is_floating, + ) .with_context(err_context)?; } else if pane_is_stacked { // if we have no pane frames but the pane is stacked, we need to render its // frame which will amount to only rendering the title line pane_contents_and_ui - .render_pane_frame(*client_id, client_mode, self.session_is_mirrored) + .render_pane_frame( + *client_id, + client_mode, + self.session_is_mirrored, + is_floating, + ) .with_context(err_context)?; // we also need to render its boundaries as normal let boundaries = client_id_to_boundaries diff --git a/zellij-server/src/plugins/zellij_exports.rs b/zellij-server/src/plugins/zellij_exports.rs index 7da7dfa32a..4cd734de58 100644 --- a/zellij-server/src/plugins/zellij_exports.rs +++ b/zellij-server/src/plugins/zellij_exports.rs @@ -355,6 +355,9 @@ fn host_run_plugin_command(caller: Caller<'_, PluginEnv>) { PluginCommand::ChangeHostFolder(new_host_folder) => { change_host_folder(env, new_host_folder) }, + PluginCommand::SetFloatingPanePinned(pane_id, should_be_pinned) => { + set_floating_pane_pinned(env, pane_id.into(), should_be_pinned) + }, }, (PermissionStatus::Denied, permission) => { log::error!( @@ -1509,6 +1512,15 @@ fn change_host_folder(env: &PluginEnv, new_host_folder: PathBuf) { }); } +fn set_floating_pane_pinned(env: &PluginEnv, pane_id: PaneId, should_be_pinned: bool) { + let _ = env.senders.to_screen.as_ref().map(|sender| { + sender.send(ScreenInstruction::SetFloatingPanePinned( + pane_id, + should_be_pinned, + )) + }); +} + fn scan_host_folder(env: &PluginEnv, folder_to_scan: PathBuf) { if !folder_to_scan.starts_with("/host") { log::error!( @@ -1927,6 +1939,7 @@ fn check_command_permission( | PluginCommand::BreakPanesToTabWithIndex(..) | PluginCommand::ReloadPlugin(..) | PluginCommand::LoadNewPlugin { .. } + | PluginCommand::SetFloatingPanePinned(..) | PluginCommand::KillSessions(..) => PermissionType::ChangeApplicationState, PluginCommand::UnblockCliPipeInput(..) | PluginCommand::BlockCliPipeInput(..) diff --git a/zellij-server/src/route.rs b/zellij-server/src/route.rs index fda6a7a8bf..d5b7825e3b 100644 --- a/zellij-server/src/route.rs +++ b/zellij-server/src/route.rs @@ -969,6 +969,11 @@ pub(crate) fn route_action( )) .with_context(err_context)?; }, + Action::TogglePanePinned => { + senders + .send_to_screen(ScreenInstruction::TogglePanePinned(client_id)) + .with_context(err_context)?; + }, } Ok(should_break) } diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs index 84cc95547d..82c1a341cb 100644 --- a/zellij-server/src/screen.rs +++ b/zellij-server/src/screen.rs @@ -405,6 +405,8 @@ pub enum ScreenInstruction { client_id: ClientId, }, ListClientsToPlugin(PluginId, ClientId), + TogglePanePinned(ClientId), + SetFloatingPanePinned(PaneId, bool), } impl From<&ScreenInstruction> for ScreenContext { @@ -617,6 +619,8 @@ impl From<&ScreenInstruction> for ScreenContext { ScreenContext::BreakPanesToTabWithIndex }, ScreenInstruction::ListClientsToPlugin(..) => ScreenContext::ListClientsToPlugin, + ScreenInstruction::TogglePanePinned(..) => ScreenContext::TogglePanePinned, + ScreenInstruction::SetFloatingPanePinned(..) => ScreenContext::SetFloatingPanePinned, } } } @@ -2499,6 +2503,32 @@ impl Screen { } Ok(()) } + pub fn toggle_pane_pinned(&mut self, client_id: ClientId) { + active_tab_and_connected_client_id!( + self, + client_id, + |tab: &mut Tab, client_id: ClientId| { + tab.toggle_pane_pinned(client_id); + } + ); + self.unblock_input().non_fatal(); + } + pub fn set_floating_pane_pinned(&mut self, pane_id: PaneId, should_be_pinned: bool) { + let mut found = false; + for tab in self.tabs.values_mut() { + if tab.has_pane_with_pid(&pane_id) { + tab.set_floating_pane_pinned(pane_id, should_be_pinned); + found = true; + break; + } + } + if !found { + log::error!( + "Failed to find pane with id: {:?} to set as pinned", + pane_id + ); + } + } fn unblock_input(&self) -> Result<()> { self.bus .senders @@ -4713,6 +4743,12 @@ pub(crate) fn screen_thread_main( client_id, )?; }, + ScreenInstruction::TogglePanePinned(client_id) => { + screen.toggle_pane_pinned(client_id); + }, + ScreenInstruction::SetFloatingPanePinned(pane_id, should_be_pinned) => { + screen.set_floating_pane_pinned(pane_id, should_be_pinned); + }, } } Ok(()) diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index dbce15274d..de5bba6515 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -397,6 +397,10 @@ pub trait Pane { } false } + fn intercept_left_mouse_click(&mut self, _position: &Position, _client_id: ClientId) -> bool { + let intercepted = false; + intercepted + } fn store_pane_name(&mut self); fn load_pane_name(&mut self); fn set_borderless(&mut self, borderless: bool); @@ -503,6 +507,8 @@ pub trait Pane { fn drain_fake_cursors(&mut self) -> Option> { None } + fn toggle_pinned(&mut self) {} + fn set_pinned(&mut self, should_be_pinned: bool) {} } #[derive(Clone, Debug)] @@ -823,7 +829,7 @@ impl Tab { let display_area = *self.display_area.borrow(); // we do this so that the new swap layout has a chance to pass through the constraint system self.tiled_panes.resize(display_area); - self.should_clear_display_before_rendering = true; + self.set_should_clear_display_before_rendering(); Ok(()) } pub fn previous_swap_layout(&mut self, client_id: Option) -> Result<()> { @@ -1476,7 +1482,7 @@ impl Tab { ); self.tiled_panes .split_pane_horizontally(pid, Box::new(new_terminal), client_id); - self.should_clear_display_before_rendering = true; + self.set_should_clear_display_before_rendering(); self.tiled_panes.focus_pane(pid, client_id); self.swap_layouts.set_is_tiled_damaged(); } @@ -1536,7 +1542,7 @@ impl Tab { ); self.tiled_panes .split_pane_vertically(pid, Box::new(new_terminal), client_id); - self.should_clear_display_before_rendering = true; + self.set_should_clear_display_before_rendering(); self.tiled_panes.focus_pane(pid, client_id); self.swap_layouts.set_is_tiled_damaged(); } @@ -2099,6 +2105,11 @@ impl Tab { self.tiled_panes.set_force_render(); self.floating_panes.set_force_render(); } + pub fn set_should_clear_display_before_rendering(&mut self) { + self.should_clear_display_before_rendering = true; + self.floating_panes.set_force_render(); // we do this to make sure pinned panes are + // rendered even if their surface is not visible + } pub fn is_sync_panes_active(&self) -> bool { self.synchronize_is_active } @@ -2147,7 +2158,9 @@ impl Tab { self.tiled_panes .render(output, self.floating_panes.panes_are_visible()) .with_context(err_context)?; - if self.floating_panes.panes_are_visible() && self.floating_panes.has_active_panes() { + if (self.floating_panes.panes_are_visible() && self.floating_panes.has_active_panes()) + || self.floating_panes.has_pinned_panes() + { self.floating_panes .render(output) .with_context(err_context)?; @@ -2182,7 +2195,19 @@ impl Tab { let connected_clients: Vec = { self.connected_clients.borrow().iter().copied().collect() }; for client_id in connected_clients { - match self.get_active_terminal_cursor_position(client_id) { + match self + .get_active_terminal_cursor_position(client_id) + .and_then(|(cursor_position_x, cursor_position_y)| { + // TODO: get active_pane_z_index and pass it to cursor_is_visible so we do the + // right thing if the cursor is in a floating pane + if self.floating_panes.panes_are_visible() { + Some((cursor_position_x, cursor_position_y)) + } else if output.cursor_is_visible(cursor_position_x, cursor_position_y) { + Some((cursor_position_x, cursor_position_y)) + } else { + None + } + }) { Some((cursor_position_x, cursor_position_y)) => { let desired_cursor_shape = self .get_active_pane(client_id) @@ -2308,7 +2333,7 @@ impl Tab { self.swap_layouts.set_is_tiled_damaged(); let _ = self.relayout_tiled_panes(None, false, false, true); } - self.should_clear_display_before_rendering = true; + self.set_should_clear_display_before_rendering(); self.senders .send_to_pty_writer(PtyWriteInstruction::ApplyCachedResizes) .with_context(|| format!("failed to update plugins with mode info"))?; @@ -3256,6 +3281,14 @@ impl Tab { { return Ok(self.floating_panes.get_pane_mut(pane_id)); } + } else if self.floating_panes.has_pinned_panes() { + if let Some(pane_id) = self + .floating_panes + .get_pinned_pane_id_at(point, search_selectable) + .with_context(err_context)? + { + return Ok(self.floating_panes.get_pane_mut(pane_id)); + } } if let Some(pane_id) = self .get_pane_id_at(point, search_selectable) @@ -3305,6 +3338,31 @@ impl Tab { ) }; + let intercepted = self + .get_pane_at(position, false) + .with_context(err_context)? + .map(|pane| pane.intercept_left_mouse_click(&position, client_id)) + .unwrap_or(false); + if intercepted { + self.set_force_render(); + return Ok(()); + } + + if !self.floating_panes.panes_are_visible() { + let search_selectable = false; + if let Ok(Some(pane_id)) = self + .floating_panes + .get_pinned_pane_id_at(position, search_selectable) + { + // here, the floating panes are not visible, but there is a pinned pane (always + // visible) that has been clicked on - so we make the entire surface visible and + // focus it + self.show_floating_panes(); + self.floating_panes.focus_pane(pane_id, client_id); + return Ok(()); + } + } + self.focus_pane_at(position, client_id) .with_context(err_context)?; @@ -3888,7 +3946,7 @@ impl Tab { pub fn set_pane_frames(&mut self, should_set_pane_frames: bool) { self.tiled_panes.set_pane_frames(should_set_pane_frames); self.draw_pane_frames = should_set_pane_frames; - self.should_clear_display_before_rendering = true; + self.set_should_clear_display_before_rendering(); self.set_force_render(); } pub fn panes_to_hide_count(&self) -> usize { @@ -4146,6 +4204,9 @@ impl Tab { if let Some(mut new_pane_geom) = self.floating_panes.find_room_for_new_pane() { if let Some(floating_pane_coordinates) = floating_pane_coordinates { let viewport = self.viewport.borrow(); + if let Some(pinned) = floating_pane_coordinates.pinned.as_ref() { + pane.set_pinned(*pinned); + } new_pane_geom.adjust_coordinates(floating_pane_coordinates, *viewport); self.swap_layouts.set_is_floating_damaged(); } @@ -4185,7 +4246,7 @@ impl Tab { } else { self.tiled_panes.insert_pane(pane_id, pane); } - self.should_clear_display_before_rendering = true; + self.set_should_clear_display_before_rendering(); if let Some(client_id) = client_id { self.tiled_panes.focus_pane(pane_id, client_id); } @@ -4351,6 +4412,18 @@ impl Tab { self.suppressed_panes.insert(pane_id, suppressed_pane_entry); } } + pub fn toggle_pane_pinned(&mut self, client_id: ClientId) { + if let Some(pane) = self.get_active_pane_mut(client_id) { + pane.toggle_pinned(); + self.set_force_render(); + } + } + pub fn set_floating_pane_pinned(&mut self, pane_id: PaneId, should_be_pinned: bool) { + if let Some(pane) = self.get_pane_with_id_mut(pane_id) { + pane.set_pinned(should_be_pinned); + self.set_force_render(); + } + } fn new_scrollback_editor_pane(&self, pid: u32) -> TerminalPane { let next_terminal_position = self.get_next_terminal_position(); let mut new_pane = TerminalPane::new( diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__base_floating_layout_is_included_in_swap_layouts.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__base_floating_layout_is_included_in_swap_layouts.snap index e60c5fd33f..3645f69c88 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__base_floating_layout_is_included_in_swap_layouts.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__base_floating_layout_is_included_in_swap_layouts.snap @@ -1,9 +1,9 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 6089 +assertion_line: 7605 expression: snapshot --- -00 (C): ┌ zellij:tab-bar ─────────────────────────────────┌ zellij:status-bar ───────────────────────────────────────┐──────────┐ +00 (C): ┌ zellij:tab-bar ─────────────────────────────────┌ zellij:status-bar ────────────────────────────── PIN [ ] ┐──────────┐ 01 (C): │I am a tab bar │I am a │ │ 02 (C): │ │status bar │ │ 03 (C): │ │ │ │ @@ -13,7 +13,7 @@ expression: snapshot 07 (C): │ │ │ │ │ 08 (C): │ │ │ │ │ 09 (C): └─────────────────────────────│ └──────────────────────────────────────────────────────────┘ │ -10 (C): ┌ command1 ───────────────────│ ┌ command2 ────────────────────────────────────────────────┐ │ +10 (C): ┌ command1 ───────────────────│ ┌ command2 ─────────────────────────────────────── PIN [ ] ┐ │ 11 (C): │ │ │ │ │ 12 (C): │ │ │ │ │ 13 (C): │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__can_swap_floating_layout_at_runtime.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__can_swap_floating_layout_at_runtime.snap index 04fa9400c5..663d3c5123 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__can_swap_floating_layout_at_runtime.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__can_swap_floating_layout_at_runtime.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 3022 +assertion_line: 3841 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,7 +8,7 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): ┌ Pane #2 ─────────────────────────────────────────────────┐ ┌ Pane #3 ─────────────────────────────────────────────────┐ +05 (C): ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ ┌ Pane #3 ──────────────────────────────────────── PIN [ ] ┐ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__close_suppressing_floating_pane.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__close_suppressing_floating_pane.snap index 91910115e1..09127ecfc0 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__close_suppressing_floating_pane.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__close_suppressing_floating_pane.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1352 +assertion_line: 2797 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,7 +8,7 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__decrease_floating_pane_size.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__decrease_floating_pane_size.snap index 65011a6769..af28471d67 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__decrease_floating_pane_size.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__decrease_floating_pane_size.snap @@ -1,7 +1,7 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 1104 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ @@ -9,7 +9,7 @@ expression: snapshot 03 (C): │ │ 04 (C): │ │ 05 (C): │ │ -06 (C): │ ┌ Pane #2 ─────────────────────────────────────────────┐ │ +06 (C): │ ┌ Pane #2 ──────────────────────────────────── PIN [ ] ┐ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ 09 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__drag_pane_with_mouse.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__drag_pane_with_mouse.snap index bdb531d2e9..7450c0fd60 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__drag_pane_with_mouse.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__drag_pane_with_mouse.snap @@ -1,16 +1,16 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1252 +assertion_line: 1944 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -04 (C): │ │E┌ Pane #6 ─────────────── SCROLL: 0/1 ┐ │ +04 (C): │ │E┌ Pane #6 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 06 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEE┌ Pane #2 ─────────────────────────────────────────────────┐ │ +07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEE┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 08 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ │ 09 (C): │ └─────────────────────────────│ │ │ 10 (C): │ │E│ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__five_new_floating_panes.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__five_new_floating_panes.snap index a2cc23382b..ddb4f10029 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__five_new_floating_panes.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__five_new_floating_panes.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 682 +assertion_line: 1028 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -04 (C): │ │E┌ Pane #6 ─────────────── SCROLL: 0/1 ┐ │ -05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────────────────────────────┐ │ +04 (C): │ │E┌ Pane #6 ───── SCROLL: 0/1 | PIN [ ] ┐ │ +05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│──────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ │ -07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│───────────────────────────────── SCROLL: 0/1 ┐ │ +07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 08 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -09 (C): │ └──────────────────────────────────────┘─────────────────────────────────── SCROLL: 0/1 ┐ │ +09 (C): │ └──────────────────────────────────────┘───────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 10 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 11 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 12 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__float_embedded_pane.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__float_embedded_pane.snap index ada8f530fa..6fe9a3f709 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__float_embedded_pane.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__float_embedded_pane.snap @@ -1,14 +1,14 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 2386 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__float_embedded_pane_without_pane_frames.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__float_embedded_pane_without_pane_frames.snap index c09b5e9f10..e8d81d2ac2 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__float_embedded_pane_without_pane_frames.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__float_embedded_pane_without_pane_frames.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1632 +assertion_line: 2445 expression: snapshot --- 00 (C): @@ -8,7 +8,7 @@ expression: snapshot 02 (C): 03 (C): 04 (C): -05 (C): ┌ Pane #2 ─────────────────────────────────────────────────┐ +05 (C): ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ 06 (C): │ │ 07 (C): │ │ 08 (C): │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_layout_with_plugins_and_commands_swaped_properly.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_layout_with_plugins_and_commands_swaped_properly.snap index 1d8dfe043e..e81573557d 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_layout_with_plugins_and_commands_swaped_properly.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_layout_with_plugins_and_commands_swaped_properly.snap @@ -1,9 +1,9 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 5995 +assertion_line: 7510 expression: snapshot --- -00 (C): ┌ zellij:status-bar ───────────────────────────────────────┐ab-bar ──────────────────────────────────────────┐──────────┐ +00 (C): ┌ zellij:status-bar ────────────────────────────── PIN [ ] ┐ab-bar ───────────────────────────────── PIN [ ] ┐──────────┐ 01 (C): │I am a │b bar │ │ 02 (C): │status bar │ │ │ 03 (C): │ │ │ │ @@ -13,7 +13,7 @@ expression: snapshot 07 (C): │ │ │ │ 08 (C): │ │ │ │ 09 (C): └──────────────────────────────────────────────────────────┘─────────────────────────────────────────────────┘ │ -10 (C): ┌ command1 ───────────────────│ ┌ command2 ────────────────────────────────────────────────┐ │ +10 (C): ┌ command1 ───────────────────│ ┌ command2 ─────────────────────────────────────── PIN [ ] ┐ │ 11 (C): │ │ │ │ │ 12 (C): │ │ │ │ │ 13 (C): │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_pane_above_sixel_image.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_pane_above_sixel_image.snap index 19d6feb881..30cddfa491 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_pane_above_sixel_image.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_pane_above_sixel_image.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1343 +assertion_line: 2685 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────── SCROLL: 0/7 ┐ @@ -10,7 +10,7 @@ expression: snapshot 04 (C): │ixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixe │ 05 (C): │ixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixe │ 06 (C): │ixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixe │ -07 (C): │ixelSixelSixelSixelSixelSixelSixe┌ Pane #2 ─────────────────────────────────────────────────┐ │ +07 (C): │ixelSixelSixelSixelSixelSixelSixe┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 08 (C): │ixelSixelSixelSixelSixelSixelSixe│ │ │ 09 (C): │ixelSixelSixelSixelSixelSixelSixe│ │ │ 10 (C): │ixelSixelSixelSixelSixelSixelSixe│ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_panes_persist_across_toggles.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_panes_persist_across_toggles.snap index dd632a954a..ec4350423b 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_panes_persist_across_toggles.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__floating_panes_persist_across_toggles.snap @@ -1,14 +1,14 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 881 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__increase_floating_pane_size.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__increase_floating_pane_size.snap index 30121d194c..934b5ccb36 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__increase_floating_pane_size.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__increase_floating_pane_size.snap @@ -1,13 +1,13 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 1066 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ 03 (C): │ │ -04 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────────┐ │ +04 (C): │ ┌ Pane #2 ──────────────────────────────────────────── PIN [ ] ┐ │ 05 (C): │ │ │ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__mark_text_inside_floating_pane.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__mark_text_inside_floating_pane.snap index 20e382fbae..c711393169 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__mark_text_inside_floating_pane.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__mark_text_inside_floating_pane.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1318 +assertion_line: 2050 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -04 (C): │ │E┌ Pane #6 ─────────────── SCROLL: 0/1 ┐ │ -05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────────────────────────────┐ │ +04 (C): │ │E┌ Pane #6 ───── SCROLL: 0/1 | PIN [ ] ┐ │ +05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│──────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ │ -07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│───────────────────────────────── SCROLL: 0/1 ┐ │ +07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 08 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -09 (C): │ └──────────────────────────────────────┘─────────────────────────────────── SCROLL: 0/1 ┐ │ +09 (C): │ └──────────────────────────────────────┘───────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 10 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 11 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 12 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_down.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_down.snap index a401ba08a7..ecec0e6653 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_down.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_down.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1078 +assertion_line: 1650 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -04 (C): │ │E┌ Pane #6 ─────────────── SCROLL: 0/1 ┐ │ -05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────────────────────────────┐ │ +04 (C): │ │E┌ Pane #6 ───── SCROLL: 0/1 | PIN [ ] ┐ │ +05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│──────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ │ -07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│───────────────────────────────── SCROLL: 0/1 ┐ │ +07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 08 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -09 (C): │ └──────────────────────────────────────┘─────────────────────────────────── SCROLL: 0/1 ┐ │ +09 (C): │ └──────────────────────────────────────┘───────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 10 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 11 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 12 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_left.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_left.snap index 98f623d783..38a5df4b21 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_left.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_left.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 911 +assertion_line: 1363 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 04 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ ┐ │ -05 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│E│─────────────────────────────────────────────┐ │ +05 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│E│──────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│E│ │ │ -07 (C): │ └──────────────────────────────────────┘E│───────────────────────────────── SCROLL: 0/1 ┐ │ +07 (C): │ └──────────────────────────────────────┘E│─────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 08 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -09 (C): │ └──────────────────────────────────────┘─────────────────────────────────── SCROLL: 0/1 ┐ │ +09 (C): │ └──────────────────────────────────────┘───────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 10 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 11 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 12 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_right.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_right.snap index 67d7cfa4d5..1336cda693 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_right.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_right.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 967 +assertion_line: 1459 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -04 (C): │ │E┌ Pane #6 ─────────────── SCROLL: 0/1 ┐ │ -05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────────────────────────────┐ │ +04 (C): │ │E┌ Pane #6 ───── SCROLL: 0/1 | PIN [ ] ┐ │ +05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│──────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ │ -07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│───────────────────────────────── SCROLL: 0/1 ┐ │ +07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 08 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -09 (C): │ └──────────────────────────────────────┘─────────────────────────────────── SCROLL: 0/1 ┐ │ +09 (C): │ └──────────────────────────────────────┘───────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 10 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 11 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 12 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_up.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_up.snap index 193834e883..61c4e323b5 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_up.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_up.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1022 +assertion_line: 1554 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 04 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ ┐ │ -05 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│E│─────────────────────────────────────────────┐ │ +05 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│E│──────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│E│ │ │ -07 (C): │ └──────────────────────────────────────┘E│───────────────────────────────── SCROLL: 0/1 ┐ │ +07 (C): │ └──────────────────────────────────────┘E│─────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 08 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -09 (C): │ └──────────────────────────────────────┘─────────────────────────────────── SCROLL: 0/1 ┐ │ +09 (C): │ └──────────────────────────────────────┘───────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 10 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 11 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 12 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_with_mouse.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_with_mouse.snap index 2561b5ce1b..b9696dc085 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_with_mouse.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_focus_with_mouse.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1136 +assertion_line: 1748 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -04 (C): │ │E┌ Pane #6 ─────────────── SCROLL: 0/1 ┐ │ -05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────────────────────────────┐ │ +04 (C): │ │E┌ Pane #6 ───── SCROLL: 0/1 | PIN [ ] ┐ │ +05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│──────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ │ -07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│───────────────────────────────── SCROLL: 0/1 ┐ │ +07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 08 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -09 (C): │ └─────────────────────────────┌ Pane #4 ─────────────────────────────────── SCROLL: 0/1 ┐ │ +09 (C): │ └─────────────────────────────┌ Pane #4 ───────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 10 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 11 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 12 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_with_sixel_image.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_with_sixel_image.snap index df091cdb62..8365df050b 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_with_sixel_image.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__move_floating_pane_with_sixel_image.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1312 +assertion_line: 2647 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -10,7 +10,7 @@ expression: snapshot 04 (C): │ │ 05 (C): │ │ 06 (C): │ │ -07 (C): │ ┌ Pane #2 ────────────────────────────────── SCROLL: 0/17 ┐ │ +07 (C): │ ┌ Pane #2 ──────────────────────── SCROLL: 0/17 | PIN [ ] ┐ │ 08 (C): │ │SixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSix│ │ 09 (C): │ │SixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSix│ │ 10 (C): │ │SixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSixelSix│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane.snap index dd632a954a..3220eee685 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane.snap @@ -1,14 +1,14 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 849 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout-2.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout-2.snap index cdef481233..1394348af1 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout-2.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout-2.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 5799 +assertion_line: 8040 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,7 +8,7 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ────────────────────────────────────────────┐ ┌ Pane #3 ────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ─────────────────────────────────── PIN [ ] ┐ ┌ Pane #3 ─────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ │ │ 07 (C): │ │ │ │ │ │ 08 (C): │ │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout-3.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout-3.snap index b5c19c92eb..e84b8fc6ac 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout-3.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout-3.snap @@ -1,10 +1,10 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 5799 +assertion_line: 8040 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ -01 (C): │ ┌ Pane #3 ────────────────────────────────────────────┐ ┌ Pane #2 ────────────────────────────────────────────┐ │ +01 (C): │ ┌ Pane #3 ─────────────────────────────────── PIN [ ] ┐ ┌ Pane #2 ─────────────────────────────────── PIN [ ] ┐ │ 02 (C): │ │ │ │ │ │ 03 (C): │ │ │ │ │ │ 04 (C): │ │ │ │ │ │ @@ -14,7 +14,7 @@ expression: snapshot 08 (C): │ │ │ │ │ │ 09 (C): │ │ │ │ │ │ 10 (C): │ └─────────────────────────────────────────────────────┘ └─────────────────────────────────────────────────────┘ │ -11 (C): │ ┌ Pane #4 ────────────────────────────────────────────┐ │ +11 (C): │ ┌ Pane #4 ─────────────────────────────────── PIN [ ] ┐ │ 12 (C): │ │ │ │ 13 (C): │ │ │ │ 14 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout.snap index d6c8418576..675409f813 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__new_floating_pane_in_auto_layout.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 5799 +assertion_line: 8040 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -13,7 +13,7 @@ expression: snapshot 07 (C): │ │ 08 (C): │ │ 09 (C): │ │ -10 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ +10 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ 11 (C): │ │ │ 12 (C): │ │ │ 13 (C): │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__rename_floating_pane.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__rename_floating_pane.snap index cb73eb45cd..2e39065d21 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__rename_floating_pane.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__rename_floating_pane.snap @@ -1,5 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 2550 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -7,7 +8,7 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Renamed floating pane ───────────────────────────────────┐ │ +05 (C): │ ┌ Renamed floating pane ────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_down.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_down.snap index 3a38a93406..93b1596845 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_down.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_down.snap @@ -1,14 +1,14 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 1268 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_left.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_left.snap index f5831eb8fc..1c186c17bc 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_left.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_left.snap @@ -1,14 +1,14 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 1145 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ──────────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ───────────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_right.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_right.snap index 52dffcceda..0b1b0f9369 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_right.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_right.snap @@ -1,14 +1,14 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 1186 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ──────────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ───────────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_up.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_up.snap index 6e4b9b6dbb..a4b8209553 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_up.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_floating_pane_up.snap @@ -1,12 +1,12 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 1227 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ -03 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +03 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 04 (C): │ │ │ │ 05 (C): │ │ │ │ 06 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_tab_with_floating_panes.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_tab_with_floating_panes.snap index da14ad29f6..b3e645b6a5 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_tab_with_floating_panes.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_tab_with_floating_panes.snap @@ -1,13 +1,13 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1544 +assertion_line: 2144 expression: snapshot --- -00 (C): ┌ Pane #1 ────────────────────┌ ┌ ┌ Pane #4 ─────────────────────────────────── SCROLL: 0/1 ┐─────┐ +00 (C): ┌ Pane #1 ────────────────────┌ ┌ ┌ Pane #4 ───────────────────────── SCROLL: 0/1 | PIN [ ] ┐─────┐ 01 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -04 (C): │ │E┌ Pane #6 ─────────────── SCROLL: 0/1 ┐EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ +04 (C): │ │E┌ Pane #6 ───── SCROLL: 0/1 | PIN [ ] ┐EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 06 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_whole_tab_while_floting_pane_is_suppressed.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_whole_tab_while_floting_pane_is_suppressed.snap index 2a886db750..dd07c8fcf7 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_whole_tab_while_floting_pane_is_suppressed.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__resize_whole_tab_while_floting_pane_is_suppressed.snap @@ -1,9 +1,9 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 2220 +assertion_line: 2921 expression: snapshot --- -00 (C): ┌ Pane #1 ────────────────────┌ EDITING SCROLLBACK ──────────────────────────────────────┐─────────┐ +00 (C): ┌ Pane #1 ────────────────────┌ EDITING SCROLLBACK ───────────────────────────── PIN [ ] ┐─────────┐ 01 (C): │ │ │ │ 02 (C): │ │ │ │ 03 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__search_floating_tab_highlight_fring.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__search_floating_tab_highlight_fring.snap index fdb60046d6..62d2259482 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__search_floating_tab_highlight_fring.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__search_floating_tab_highlight_fring.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1721 +assertion_line: 3029 expression: snapshot --- 00 (C): @@ -8,7 +8,7 @@ expression: snapshot 02 (C): 03 (C): 04 (C): -05 (C): ┌ SEARCHING: fring ──────────────────────── SCROLL: 0/103 ┐ +05 (C): ┌ SEARCHING: fring ────────────── SCROLL: 0/103 | PIN [ ] ┐ 06 (C): │ │ 07 (C): │a mauris in aliquam sem fringilla. │ 08 (C): │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__search_floating_tab_nothing_highlighted.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__search_floating_tab_nothing_highlighted.snap index eeb3b4915a..0e0e7e6c72 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__search_floating_tab_nothing_highlighted.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__search_floating_tab_nothing_highlighted.snap @@ -1,5 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 3017 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -7,7 +8,7 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ fish /home/thomas/Projects/zellij ─────── SCROLL: 0/103 ┐ │ +05 (C): │ ┌ fish /home/thomas/Projects/zellij ────── 0/103 | PIN [ ] ┐ │ 06 (C): │ │d viverra tellus in hac habitasse. Nunc scelerisque viverr│ │ 07 (C): │ │a mauris in aliquam sem fringilla. │ │ 08 (C): │ │⏎ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__shrink_whole_tab_with_floating_panes_horizontally_and_vertically.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__shrink_whole_tab_with_floating_panes_horizontally_and_vertically.snap index cfa37b7472..e8a854d5f0 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__shrink_whole_tab_with_floating_panes_horizontally_and_vertically.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__shrink_whole_tab_with_floating_panes_horizontally_and_vertically.snap @@ -1,13 +1,13 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1594 +assertion_line: 2234 expression: snapshot --- 00 (C): ┌ Pane #1 ────────────────────┌ ┌ ┌ Pane #4 ── 0 ┐ 01 (C): │ │ │E│EEEEEEEEEEEEEE│ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐EEEEEEE│ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐EEEEEEE│ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -04 (C): │ │E┌ Pane #6 ─────────────── SCROLL: 0/1 ┐EEEEE│ +04 (C): │ │E┌ Pane #6 ───── SCROLL: 0/1 | PIN [ ] ┐EEEEE│ 05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEE│ 06 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEE│ 07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEE│ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__shrink_whole_tab_with_floating_panes_horizontally_and_vertically_and_expand_back.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__shrink_whole_tab_with_floating_panes_horizontally_and_vertically_and_expand_back.snap index a7c0f582de..3c187c2735 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__shrink_whole_tab_with_floating_panes_horizontally_and_vertically_and_expand_back.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__shrink_whole_tab_with_floating_panes_horizontally_and_vertically_and_expand_back.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1648 +assertion_line: 2329 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ Pane #5 ─────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ Pane #5 ───── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -04 (C): │ │E┌ Pane #6 ─────────────── SCROLL: 0/1 ┐ │ -05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────────────────────────────┐ │ +04 (C): │ │E┌ Pane #6 ───── SCROLL: 0/1 | PIN [ ] ┐ │ +05 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│──────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ │ -07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│───────────────────────────────── SCROLL: 0/1 ┐ │ +07 (C): │ └─│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│─────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 08 (C): │ │EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ -09 (C): │ └──────────────────────────────────────┘─────────────────────────────────── SCROLL: 0/1 ┐ │ +09 (C): │ └──────────────────────────────────────┘───────────────────────── SCROLL: 0/1 | PIN [ ] ┐ │ 10 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 11 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ 12 (C): │ │ │E│EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE│ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__suppress_floating_pane.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__suppress_floating_pane.snap index 6ac3104482..1a6ae09514 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__suppress_floating_pane.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__suppress_floating_pane.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 1639 +assertion_line: 2738 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,7 +8,7 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ EDITING SCROLLBACK ──────────────────────────────────────┐ │ +05 (C): │ ┌ EDITING SCROLLBACK ───────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_including_command_panes_absent_from_existing_layout.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_including_command_panes_absent_from_existing_layout.snap index fb7d917617..5dc4503b11 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_including_command_panes_absent_from_existing_layout.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_including_command_panes_absent_from_existing_layout.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 6180 +assertion_line: 7697 expression: snapshot --- -00 (C): ┌ Pane #2 ─────────────────────────────────────────────────┐────────────────────────────────────────────────────────────┐ +00 (C): ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐────────────────────────────────────────────────────────────┐ 01 (C): │ │ │ 02 (C): │ │ │ 03 (C): │ │ │ 04 (C): │ │ │ -05 (C): │ ┌ zellij:status-bar ───────────────────────────────────────┐ │ +05 (C): │ ┌ zellij:status-bar ────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │I am a │ │ -07 (C): │ │status bar │─┐ │ +07 (C): │ │status bar │ ┐ │ 08 (C): │ │ │ │ │ -09 (C): └─────────────────────────────│ │───┐ │ +09 (C): └─────────────────────────────│ │ ] ┐ │ 10 (C): │ ┌ Pane #3 ──────────│ │ │ │ 11 (C): │ │ │ │ │ │ 12 (C): │ │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_including_plugin_panes_absent_from_existing_layout.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_including_plugin_panes_absent_from_existing_layout.snap index 2f06d9318e..ab242bad1e 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_including_plugin_panes_absent_from_existing_layout.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_including_plugin_panes_absent_from_existing_layout.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 5672 +assertion_line: 7864 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,11 +8,11 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ -07 (C): │ │ ┌ Pane #3 ─────────────────────────────────────────────────┐ │ +07 (C): │ │ ┌ Pane #3 ──────────────────────────────────────── PIN [ ] ┐ │ 08 (C): │ │ │ │ │ -09 (C): │ │ │ ┌ Pane #4 ─────────────────────────────────────────────────┐ │ +09 (C): │ │ │ ┌ Pane #4 ──────────────────────────────────────── PIN [ ] ┐ │ 10 (C): │ │ │ │ │ │ 11 (C): │ │ │ │ │ │ 12 (C): │ │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_not_including_command_panes_present_in_existing_layout.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_not_including_command_panes_present_in_existing_layout.snap index 01d107cde0..8d591ff082 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_not_including_command_panes_present_in_existing_layout.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_not_including_command_panes_present_in_existing_layout.snap @@ -1,18 +1,18 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 6275 +assertion_line: 7793 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ -02 (C): │ ┌ command2 ────────────── SCROLL: 0/1 ┐ │ +02 (C): │ ┌ command2 ──── SCROLL: 0/1 | PIN [ ] ┐ │ 03 (C): │ │ Waiting to run: command2 │ │ -04 (C): │ │ ┌ zellij:tab-bar ──────────────────────┐ │ -05 (C): │ │<│I am a tab bar ┌ zellij:status-bar ───────────────────────────────────────┐ │ +04 (C): │ │ ┌ zellij:tab-bar ───────────── PIN [ ] ┐ │ +05 (C): │ │<│I am a tab bar ┌ zellij:status-bar ────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │l│ │I am a │ │ -07 (C): │ └─│ │status bar │─┐ │ +07 (C): │ └─│ │status bar │ ┐ │ 08 (C): │ │ │ │ │ │ -09 (C): │ └─────────────────────────│ │───┐ │ +09 (C): │ └─────────────────────────│ │ ] ┐ │ 10 (C): │ │ │ │ │ 11 (C): │ │ │ │ │ 12 (C): │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_not_including_plugin_panes_present_in_existing_layout.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_not_including_plugin_panes_present_in_existing_layout.snap index bb542c19f8..63deedf006 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_not_including_plugin_panes_present_in_existing_layout.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__swap_floating_layouts_not_including_plugin_panes_present_in_existing_layout.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 6432 +assertion_line: 7952 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,11 +8,11 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ zellij:tab-bar ──────────────────────────────────────────┐ │ +05 (C): │ ┌ zellij:tab-bar ───────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │I am a tab bar │ │ -07 (C): │ │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +07 (C): │ │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 08 (C): │ │ │ │ │ -09 (C): │ │ │ ┌ zellij:status-bar ───────────────────────────────────────┐ │ +09 (C): │ │ │ ┌ zellij:status-bar ────────────────────────────── PIN [ ] ┐ │ 10 (C): │ │ │ │I am a │ │ 11 (C): │ │ │ │status bar │ │ 12 (C): │ │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__tab_with_layout_that_has_floating_panes.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__tab_with_layout_that_has_floating_panes.snap index 6816fcb8b5..ba51ae683b 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__tab_with_layout_that_has_floating_panes.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__tab_with_layout_that_has_floating_panes.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 2560 +assertion_line: 3335 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,9 +8,9 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ -07 (C): │ │ ┌ Pane #3 ─────────────────────────────────────────────────┐ │ +07 (C): │ │ ┌ Pane #3 ──────────────────────────────────────── PIN [ ] ┐ │ 08 (C): │ │ │ │ │ 09 (C): │ │ │ │ │ 10 (C): │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__toggle_floating_panes_on.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__toggle_floating_panes_on.snap index dd632a954a..bc92cb94ce 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__toggle_floating_panes_on.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__toggle_floating_panes_on.snap @@ -1,14 +1,14 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs +assertion_line: 940 expression: snapshot - --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_closing_a_floating_pane_in_auto_layout_the_focus_goes_to_last_focused_pane.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_closing_a_floating_pane_in_auto_layout_the_focus_goes_to_last_focused_pane.snap index 331e678b4b..bff48b7327 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_closing_a_floating_pane_in_auto_layout_the_focus_goes_to_last_focused_pane.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_closing_a_floating_pane_in_auto_layout_the_focus_goes_to_last_focused_pane.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 6028 +assertion_line: 8340 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,9 +8,9 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #3 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #3 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ -07 (C): │ │ │─┐ │ +07 (C): │ │ │ ┐ │ 08 (C): │ │ │ │ │ 09 (C): │ │ │ │ │ 10 (C): │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_resizing_whole_tab_with_auto_layout_and_floating_panes_the_layout_is_maintained.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_resizing_whole_tab_with_auto_layout_and_floating_panes_the_layout_is_maintained.snap index 26bcb978cd..c410513d54 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_resizing_whole_tab_with_auto_layout_and_floating_panes_the_layout_is_maintained.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_resizing_whole_tab_with_auto_layout_and_floating_panes_the_layout_is_maintained.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 6079 +assertion_line: 8408 expression: snapshot --- 00 (C): ┌ Pane #1 ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -11,11 +11,11 @@ expression: snapshot 05 (C): │ │ 06 (C): │ │ 07 (C): │ │ -08 (C): │ ┌ Pane #2 ────────────────────────────────────────────────────────────────┐ │ +08 (C): │ ┌ Pane #2 ─────────────────────────────────────────────────────── PIN [ ] ┐ │ 09 (C): │ │ │ │ -10 (C): │ │ ┌ Pane #3 ────────────────────────────────────────────────────────────────┐ │ +10 (C): │ │ ┌ Pane #3 ─────────────────────────────────────────────────────── PIN [ ] ┐ │ 11 (C): │ │ │ │ │ -12 (C): │ │ │ ┌ Pane #4 ────────────────────────────────────────────────────────────────┐ │ +12 (C): │ │ │ ┌ Pane #4 ─────────────────────────────────────────────────────── PIN [ ] ┐ │ 13 (C): │ │ │ │ │ │ 14 (C): │ │ │ │ │ │ 15 (C): │ │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_a_damaged_state_layout_and_pane_focus_are_unchanged.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_a_damaged_state_layout_and_pane_focus_are_unchanged.snap index 985cb31727..ae98ca35fd 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_a_damaged_state_layout_and_pane_focus_are_unchanged.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_a_damaged_state_layout_and_pane_focus_are_unchanged.snap @@ -1,16 +1,16 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 5859 +assertion_line: 8119 expression: snapshot --- -00 (C): ┌ Pane #2 ─────────────────────────────────────────────────┐────────────────────────────────────────────────────────────┐ +00 (C): ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐────────────────────────────────────────────────────────────┐ 01 (C): │ │ │ 02 (C): │ │ │ 03 (C): │ │ │ 04 (C): │ │ │ -05 (C): │ ┌ Pane #3 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #3 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ -07 (C): │ │ ┌ Pane #4 ─────────────────────────────────────────────────┐ │ +07 (C): │ │ ┌ Pane #4 ──────────────────────────────────────── PIN [ ] ┐ │ 08 (C): │ │ │ │ │ 09 (C): └─────────────────────────────│ │ │ │ 10 (C): │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_an_undamaged_state_pane_focuses_on_focused_node.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_an_undamaged_state_pane_focuses_on_focused_node.snap index c42856cde6..d72b4f8ce1 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_an_undamaged_state_pane_focuses_on_focused_node.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_an_undamaged_state_pane_focuses_on_focused_node.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 5915 +assertion_line: 8192 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,11 +8,11 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #4 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #4 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ -07 (C): │ │ │─┐ │ +07 (C): │ │ │ ┐ │ 08 (C): │ │ │ │ │ -09 (C): │ │ │ │─┐ │ +09 (C): │ │ │ │ ┐ │ 10 (C): │ │ │ │ │ │ 11 (C): │ │ │ │ │ │ 12 (C): │ │ │ │ │ │ diff --git a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_an_undamaged_state_with_no_focus_node_pane_focuses_on_deepest_node.snap b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_an_undamaged_state_with_no_focus_node_pane_focuses_on_deepest_node.snap index 36c93e277f..4614d7e656 100644 --- a/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_an_undamaged_state_with_no_focus_node_pane_focuses_on_deepest_node.snap +++ b/zellij-server/src/tab/unit/snapshots/zellij_server__tab__tab_integration_tests__when_swapping_floating_layouts_in_an_undamaged_state_with_no_focus_node_pane_focuses_on_deepest_node.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/tab/./unit/tab_integration_tests.rs -assertion_line: 5970 +assertion_line: 8266 expression: snapshot --- 00 (C): ┌ Pane #1 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ @@ -8,11 +8,11 @@ expression: snapshot 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ Pane #4 ─────────────────────────────────────────────────┐ │ +05 (C): │ ┌ Pane #4 ──────────────────────────────────────── PIN [ ] ┐ │ 06 (C): │ │ │ │ -07 (C): │ │ │─┐ │ +07 (C): │ │ │ ┐ │ 08 (C): │ │ │ │ │ -09 (C): │ │ ┌ Pane #2 ─────────────────────────────────────────────────┐ │ +09 (C): │ │ ┌ Pane #2 ──────────────────────────────────────── PIN [ ] ┐ │ 10 (C): │ │ │ │ │ 11 (C): │ │ │ │ │ 12 (C): │ │ │ │ │ diff --git a/zellij-server/src/ui/pane_boundaries_frame.rs b/zellij-server/src/ui/pane_boundaries_frame.rs index 57cff1ce42..c3884fbf7c 100644 --- a/zellij-server/src/ui/pane_boundaries_frame.rs +++ b/zellij-server/src/ui/pane_boundaries_frame.rs @@ -5,6 +5,7 @@ use crate::ClientId; use zellij_utils::data::{client_id_to_colors, PaletteColor, Style}; use zellij_utils::errors::prelude::*; use zellij_utils::pane_size::Viewport; +use zellij_utils::position::Position; use unicode_width::{UnicodeWidthChar, UnicodeWidthStr}; @@ -60,6 +61,7 @@ pub struct FrameParams { pub pane_is_stacked_under: bool, pub pane_is_stacked_over: bool, pub should_draw_pane_frames: bool, + pub pane_is_floating: bool, } #[derive(Default, PartialEq)] @@ -78,6 +80,8 @@ pub struct PaneFrame { pane_is_stacked_over: bool, pane_is_stacked_under: bool, should_draw_pane_frames: bool, + is_pinned: bool, + is_floating: bool, } impl PaneFrame { @@ -102,8 +106,14 @@ impl PaneFrame { pane_is_stacked_over: frame_params.pane_is_stacked_over, pane_is_stacked_under: frame_params.pane_is_stacked_under, should_draw_pane_frames: frame_params.should_draw_pane_frames, + is_pinned: false, + is_floating: frame_params.pane_is_floating, } } + pub fn is_pinned(mut self, is_pinned: bool) -> Self { + self.is_pinned = is_pinned; + self + } pub fn add_exit_status(&mut self, exit_status: Option) { self.exit_status = match exit_status { Some(exit_status) => Some(ExitStatus::Code(exit_status)), @@ -149,32 +159,80 @@ impl PaneFrame { max_length: usize, ) -> Option<(Vec, usize)> { // string and length because of color - if self.scroll_position.0 > 0 || self.scroll_position.1 > 0 { - let prefix = " SCROLL: "; - let full_indication = - format!(" {}/{} ", self.scroll_position.0, self.scroll_position.1); - let short_indication = format!(" {} ", self.scroll_position.0); - let full_indication_len = full_indication.chars().count(); - let short_indication_len = short_indication.chars().count(); - let prefix_len = prefix.chars().count(); - if prefix_len + full_indication_len <= max_length { - Some(( - foreground_color(&format!("{}{}", prefix, full_indication), self.color), - prefix_len + full_indication_len, - )) - } else if full_indication_len <= max_length { - Some(( - foreground_color(&full_indication, self.color), - full_indication_len, - )) - } else if short_indication_len <= max_length { - Some(( - foreground_color(&short_indication, self.color), - short_indication_len, - )) + let has_scroll = self.scroll_position.0 > 0 || self.scroll_position.1 > 0; + if has_scroll { + let pin_indication = if self.is_floating { + self.render_pinned_indication(max_length) } else { None + }; // no pin indication for tiled panes + let space_for_scroll_indication = pin_indication + .as_ref() + .map(|(_, length)| max_length.saturating_sub(*length + 1)) + .unwrap_or(max_length); + let scroll_indication = self.render_scroll_indication(space_for_scroll_indication); + match (pin_indication, scroll_indication) { + ( + Some((mut pin_indication, pin_indication_len)), + Some((mut scroll_indication, scroll_indication_len)), + ) => { + let mut characters: Vec<_> = scroll_indication.drain(..).collect(); + let mut separator = foreground_color(&format!("|"), self.color); + characters.append(&mut separator); + characters.append(&mut pin_indication); + Some((characters, pin_indication_len + scroll_indication_len + 1)) + }, + (Some(pin_indication), None) => Some(pin_indication), + (None, Some(scroll_indication)) => Some(scroll_indication), + _ => None, } + } else if self.is_floating { + self.render_pinned_indication(max_length) + } else { + None + } + } + fn render_scroll_indication( + &self, + max_length: usize, + ) -> Option<(Vec, usize)> { + let prefix = " SCROLL: "; + let full_indication = format!(" {}/{} ", self.scroll_position.0, self.scroll_position.1); + let short_indication = format!(" {} ", self.scroll_position.0); + let full_indication_len = full_indication.chars().count(); + let short_indication_len = short_indication.chars().count(); + let prefix_len = prefix.chars().count(); + if prefix_len + full_indication_len <= max_length { + Some(( + foreground_color(&format!("{}{}", prefix, full_indication), self.color), + prefix_len + full_indication_len, + )) + } else if full_indication_len <= max_length { + Some(( + foreground_color(&full_indication, self.color), + full_indication_len, + )) + } else if short_indication_len <= max_length { + Some(( + foreground_color(&short_indication, self.color), + short_indication_len, + )) + } else { + None + } + } + fn render_pinned_indication( + &self, + max_length: usize, + ) -> Option<(Vec, usize)> { + let is_checked = if self.is_pinned { '+' } else { ' ' }; + let full_indication = format!(" PIN [{}] ", is_checked); + let full_indication_len = full_indication.chars().count(); + if full_indication_len <= max_length { + Some(( + foreground_color(&full_indication, self.color), + full_indication_len, + )) } else { None } @@ -694,6 +752,22 @@ impl PaneFrame { }; Ok(res) } + pub fn clicked_on_pinned(&mut self, position: Position) -> bool { + if self.is_floating { + // TODO: this is not entirely accurate because our relative position calculation in + // itself isn't - when that is fixed, we should adjust this as well + let checkbox_center_position = self.geom.cols.saturating_sub(5); + let checkbox_position_start = checkbox_center_position.saturating_sub(1); + let checkbox_position_end = checkbox_center_position + 1; + if position.line() == -1 + && (position.column() >= checkbox_position_start + && position.column() <= checkbox_position_end) + { + return true; + } + } + false + } pub fn render(&self) -> Result<(Vec, Option)> { let err_context = || "failed to render pane frame"; let mut character_chunks = vec![]; diff --git a/zellij-server/src/ui/pane_contents_and_ui.rs b/zellij-server/src/ui/pane_contents_and_ui.rs index 6a4a7ab841..b2ed6383c4 100644 --- a/zellij-server/src/ui/pane_contents_and_ui.rs +++ b/zellij-server/src/ui/pane_contents_and_ui.rs @@ -140,16 +140,26 @@ impl<'a> PaneContentsAndUi<'a> { format!("failed to render fake cursor if needed for client {client_id}") })?; if let Some(colors) = client_id_to_colors(*fake_cursor_client_id, self.style.colors) { - if let Some(vte_output) = self.pane.render_fake_cursor(colors.0, colors.1) { - self.output.add_post_vte_instruction_to_client( - client_id, - &format!( - "\u{1b}[{};{}H\u{1b}[m{}", - self.pane.y() + 1, - self.pane.x() + 1, - vte_output - ), - ); + let cursor_is_visible = self + .pane + .cursor_coordinates() + .map(|(x, y)| { + self.output + .cursor_is_visible(self.pane.x() + x, self.pane.y() + y) + }) + .unwrap_or(false); + if cursor_is_visible { + if let Some(vte_output) = self.pane.render_fake_cursor(colors.0, colors.1) { + self.output.add_post_vte_instruction_to_client( + client_id, + &format!( + "\u{1b}[{};{}H\u{1b}[m{}", + self.pane.y() + 1, + self.pane.x() + 1, + vte_output + ), + ); + } } } } @@ -179,6 +189,7 @@ impl<'a> PaneContentsAndUi<'a> { client_id: ClientId, client_mode: InputMode, session_is_mirrored: bool, + pane_is_floating: bool, ) -> Result<()> { let err_context = || format!("failed to render pane frame for client {client_id}"); @@ -210,6 +221,7 @@ impl<'a> PaneContentsAndUi<'a> { pane_is_stacked_over: self.pane_is_stacked_over, pane_is_stacked_under: self.pane_is_stacked_under, should_draw_pane_frames: self.should_draw_pane_frames, + pane_is_floating, } } else { FrameParams { @@ -222,6 +234,7 @@ impl<'a> PaneContentsAndUi<'a> { pane_is_stacked_over: self.pane_is_stacked_over, pane_is_stacked_under: self.pane_is_stacked_under, should_draw_pane_frames: self.should_draw_pane_frames, + pane_is_floating, } }; diff --git a/zellij-server/src/unit/screen_tests.rs b/zellij-server/src/unit/screen_tests.rs index c536fe3107..c80a796f51 100644 --- a/zellij-server/src/unit/screen_tests.rs +++ b/zellij-server/src/unit/screen_tests.rs @@ -1328,6 +1328,7 @@ fn open_new_floating_pane_with_custom_coordinates() { y: Some(SplitSize::Fixed(5)), width: Some(SplitSize::Percent(1)), height: Some(SplitSize::Fixed(2)), + pinned: None, }), false, Some(1), @@ -1362,6 +1363,7 @@ fn open_new_floating_pane_with_custom_coordinates_exceeding_viewport() { y: Some(SplitSize::Fixed(21)), width: Some(SplitSize::Fixed(10)), height: Some(SplitSize::Fixed(10)), + pinned: None, }), false, Some(1), @@ -2229,6 +2231,7 @@ pub fn send_cli_new_pane_action_with_default_parameters() { y: None, width: None, height: None, + pinned: None, }; send_cli_action_to_server(&session_metadata, cli_new_pane_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); // give time for actions to be @@ -2272,6 +2275,7 @@ pub fn send_cli_new_pane_action_with_split_direction() { y: None, width: None, height: None, + pinned: None, }; send_cli_action_to_server(&session_metadata, cli_new_pane_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); // give time for actions to be @@ -2315,6 +2319,7 @@ pub fn send_cli_new_pane_action_with_command_and_cwd() { y: None, width: None, height: None, + pinned: None, }; send_cli_action_to_server(&session_metadata, cli_new_pane_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); // give time for actions to be @@ -2358,6 +2363,7 @@ pub fn send_cli_new_pane_action_with_floating_pane_and_coordinates() { y: None, width: Some("20%".to_owned()), height: None, + pinned: None, }; send_cli_action_to_server(&session_metadata, cli_new_pane_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); // give time for actions to be @@ -2396,6 +2402,7 @@ pub fn send_cli_edit_action_with_default_parameters() { y: None, width: None, height: None, + pinned: None, }; send_cli_action_to_server(&session_metadata, cli_edit_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); // give time for actions to be @@ -2434,6 +2441,7 @@ pub fn send_cli_edit_action_with_line_number() { y: None, width: None, height: None, + pinned: None, }; send_cli_action_to_server(&session_metadata, cli_edit_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); // give time for actions to be @@ -2472,6 +2480,7 @@ pub fn send_cli_edit_action_with_split_direction() { y: None, width: None, height: None, + pinned: None, }; send_cli_action_to_server(&session_metadata, cli_edit_action, client_id); std::thread::sleep(std::time::Duration::from_millis(100)); // give time for actions to be diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab-2.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab-2.snap index e5dd722dbc..c4170f548e 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab-2.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab-2.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 3374 +assertion_line: 3395 expression: "format!(\"{}\", snapshot)" --- 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ @@ -8,7 +8,7 @@ expression: "format!(\"{}\", snapshot)" 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ floating_pane_to_eject ──────────────┐ │ +05 (C): │ ┌ floating_pane_to_eject ───── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab-4.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab-4.snap index e5dd722dbc..c4170f548e 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab-4.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab-4.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 3374 +assertion_line: 3395 expression: "format!(\"{}\", snapshot)" --- 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ @@ -8,7 +8,7 @@ expression: "format!(\"{}\", snapshot)" 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ floating_pane_to_eject ──────────────┐ │ +05 (C): │ ┌ floating_pane_to_eject ───── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab.snap index 8460af7b0b..a87d458831 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__screen_can_break_floating_pane_to_a_new_tab.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 2849 +assertion_line: 3395 expression: "format!(\"{}\", snapshot)" --- 00 (C): ┌ tiled_pane ──────────────────────────────────────────────────────────────────┐ @@ -8,7 +8,7 @@ expression: "format!(\"{}\", snapshot)" 02 (C): │ │ 03 (C): │ │ 04 (C): │ │ -05 (C): │ ┌ floating_pane_to_eject ──────────────┐ │ +05 (C): │ ┌ floating_pane_to_eject ───── PIN [ ] ┐ │ 06 (C): │ │ │ │ 07 (C): │ │ │ │ 08 (C): │ │ │ │ diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_floating_pane_and_coordinates.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_floating_pane_and_coordinates.snap index be12965c31..06cf752bc8 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_floating_pane_and_coordinates.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_floating_pane_and_coordinates.snap @@ -1,6 +1,6 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 2351 +assertion_line: 2371 expression: "format!(\"{:?}\", * received_pty_instructions.lock().unwrap())" --- -[SpawnTerminal(Some(RunCommand(RunCommand { command: "htop", args: [], cwd: Some("/some/folder"), hold_on_close: true, hold_on_start: false, originating_plugin: None })), Some(true), None, Some(FloatingPaneCoordinates { x: Some(Fixed(10)), y: None, width: Some(Percent(20)), height: None }), false, ClientId(10)), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] +[SpawnTerminal(Some(RunCommand(RunCommand { command: "htop", args: [], cwd: Some("/some/folder"), hold_on_close: true, hold_on_start: false, originating_plugin: None })), Some(true), None, Some(FloatingPaneCoordinates { x: Some(Fixed(10)), y: None, width: Some(Percent(20)), height: None, pinned: None }), false, ClientId(10)), UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), Exit] diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_floating_panes-2.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_floating_panes-2.snap index e9727e3952..0eaddd5774 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_floating_panes-2.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_floating_panes-2.snap @@ -1,12 +1,12 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 2186 +assertion_line: 2609 expression: "format!(\"{}\", snapshot)" --- 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ -03 (C): │ ┌ Pane #1 ─────────────────────────────┐ │ +03 (C): │ ┌ Pane #1 ──────────────────── PIN [ ] ┐ │ 04 (C): │ │ │ │ 05 (C): │ │ │ │ 06 (C): │ │ │ │ diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_floating_panes-4.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_floating_panes-4.snap index e9727e3952..0eaddd5774 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_floating_panes-4.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_floating_panes-4.snap @@ -1,12 +1,12 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 2186 +assertion_line: 2609 expression: "format!(\"{}\", snapshot)" --- 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ -03 (C): │ ┌ Pane #1 ─────────────────────────────┐ │ +03 (C): │ ┌ Pane #1 ──────────────────── PIN [ ] ┐ │ 04 (C): │ │ │ │ 05 (C): │ │ │ │ 06 (C): │ │ │ │ diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_pane_embed_or_float-2.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_pane_embed_or_float-2.snap index a6119cc824..ca19a162a7 100644 --- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_pane_embed_or_float-2.snap +++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_toggle_pane_embed_or_float-2.snap @@ -1,12 +1,12 @@ --- source: zellij-server/src/./unit/screen_tests.rs -assertion_line: 2131 +assertion_line: 2569 expression: "format!(\"{}\", snapshot)" --- 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ 01 (C): │ │ 02 (C): │ │ -03 (C): │ ┌ Pane #1 ─────────────────────────────┐ │ +03 (C): │ ┌ Pane #1 ──────────────────── PIN [ ] ┐ │ 04 (C): │ │ │ │ 05 (C): │ │ │ │ 06 (C): │ │ │ │ diff --git a/zellij-tile/src/shim.rs b/zellij-tile/src/shim.rs index 1e116f1315..7b33b8f923 100644 --- a/zellij-tile/src/shim.rs +++ b/zellij-tile/src/shim.rs @@ -1135,6 +1135,13 @@ pub fn change_host_folder(new_host_folder: PathBuf) { unsafe { host_run_plugin_command() }; } +pub fn set_floating_pane_pinned(pane_id: PaneId, should_be_pinned: bool) { + let plugin_command = PluginCommand::SetFloatingPanePinned(pane_id, should_be_pinned); + let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap(); + object_to_stdout(&protobuf_plugin_command.encode_to_vec()); + unsafe { host_run_plugin_command() }; +} + // Utility Functions #[allow(unused)] diff --git a/zellij-utils/assets/config/default.kdl b/zellij-utils/assets/config/default.kdl index e7dfcf5da9..15f1fd54a5 100644 --- a/zellij-utils/assets/config/default.kdl +++ b/zellij-utils/assets/config/default.kdl @@ -36,6 +36,7 @@ keybinds { bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; } bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; } bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;} + bind "i" { TogglePanePinned; SwitchToMode "Normal"; } } move { bind "Ctrl h" { SwitchToMode "Normal"; } diff --git a/zellij-utils/assets/prost/api.action.rs b/zellij-utils/assets/prost/api.action.rs index 651f59ebe7..87ca37dd4c 100644 --- a/zellij-utils/assets/prost/api.action.rs +++ b/zellij-utils/assets/prost/api.action.rs @@ -455,6 +455,7 @@ pub enum ActionName { CliPipe = 82, MoveTab = 83, KeybindPipe = 84, + TogglePanePinned = 85, } impl ActionName { /// String value of the enum field names used in the ProtoBuf definition. @@ -548,6 +549,7 @@ impl ActionName { ActionName::CliPipe => "CliPipe", ActionName::MoveTab => "MoveTab", ActionName::KeybindPipe => "KeybindPipe", + ActionName::TogglePanePinned => "TogglePanePinned", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -638,6 +640,7 @@ impl ActionName { "CliPipe" => Some(Self::CliPipe), "MoveTab" => Some(Self::MoveTab), "KeybindPipe" => Some(Self::KeybindPipe), + "TogglePanePinned" => Some(Self::TogglePanePinned), _ => None, } } diff --git a/zellij-utils/assets/prost/api.plugin_command.rs b/zellij-utils/assets/prost/api.plugin_command.rs index d4604c98f3..a023a68fa2 100644 --- a/zellij-utils/assets/prost/api.plugin_command.rs +++ b/zellij-utils/assets/prost/api.plugin_command.rs @@ -5,7 +5,7 @@ pub struct PluginCommand { pub name: i32, #[prost( oneof = "plugin_command::Payload", - tags = "2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89" + tags = "2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90" )] pub payload: ::core::option::Option, } @@ -176,10 +176,20 @@ pub mod plugin_command { RebindKeysPayload(super::RebindKeysPayload), #[prost(message, tag = "89")] ChangeHostFolderPayload(super::ChangeHostFolderPayload), + #[prost(message, tag = "90")] + SetFloatingPanePinnedPayload(super::SetFloatingPanePinnedPayload), } } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct SetFloatingPanePinnedPayload { + #[prost(message, optional, tag = "1")] + pub pane_id: ::core::option::Option, + #[prost(bool, tag = "2")] + pub should_be_pinned: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangeHostFolderPayload { #[prost(string, tag = "1")] pub new_host_folder: ::prost::alloc::string::String, @@ -598,6 +608,8 @@ pub struct FloatingPaneCoordinates { pub width: ::core::option::Option, #[prost(message, optional, tag = "4")] pub height: ::core::option::Option, + #[prost(bool, optional, tag = "5")] + pub pinned: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -725,6 +737,7 @@ pub enum CommandName { RebindKeys = 112, ListClients = 113, ChangeHostFolder = 114, + SetFloatingPanePinned = 115, } impl CommandName { /// String value of the enum field names used in the ProtoBuf definition. @@ -850,6 +863,7 @@ impl CommandName { CommandName::RebindKeys => "RebindKeys", CommandName::ListClients => "ListClients", CommandName::ChangeHostFolder => "ChangeHostFolder", + CommandName::SetFloatingPanePinned => "SetFloatingPanePinned", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -972,6 +986,7 @@ impl CommandName { "RebindKeys" => Some(Self::RebindKeys), "ListClients" => Some(Self::ListClients), "ChangeHostFolder" => Some(Self::ChangeHostFolder), + "SetFloatingPanePinned" => Some(Self::SetFloatingPanePinned), _ => None, } } diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs index 63348c4225..1577be7cd8 100644 --- a/zellij-utils/src/cli.rs +++ b/zellij-utils/src/cli.rs @@ -246,6 +246,9 @@ pub enum Sessions { /// The height if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(long, requires("floating"))] height: Option, + /// Whether to pin a floating pane so that it is always on top + #[clap(long, requires("floating"))] + pinned: Option, }, /// Load a plugin #[clap(visible_alias = "p")] @@ -288,6 +291,9 @@ pub enum Sessions { /// The height if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(long, requires("floating"))] height: Option, + /// Whether to pin a floating pane so that it is always on top + #[clap(long, requires("floating"))] + pinned: Option, }, /// Edit file with default $EDITOR / $VISUAL #[clap(visible_alias = "e")] @@ -333,6 +339,9 @@ pub enum Sessions { /// The height if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(long, requires("floating"))] height: Option, + /// Whether to pin a floating pane so that it is always on top + #[clap(long, requires("floating"))] + pinned: Option, }, ConvertConfig { old_config_file: PathBuf, @@ -526,6 +535,9 @@ pub enum CliAction { /// The height if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(long, requires("floating"))] height: Option, + /// Whether to pin a floating pane so that it is always on top + #[clap(long, requires("floating"))] + pinned: Option, }, /// Open the specified file in a new zellij pane with your default EDITOR Edit { @@ -570,6 +582,9 @@ pub enum CliAction { /// The height if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(long, requires("floating"))] height: Option, + /// Whether to pin a floating pane so that it is always on top + #[clap(long, requires("floating"))] + pinned: Option, }, /// Switch input mode of all connected clients [locked|pane|tab|resize|move|search|session] SwitchMode { @@ -744,4 +759,5 @@ tail -f /tmp/my-live-logfile | zellij action pipe --name logs --plugin https://e plugin_title: Option, }, ListClients, + TogglePanePinned, } diff --git a/zellij-utils/src/data.rs b/zellij-utils/src/data.rs index 1d0da685e3..1f3adf305e 100644 --- a/zellij-utils/src/data.rs +++ b/zellij-utils/src/data.rs @@ -1661,6 +1661,7 @@ pub struct FloatingPaneCoordinates { pub y: Option, pub width: Option, pub height: Option, + pub pinned: Option, } impl FloatingPaneCoordinates { @@ -1669,12 +1670,13 @@ impl FloatingPaneCoordinates { y: Option, width: Option, height: Option, + pinned: Option, ) -> Option { let x = x.and_then(|x| SplitSize::from_str(&x).ok()); let y = y.and_then(|y| SplitSize::from_str(&y).ok()); let width = width.and_then(|width| SplitSize::from_str(&width).ok()); let height = height.and_then(|height| SplitSize::from_str(&height).ok()); - if x.is_none() && y.is_none() && width.is_none() && height.is_none() { + if x.is_none() && y.is_none() && width.is_none() && height.is_none() && pinned.is_none() { None } else { Some(FloatingPaneCoordinates { @@ -1682,6 +1684,7 @@ impl FloatingPaneCoordinates { y, width, height, + pinned, }) } } @@ -1898,4 +1901,5 @@ pub enum PluginCommand { }, ListClients, ChangeHostFolder(PathBuf), + SetFloatingPanePinned(PaneId, bool), // bool -> should be pinned } diff --git a/zellij-utils/src/errors.rs b/zellij-utils/src/errors.rs index ffabec2647..f27ee06cc2 100644 --- a/zellij-utils/src/errors.rs +++ b/zellij-utils/src/errors.rs @@ -373,6 +373,8 @@ pub enum ScreenContext { BreakPanesToNewTab, BreakPanesToTabWithIndex, ListClientsToPlugin, + TogglePanePinned, + SetFloatingPanePinned, } /// Stack call representations corresponding to the different types of [`PtyInstruction`]s. diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs index e19a067244..f6ecf09677 100644 --- a/zellij-utils/src/input/actions.rs +++ b/zellij-utils/src/input/actions.rs @@ -300,6 +300,7 @@ pub enum Action { pane_title: Option, }, ListClients, + TogglePanePinned, } impl Action { @@ -363,6 +364,7 @@ impl Action { y, width, height, + pinned, } => { let current_dir = get_current_dir(); // cwd should only be specified in a plugin alias if it was explicitly given to us, @@ -398,7 +400,7 @@ impl Action { name, skip_plugin_cache, cwd, - FloatingPaneCoordinates::new(x, y, width, height), + FloatingPaneCoordinates::new(x, y, width, height, pinned), )]) } else if in_place { Ok(vec![Action::NewInPlacePluginPane( @@ -440,7 +442,7 @@ impl Action { Ok(vec![Action::NewFloatingPane( Some(run_command_action), name, - FloatingPaneCoordinates::new(x, y, width, height), + FloatingPaneCoordinates::new(x, y, width, height, pinned), )]) } else if in_place { Ok(vec![Action::NewInPlacePane(Some(run_command_action), name)]) @@ -456,7 +458,7 @@ impl Action { Ok(vec![Action::NewFloatingPane( None, name, - FloatingPaneCoordinates::new(x, y, width, height), + FloatingPaneCoordinates::new(x, y, width, height, pinned), )]) } else if in_place { Ok(vec![Action::NewInPlacePane(None, name)]) @@ -476,6 +478,7 @@ impl Action { y, width, height, + pinned, } => { let mut file = file; let current_dir = get_current_dir(); @@ -494,7 +497,7 @@ impl Action { floating, in_place, start_suppressed, - FloatingPaneCoordinates::new(x, y, width, height), + FloatingPaneCoordinates::new(x, y, width, height, pinned), )]) }, CliAction::SwitchMode { input_mode } => { @@ -738,6 +741,7 @@ impl Action { }]) }, CliAction::ListClients => Ok(vec![Action::ListClients]), + CliAction::TogglePanePinned => Ok(vec![Action::TogglePanePinned]), } } pub fn launches_plugin(&self, plugin_url: &str) -> bool { diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs index d4d8b261a5..33c8a7c131 100644 --- a/zellij-utils/src/input/layout.rs +++ b/zellij-utils/src/input/layout.rs @@ -738,6 +738,7 @@ pub struct FloatingPaneLayout { pub width: Option, pub x: Option, pub y: Option, + pub pinned: Option, pub run: Option, pub focus: Option, pub already_running: bool, @@ -752,6 +753,7 @@ impl FloatingPaneLayout { width: None, x: None, y: None, + pinned: None, run: None, focus: None, already_running: false, @@ -1697,6 +1699,7 @@ fn split_space( cols: split_dimension, rows: inherited_dimension, is_stacked: layout.children_are_stacked, + is_pinned: false, }, SplitDirection::Horizontal => PaneGeom { x: space_to_split.x, @@ -1704,6 +1707,7 @@ fn split_space( cols: inherited_dimension, rows: split_dimension, is_stacked: layout.children_are_stacked, + is_pinned: false, }, }; split_geom.push(geom); diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tabs_and_floating_panes.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tabs_and_floating_panes.snap index 6981d9d7d0..69d57c3037 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tabs_and_floating_panes.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__layout_with_tabs_and_floating_panes.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 275 +assertion_line: 305 expression: "format!(\"{:#?}\", layout)" --- Layout { @@ -47,6 +47,7 @@ Layout { width: None, x: None, y: None, + pinned: None, run: None, focus: None, already_running: false, @@ -96,6 +97,7 @@ Layout { width: None, x: None, y: None, + pinned: None, run: None, focus: None, already_running: false, @@ -107,6 +109,7 @@ Layout { width: None, x: None, y: None, + pinned: None, run: None, focus: None, already_running: false, diff --git a/zellij-utils/src/kdl/kdl_layout_parser.rs b/zellij-utils/src/kdl/kdl_layout_parser.rs index 81e97a7e23..c38c0146f7 100644 --- a/zellij-utils/src/kdl/kdl_layout_parser.rs +++ b/zellij-utils/src/kdl/kdl_layout_parser.rs @@ -122,6 +122,7 @@ impl<'a> KdlLayoutParser<'a> { || property_name == "y" || property_name == "width" || property_name == "height" + || property_name == "pinned" || property_name == "contents_file" } fn is_a_valid_tab_property(&self, property_name: &str) -> bool { @@ -596,6 +597,7 @@ impl<'a> KdlLayoutParser<'a> { let width = self.parse_percent_or_fixed(kdl_node, "width", false)?; let x = self.parse_percent_or_fixed(kdl_node, "x", true)?; let y = self.parse_percent_or_fixed(kdl_node, "y", true)?; + let pinned = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "pinned"); let run = self.parse_command_plugin_or_edit_block(kdl_node)?; let focus = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "focus"); let name = kdl_get_string_property_or_child_value_with_error!(kdl_node, "name") @@ -619,6 +621,7 @@ impl<'a> KdlLayoutParser<'a> { y, run, focus, + pinned, pane_initial_contents, ..Default::default() }) @@ -845,7 +848,7 @@ impl<'a> KdlLayoutParser<'a> { let width = self.parse_percent_or_fixed(kdl_node, "width", false)?; let x = self.parse_percent_or_fixed(kdl_node, "x", true)?; let y = self.parse_percent_or_fixed(kdl_node, "y", true)?; - // let mut floating_pane = FloatingPaneLayout::from(&pane_template); + let pinned = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "pinned"); if let Some(height) = height { pane_template.height = Some(height); } @@ -858,6 +861,9 @@ impl<'a> KdlLayoutParser<'a> { if let Some(x) = x { pane_template.x = Some(x); } + if let Some(pinned) = pinned { + pane_template.pinned = Some(pinned); + } Ok(pane_template) }, PaneOrFloatingPane::Either(mut pane_template) => { @@ -896,6 +902,7 @@ impl<'a> KdlLayoutParser<'a> { let width = self.parse_percent_or_fixed(kdl_node, "width", false)?; let x = self.parse_percent_or_fixed(kdl_node, "x", true)?; let y = self.parse_percent_or_fixed(kdl_node, "y", true)?; + let pinned = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "pinned"); let mut floating_pane = FloatingPaneLayout::from(&pane_template); if let Some(height) = height { floating_pane.height = Some(height); @@ -909,6 +916,9 @@ impl<'a> KdlLayoutParser<'a> { if let Some(x) = x { floating_pane.x = Some(x); } + if let Some(pinned) = pinned { + floating_pane.pinned = Some(pinned); + } Ok(floating_pane) }, } @@ -948,6 +958,7 @@ impl<'a> KdlLayoutParser<'a> { let width = self.parse_percent_or_fixed(kdl_node, "width", false)?; let x = self.parse_percent_or_fixed(kdl_node, "x", true)?; let y = self.parse_percent_or_fixed(kdl_node, "y", true)?; + let pinned = kdl_get_string_property_or_child_value_with_error!(kdl_node, "pinned"); let has_pane_properties = borderless.is_some() || split_size.is_some() @@ -956,7 +967,7 @@ impl<'a> KdlLayoutParser<'a> { || is_expanded_in_stack.is_some() || has_children_nodes; let has_floating_pane_properties = - height.is_some() || width.is_some() || x.is_some() || y.is_some(); + height.is_some() || width.is_some() || x.is_some() || y.is_some() || pinned.is_some(); if has_pane_properties || has_floating_pane_properties { Ok(false) } else { @@ -985,6 +996,7 @@ impl<'a> KdlLayoutParser<'a> { let width = self.parse_percent_or_fixed(kdl_node, "width", false)?; let x = self.parse_percent_or_fixed(kdl_node, "x", true)?; let y = self.parse_percent_or_fixed(kdl_node, "y", true)?; + let pinned = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "pinned"); let has_pane_properties = borderless.is_some() || split_size.is_some() @@ -993,7 +1005,7 @@ impl<'a> KdlLayoutParser<'a> { || is_expanded_in_stack.is_some() || has_children_nodes; let has_floating_pane_properties = - height.is_some() || width.is_some() || x.is_some() || y.is_some(); + height.is_some() || width.is_some() || x.is_some() || y.is_some() || pinned.is_some(); if has_pane_properties && has_floating_pane_properties { let mut pane_properties = vec![]; @@ -1028,6 +1040,9 @@ impl<'a> KdlLayoutParser<'a> { if y.is_some() { floating_pane_properties.push("y"); } + if pinned.is_some() { + floating_pane_properties.push("pinned"); + } Err(ConfigError::new_layout_kdl_error( format!( "A pane_template cannot have both pane ({}) and floating pane ({}) properties", @@ -1079,6 +1094,7 @@ impl<'a> KdlLayoutParser<'a> { let width = self.parse_percent_or_fixed(kdl_node, "width", false)?; let x = self.parse_percent_or_fixed(kdl_node, "x", true)?; let y = self.parse_percent_or_fixed(kdl_node, "y", true)?; + let pinned = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "pinned"); self.pane_templates.insert( template_name, ( @@ -1089,6 +1105,7 @@ impl<'a> KdlLayoutParser<'a> { width, x, y, + pinned, ..Default::default() }), kdl_node.clone(), diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs index e3726173db..37f36fd8a5 100644 --- a/zellij-utils/src/kdl/mod.rs +++ b/zellij-utils/src/kdl/mod.rs @@ -1101,6 +1101,7 @@ impl Action { } Some(node) }, + Action::TogglePanePinned => Some(KdlNode::new("TogglePanePinned")), _ => None, } } @@ -1537,11 +1538,13 @@ impl TryFrom<(&KdlNode, &Options)> for Action { let height = command_metadata .and_then(|c_m| kdl_child_string_value_for_entry(c_m, "height")) .map(|s| s.to_owned()); + let pinned = + command_metadata.and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "pinned")); if floating { Ok(Action::NewFloatingPane( Some(run_command_action), name, - FloatingPaneCoordinates::new(x, y, width, height), + FloatingPaneCoordinates::new(x, y, width, height, pinned), )) } else if in_place { Ok(Action::NewInPlacePane(Some(run_command_action), name)) @@ -1758,6 +1761,7 @@ impl TryFrom<(&KdlNode, &Options)> for Action { plugin_id, }) }, + "TogglePanePinned" => Ok(Action::TogglePanePinned), _ => Err(ConfigError::new_kdl_error( format!("Unsupported action: {}", action_name).into(), kdl_action.span().offset(), diff --git a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string.snap b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string.snap index 6a709ef984..bcd3ac0e79 100644 --- a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string.snap +++ b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__bare_config_from_default_assets_to_string.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/kdl/mod.rs -assertion_line: 5535 +assertion_line: 5551 expression: fake_config_stringified --- keybinds clear-defaults=true { @@ -17,6 +17,7 @@ keybinds clear-defaults=true { bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "normal"; } bind "f" { ToggleFocusFullscreen; SwitchToMode "normal"; } bind "h" { MoveFocus "left"; } + bind "i" { TogglePanePinned; SwitchToMode "normal"; } bind "j" { MoveFocus "down"; } bind "k" { MoveFocus "up"; } bind "l" { MoveFocus "right"; } 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 b4bbbefe3e..f31c73d3c4 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,6 +1,6 @@ --- source: zellij-utils/src/kdl/mod.rs -assertion_line: 5547 +assertion_line: 5563 expression: fake_config_stringified --- keybinds clear-defaults=true { @@ -17,6 +17,7 @@ keybinds clear-defaults=true { bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "normal"; } bind "f" { ToggleFocusFullscreen; SwitchToMode "normal"; } bind "h" { MoveFocus "left"; } + bind "i" { TogglePanePinned; SwitchToMode "normal"; } bind "j" { MoveFocus "down"; } bind "k" { MoveFocus "up"; } bind "l" { MoveFocus "right"; } diff --git a/zellij-utils/src/pane_size.rs b/zellij-utils/src/pane_size.rs index fe56e720e2..aa258fd94c 100644 --- a/zellij-utils/src/pane_size.rs +++ b/zellij-utils/src/pane_size.rs @@ -10,15 +10,30 @@ use crate::position::Position; /// Contains the position and size of a [`Pane`], or more generally of any terminal, measured /// in character rows and columns. -#[derive(Clone, Copy, Default, PartialEq, Debug, Serialize, Deserialize, Eq, Hash)] +#[derive(Clone, Copy, Default, Debug, Serialize, Deserialize, Hash)] pub struct PaneGeom { pub x: usize, pub y: usize, pub rows: Dimension, pub cols: Dimension, pub is_stacked: bool, + pub is_pinned: bool, // only relevant to floating panes } +impl PartialEq for PaneGeom { + fn eq(&self, other: &Self) -> bool { + // compare all except is_pinned + // TODO: add is_stacked? + self.x == other.x + && self.y == other.y + && self.rows == other.rows + && self.cols == other.cols + && self.is_stacked == other.is_stacked + } +} + +impl Eq for PaneGeom {} + #[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, PartialEq, Eq)] pub struct Viewport { pub x: usize, diff --git a/zellij-utils/src/plugin_api/action.proto b/zellij-utils/src/plugin_api/action.proto index d78d5e6956..df7f3b05b7 100644 --- a/zellij-utils/src/plugin_api/action.proto +++ b/zellij-utils/src/plugin_api/action.proto @@ -244,6 +244,7 @@ enum ActionName { CliPipe = 82; MoveTab = 83; KeybindPipe = 84; + TogglePanePinned = 85; } message Position { diff --git a/zellij-utils/src/plugin_api/action.rs b/zellij-utils/src/plugin_api/action.rs index 9bb8ac7a8e..9638543361 100644 --- a/zellij-utils/src/plugin_api/action.rs +++ b/zellij-utils/src/plugin_api/action.rs @@ -688,6 +688,10 @@ impl TryFrom for Action { }, _ => Err("Wrong payload for Action::RenameSession"), }, + Some(ProtobufActionName::TogglePanePinned) => match protobuf_action.optional_payload { + Some(_) => Err("TogglePanePinned should not have a payload"), + None => Ok(Action::TogglePanePinned), + }, Some(ProtobufActionName::KeybindPipe) => match protobuf_action.optional_payload { Some(_) => Err("KeybindPipe should not have a payload"), // TODO: at some point we might want to support a payload here @@ -1284,6 +1288,10 @@ impl TryFrom for ProtobufAction { name: ProtobufActionName::KeybindPipe as i32, optional_payload: None, }), + Action::TogglePanePinned { .. } => Ok(ProtobufAction { + name: ProtobufActionName::TogglePanePinned as i32, + optional_payload: None, + }), Action::NoOp | Action::Confirm | Action::NewInPlacePane(..) diff --git a/zellij-utils/src/plugin_api/plugin_command.proto b/zellij-utils/src/plugin_api/plugin_command.proto index 4cc5c10c8e..14e8a28649 100644 --- a/zellij-utils/src/plugin_api/plugin_command.proto +++ b/zellij-utils/src/plugin_api/plugin_command.proto @@ -128,6 +128,7 @@ enum CommandName { RebindKeys = 112; ListClients = 113; ChangeHostFolder = 114; + SetFloatingPanePinned = 115; } message PluginCommand { @@ -212,9 +213,15 @@ message PluginCommand { LoadNewPluginPayload load_new_plugin_payload = 87; RebindKeysPayload rebind_keys_payload = 88; ChangeHostFolderPayload change_host_folder_payload = 89; + SetFloatingPanePinnedPayload set_floating_pane_pinned_payload = 90; } } +message SetFloatingPanePinnedPayload { + PaneId pane_id = 1; + bool should_be_pinned = 2; +} + message ChangeHostFolderPayload { string new_host_folder = 1; } @@ -485,6 +492,7 @@ message FloatingPaneCoordinates { optional FixedOrPercentValue y = 2; optional FixedOrPercentValue width = 3; optional FixedOrPercentValue height = 4; + optional bool pinned = 5; } message FixedOrPercentValue { diff --git a/zellij-utils/src/plugin_api/plugin_command.rs b/zellij-utils/src/plugin_api/plugin_command.rs index 4317a02e97..9d92f2607b 100644 --- a/zellij-utils/src/plugin_api/plugin_command.rs +++ b/zellij-utils/src/plugin_api/plugin_command.rs @@ -18,10 +18,10 @@ pub use super::generated_api::api::{ RebindKeysPayload, ReconfigurePayload, ReloadPluginPayload, RequestPluginPermissionPayload, RerunCommandPanePayload, ResizePaneIdWithDirectionPayload, ResizePayload, RunCommandPayload, ScrollDownInPaneIdPayload, ScrollToBottomInPaneIdPayload, - ScrollToTopInPaneIdPayload, ScrollUpInPaneIdPayload, SetTimeoutPayload, - ShowPaneWithIdPayload, SubscribePayload, SwitchSessionPayload, SwitchTabToPayload, - TogglePaneEmbedOrEjectForPaneIdPayload, TogglePaneIdFullscreenPayload, UnsubscribePayload, - WebRequestPayload, WriteCharsToPaneIdPayload, WriteToPaneIdPayload, + ScrollToTopInPaneIdPayload, ScrollUpInPaneIdPayload, SetFloatingPanePinnedPayload, + SetTimeoutPayload, ShowPaneWithIdPayload, SubscribePayload, SwitchSessionPayload, + SwitchTabToPayload, TogglePaneEmbedOrEjectForPaneIdPayload, TogglePaneIdFullscreenPayload, + UnsubscribePayload, WebRequestPayload, WriteCharsToPaneIdPayload, WriteToPaneIdPayload, }, plugin_permission::PermissionType as ProtobufPermissionType, resize::ResizeAction as ProtobufResizeAction, @@ -81,6 +81,7 @@ impl Into for ProtobufFloatingPaneCoordinates { None => None, } }), + pinned: self.pinned, } } } @@ -132,6 +133,7 @@ impl Into for FloatingPaneCoordinates { }), None => None, }, + pinned: self.pinned, } } } @@ -1311,6 +1313,21 @@ impl TryFrom for PluginCommand { }, _ => Err("Mismatched payload for ChangeHostFolder"), }, + Some(CommandName::SetFloatingPanePinned) => match protobuf_plugin_command.payload { + Some(Payload::SetFloatingPanePinnedPayload(set_floating_pane_pinned_payload)) => { + match set_floating_pane_pinned_payload + .pane_id + .and_then(|p| p.try_into().ok()) + { + Some(pane_id) => Ok(PluginCommand::SetFloatingPanePinned( + pane_id, + set_floating_pane_pinned_payload.should_be_pinned, + )), + None => Err("PaneId not found!"), + } + }, + _ => Err("Mismatched payload for SetFloatingPanePinned"), + }, None => Err("Unrecognized plugin command"), } } @@ -2144,6 +2161,17 @@ impl TryFrom for ProtobufPluginCommand { new_host_folder: new_host_folder.display().to_string(), // TODO: not accurate? })), }), + PluginCommand::SetFloatingPanePinned(pane_id, should_be_pinned) => { + Ok(ProtobufPluginCommand { + name: CommandName::SetFloatingPanePinned as i32, + payload: Some(Payload::SetFloatingPanePinnedPayload( + SetFloatingPanePinnedPayload { + pane_id: pane_id.try_into().ok(), + should_be_pinned, + }, + )), + }) + }, } } } diff --git a/zellij-utils/src/session_serialization.rs b/zellij-utils/src/session_serialization.rs index 68a9c2dae0..3cb7c5ebed 100644 --- a/zellij-utils/src/session_serialization.rs +++ b/zellij-utils/src/session_serialization.rs @@ -453,6 +453,14 @@ fn serialize_floating_layout_attributes( }, None => {}, } + match layout.pinned { + Some(true) => { + let mut node = KdlNode::new("pinned"); + node.entries_mut().push(KdlEntry::new(KdlValue::Bool(true))); + pane_node_children.nodes_mut().push(node); + }, + _ => {}, + } } fn serialize_start_suspended(command: &Option, pane_node_children: &mut KdlDocument) { @@ -774,6 +782,7 @@ fn get_floating_panes_layout_from_panegeoms( width: Some(m.geom.cols.into()), x: Some(PercentOrFixed::Fixed(m.geom.x)), y: Some(PercentOrFixed::Fixed(m.geom.y)), + pinned: Some(m.geom.is_pinned), run, focus: Some(m.is_focused), already_running: false, @@ -1275,6 +1284,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1286,6 +1296,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1301,6 +1312,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1315,6 +1327,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1334,6 +1347,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1347,6 +1361,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1362,6 +1377,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1373,6 +1389,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1386,6 +1403,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1415,6 +1433,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1426,6 +1445,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1441,6 +1461,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1455,6 +1476,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1474,6 +1496,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1487,6 +1510,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1502,6 +1526,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1515,6 +1540,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1528,6 +1554,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1555,6 +1582,7 @@ mod tests { rows: Dimension::fixed(1), cols: Dimension::fixed(10), is_stacked: true, + is_pinned: false, }, ..Default::default() }, @@ -1565,6 +1593,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: true, + is_pinned: false, }, ..Default::default() }, @@ -1575,6 +1604,7 @@ mod tests { rows: Dimension::fixed(1), cols: Dimension::fixed(10), is_stacked: true, + is_pinned: false, }, ..Default::default() }, @@ -1598,6 +1628,7 @@ mod tests { rows: Dimension::percent(100.0), cols: Dimension::percent(100.0), is_stacked: false, + is_pinned: false, }, ..Default::default() }], @@ -1612,6 +1643,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1622,6 +1654,7 @@ mod tests { rows: Dimension::fixed(10), cols: Dimension::fixed(10), is_stacked: false, + is_pinned: false, }, ..Default::default() }, @@ -1753,6 +1786,7 @@ mod tests { rows: get_dim(&data["rows"]), cols: get_dim(&data["cols"]), is_stacked: data["is_stacked"].to_string().parse().unwrap(), + is_pinned: false, } } diff --git a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments-2.snap b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments-2.snap index 8f85ae3e38..4c124f2790 100644 --- a/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments-2.snap +++ b/zellij-utils/src/snapshots/zellij_utils__setup__setup_test__default_config_with_no_cli_arguments-2.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 740 +assertion_line: 756 expression: "format!(\"{:#?}\", layout)" --- Layout { @@ -1676,6 +1676,7 @@ Layout { 1, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1703,6 +1704,7 @@ Layout { 2, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1730,6 +1732,7 @@ Layout { 3, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1757,6 +1760,7 @@ Layout { 4, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1784,6 +1788,7 @@ Layout { 5, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1811,6 +1816,7 @@ Layout { 6, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1838,6 +1844,7 @@ Layout { 7, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1865,6 +1872,7 @@ Layout { 8, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1892,6 +1900,7 @@ Layout { 9, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1919,6 +1928,7 @@ Layout { 10, ), ), + pinned: None, run: None, focus: Some( true, @@ -1951,6 +1961,7 @@ Layout { 50, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -1978,6 +1989,7 @@ Layout { 25, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -2001,6 +2013,7 @@ Layout { 25, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -2028,6 +2041,7 @@ Layout { 55, ), ), + pinned: None, run: None, focus: Some( true, @@ -2053,6 +2067,7 @@ Layout { 1, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -2076,6 +2091,7 @@ Layout { 1, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -2107,6 +2123,7 @@ Layout { 55, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -2134,6 +2151,7 @@ Layout { 55, ), ), + pinned: None, run: None, focus: Some( true, @@ -2163,6 +2181,7 @@ Layout { 1, ), ), + pinned: None, run: None, focus: None, already_running: false, @@ -2190,6 +2209,7 @@ Layout { 1, ), ), + pinned: None, run: None, focus: None, already_running: false, 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 81ca089c87..754375a862 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 @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 754 +assertion_line: 755 expression: "format!(\"{:#?}\", config)" --- Config { @@ -1076,6 +1076,17 @@ Config { Left, ), ], + KeyWithModifier { + bare_key: Char( + 'i', + ), + key_modifiers: {}, + }: [ + TogglePanePinned, + SwitchToMode( + Normal, + ), + ], KeyWithModifier { bare_key: Char( 'i', 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 8e9c8db391..4e79b783f5 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 @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 812 +assertion_line: 813 expression: "format!(\"{:#?}\", config)" --- Config { @@ -1076,6 +1076,17 @@ Config { Left, ), ], + KeyWithModifier { + bare_key: Char( + 'i', + ), + key_modifiers: {}, + }: [ + TogglePanePinned, + SwitchToMode( + Normal, + ), + ], KeyWithModifier { bare_key: Char( 'i', 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 ee9f43544f..6c435fa0d1 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 @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 840 +assertion_line: 841 expression: "format!(\"{:#?}\", config)" --- Config { @@ -1076,6 +1076,17 @@ Config { Left, ), ], + KeyWithModifier { + bare_key: Char( + 'i', + ), + key_modifiers: {}, + }: [ + TogglePanePinned, + SwitchToMode( + Normal, + ), + ], KeyWithModifier { bare_key: Char( 'i', 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 b380f31e92..5712f84705 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 @@ -1,6 +1,6 @@ --- source: zellij-utils/src/setup.rs -assertion_line: 826 +assertion_line: 827 expression: "format!(\"{:#?}\", config)" --- Config { @@ -1076,6 +1076,17 @@ Config { Left, ), ], + KeyWithModifier { + bare_key: Char( + 'i', + ), + key_modifiers: {}, + }: [ + TogglePanePinned, + SwitchToMode( + Normal, + ), + ], KeyWithModifier { bare_key: Char( 'i',