aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-server
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-02-10 10:42:46 +0100
committerGitHub <noreply@github.com>2026-02-10 10:42:46 +0100
commit860e8e323a0d9b94280e1e25d0c626ff5bc03687 (patch)
tree53b7bdccd075f93e93a7d93d8bb79878061aa000 /zellij-server
parentchore: Fix the issue template to match existing labels (#4637) (diff)
downloadsl0ppij-860e8e323a0d9b94280e1e25d0c626ff5bc03687.tar.gz
sl0ppij-860e8e323a0d9b94280e1e25d0c626ff5bc03687.tar.xz
sl0ppij-860e8e323a0d9b94280e1e25d0c626ff5bc03687.zip
Improve plugin API ergonomics and add CLI goodies (#4690)
* return created tab_id from relevant plugin API methods * add to cli * return Option<PaneId> in plugin API methods that create panes * return created pane_id in cli for relevant actions * allow plugins to query for pane_info based on pane_id * allow plugins to query for TabInfo by its id * allow plugins to query pane command/cwd synchronously * zellij action list-panes * style and formatting * fix e2e tests * add pr
Diffstat (limited to 'zellij-server')
-rw-r--r--zellij-server/src/panes/terminal_pane.rs9
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_new_tab_plugin_command.snap9
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_tab_with_index_plugin_command.snap10
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__clear_screen_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focus_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focused_tab_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_plugin_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_terminal_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__detach_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_layout_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_scrollback_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_next_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_or_create_tab_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_plugin_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_previous_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_terminal_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_next_tab_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_previous_tab_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab_name_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_or_tab_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_with_direction_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tab_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command-2.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__next_swap_layout_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_background_plugin_command.snap10
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_floating_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_floating_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_floating_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_floating_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__override_layout_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_down_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_up_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__previous_swap_layout_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__quit_zellij_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_plugin_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_tab_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_terminal_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_with_direction_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__run_action_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_down_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_bottom_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_top_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_up_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__send_configuration_to_plugins.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__show_self_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__start_or_reload_plugin.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_and_cwd_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_to_mode_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_active_tab_sync_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_focus_fullscreen_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_embed_or_eject_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_frames_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_tab_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_pane_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_tab_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_chars_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_plugin_command.snap1
-rw-r--r--zellij-server/src/plugins/zellij_exports.rs652
-rw-r--r--zellij-server/src/pty.rs101
-rw-r--r--zellij-server/src/route.rs415
-rw-r--r--zellij-server/src/screen.rs189
-rw-r--r--zellij-server/src/tab/mod.rs38
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_default_parameters.snap2
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_line_number.snap2
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_split_direction.snap2
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_launch_or_focus_plugin_action.snap1
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_command_and_cwd.snap2
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_default_parameters.snap2
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_floating_pane_and_coordinates.snap2
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_split_direction.snap2
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_tab_action_with_name_and_layout.snap1
-rw-r--r--zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_query_tab_names_action.snap1
83 files changed, 1449 insertions, 65 deletions
diff --git a/zellij-server/src/panes/terminal_pane.rs b/zellij-server/src/panes/terminal_pane.rs
index 2b1708fe..37a01678 100644
--- a/zellij-server/src/panes/terminal_pane.rs
+++ b/zellij-server/src/panes/terminal_pane.rs
@@ -110,6 +110,15 @@ impl Into<ZellijUtilsPaneId> for PaneId {
}
}
+impl std::fmt::Display for PaneId {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ match self {
+ PaneId::Terminal(id) => write!(f, "terminal_{}", id),
+ PaneId::Plugin(id) => write!(f, "plugin_{}", id),
+ }
+ }
+}
+
type IsFirstRun = bool;
// FIXME: This should hold an os_api handle so that terminal panes can set their own size via FD in
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_new_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_new_tab_plugin_command.snap
index e46ea1bb..59cf66f3 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_new_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_new_tab_plugin_command.snap
@@ -30,5 +30,14 @@ Some(
"new_tab_name",
),
client_id: 1,
+ completion_tx: Some(
+ NotificationEnd {
+ channel: None,
+ exit_status: None,
+ unblock_condition: None,
+ affected_pane_id: None,
+ affected_tab_id: None,
+ },
+ ),
},
)
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_tab_with_index_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_tab_with_index_plugin_command.snap
index 2ebd70fc..c51575ed 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_tab_with_index_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_tab_with_index_plugin_command.snap
@@ -1,6 +1,5 @@
---
source: zellij-server/src/plugins/./unit/plugin_tests.rs
-assertion_line: 8317
expression: "format!(\"{:#?}\", screen_instruction)"
---
Some(
@@ -16,5 +15,14 @@ Some(
tab_index: 2,
should_change_focus_to_new_tab: true,
client_id: 1,
+ completion_tx: Some(
+ NotificationEnd {
+ channel: None,
+ exit_status: None,
+ unblock_condition: None,
+ affected_pane_id: None,
+ affected_tab_id: None,
+ },
+ ),
},
)
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__clear_screen_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__clear_screen_plugin_command.snap
index 88023c4b..f376f4e6 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__clear_screen_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__clear_screen_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focus_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focus_plugin_command.snap
index 38179b85..876de3d2 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focus_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focus_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focused_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focused_tab_plugin_command.snap
index d0312218..97528cac 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focused_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_focused_tab_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_plugin_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_plugin_pane_plugin_command.snap
index b795da46..f20b4c65 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_plugin_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_plugin_pane_plugin_command.snap
@@ -14,6 +14,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
None,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_terminal_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_terminal_pane_plugin_command.snap
index 97e61a45..af53bf2a 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_terminal_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__close_terminal_pane_plugin_command.snap
@@ -14,6 +14,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
None,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__detach_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__detach_plugin_command.snap
index 1de9477d..b834fae6 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__detach_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__detach_plugin_command.snap
@@ -13,6 +13,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_layout_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_layout_plugin_command.snap
index 611f2015..fa22e69d 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_layout_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_layout_plugin_command.snap
@@ -39,6 +39,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_scrollback_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_scrollback_plugin_command.snap
index 370a7bbf..1b0575e2 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_scrollback_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__edit_scrollback_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_next_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_next_pane_plugin_command.snap
index 3ef17f9d..3a062e7c 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_next_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_next_pane_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_or_create_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_or_create_tab_plugin_command.snap
index fbd45fd0..b6056657 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_or_create_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_or_create_tab_plugin_command.snap
@@ -20,6 +20,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_plugin_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_plugin_pane_plugin_command.snap
index 31a63f73..946656ce 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_plugin_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_plugin_pane_plugin_command.snap
@@ -16,6 +16,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_previous_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_previous_pane_plugin_command.snap
index 8073ceb8..a3b89e0e 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_previous_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_previous_pane_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_terminal_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_terminal_pane_plugin_command.snap
index 0a3a1d23..2f9600c4 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_terminal_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__focus_terminal_pane_plugin_command.snap
@@ -16,6 +16,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_next_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_next_tab_plugin_command.snap
index c76a5ecc..7b12ea28 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_next_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_next_tab_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_previous_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_previous_tab_plugin_command.snap
index f4653b62..eb385864 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_previous_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_previous_tab_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab.snap
index 48cf0870..f730b254 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab.snap
@@ -14,6 +14,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab_name_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab_name_plugin_command.snap
index 7e45c1fc..75b5dd62 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab_name_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__go_to_tab_name_plugin_command.snap
@@ -20,6 +20,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_or_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_or_tab_plugin_command.snap
index 94419199..323dd29b 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_or_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_or_tab_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_plugin_command.snap
index f901ba75..43c28c07 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_focus_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_plugin_command.snap
index 1c2a8fc6..704220a8 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_with_direction_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_with_direction_plugin_command.snap
index 51f2cc15..9beccaf4 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_with_direction_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__move_pane_with_direction_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tab_plugin_command.snap
index 128c7abe..6f749f98 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tab_plugin_command.snap
@@ -30,6 +30,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command-2.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command-2.snap
index 9f02cee0..9811bdc4 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command-2.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command-2.snap
@@ -76,6 +76,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command.snap
index 3a910a7d..4e5fe5d2 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__new_tabs_with_layout_plugin_command.snap
@@ -76,6 +76,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__next_swap_layout_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__next_swap_layout_plugin_command.snap
index 87c3264c..3de5d347 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__next_swap_layout_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__next_swap_layout_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_background_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_background_plugin_command.snap
index 7c6f1dc1..47a7b8c1 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_background_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_background_plugin_command.snap
@@ -36,7 +36,15 @@ Some(
ClientId(
1,
),
- None,
+ Some(
+ NotificationEnd {
+ channel: None,
+ exit_status: None,
+ unblock_condition: None,
+ affected_pane_id: None,
+ affected_tab_id: None,
+ },
+ ),
false,
),
)
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_floating_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_floating_plugin_command.snap
index 3afcead6..023f92e8 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_floating_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_floating_plugin_command.snap
@@ -40,6 +40,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
false,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_plugin_command.snap
index 371851ab..6dc703be 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_plugin_command.snap
@@ -41,6 +41,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
false,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_floating_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_floating_plugin_command.snap
index be8503de..8b400575 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_floating_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_floating_plugin_command.snap
@@ -38,6 +38,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
false,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_plugin_command.snap
index f16526d0..66662754 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_plugin_command.snap
@@ -39,6 +39,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
false,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_floating_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_floating_plugin_command.snap
index fc2087d6..ac0cffca 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_floating_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_floating_plugin_command.snap
@@ -40,6 +40,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
false,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_plugin_command.snap
index 59970eee..16cb9276 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_file_with_line_plugin_command.snap
@@ -41,6 +41,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
false,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_floating_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_floating_plugin_command.snap
index b42943fc..f80864c1 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_floating_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_floating_plugin_command.snap
@@ -33,6 +33,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
false,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_plugin_command.snap
index 582c0aaf..a8b46d9e 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_plugin_command.snap
@@ -34,6 +34,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
false,
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__override_layout_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__override_layout_plugin_command.snap
index e1e5e906..21dc6fda 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__override_layout_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__override_layout_plugin_command.snap
@@ -2007,6 +2007,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_down_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_down_plugin_command.snap
index 5292281b..1d353741 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_down_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_down_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_up_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_up_plugin_command.snap
index 5709731c..f36650ad 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_up_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__page_scroll_up_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__previous_swap_layout_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__previous_swap_layout_plugin_command.snap
index 523e76fd..9c2e4f17 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__previous_swap_layout_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__previous_swap_layout_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__quit_zellij_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__quit_zellij_plugin_command.snap
index 5057701a..014f7cc4 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__quit_zellij_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__quit_zellij_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_plugin_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_plugin_pane_plugin_command.snap
index 119444e2..6baf42fb 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_plugin_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_plugin_pane_plugin_command.snap
@@ -35,6 +35,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_tab_plugin_command.snap
index 4846cd65..6d88c8d0 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_tab_plugin_command.snap
@@ -25,6 +25,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_terminal_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_terminal_pane_plugin_command.snap
index 53b81db8..4c7953f5 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_terminal_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__rename_terminal_pane_plugin_command.snap
@@ -37,6 +37,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_plugin_command.snap
index 0184c9a6..12b26384 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_plugin_command.snap
@@ -16,6 +16,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_with_direction_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_with_direction_plugin_command.snap
index 71766b1e..c933f52e 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_with_direction_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__resize_focused_pane_with_direction_plugin_command.snap
@@ -18,6 +18,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__run_action_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__run_action_plugin_command.snap
index dcbf7004..94413d72 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__run_action_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__run_action_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_down_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_down_plugin_command.snap
index 738a7625..cfb58f3f 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_down_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_down_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_bottom_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_bottom_plugin_command.snap
index 339ea8c4..b67d5e30 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_bottom_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_bottom_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_top_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_top_plugin_command.snap
index 5c0b9088..6c38598a 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_top_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_to_top_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_up_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_up_plugin_command.snap
index d0250b34..90f7008d 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_up_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__scroll_up_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__send_configuration_to_plugins.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__send_configuration_to_plugins.snap
index 14438cf8..5f65db08 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__send_configuration_to_plugins.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__send_configuration_to_plugins.snap
@@ -20,6 +20,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__show_self_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__show_self_plugin_command.snap
index 41396ddb..5971b313 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__show_self_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__show_self_plugin_command.snap
@@ -16,6 +16,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__start_or_reload_plugin.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__start_or_reload_plugin.snap
index 845f37ba..2f553d6c 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__start_or_reload_plugin.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__start_or_reload_plugin.snap
@@ -23,6 +23,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_plugin_command.snap
index be248484..5f9f524c 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_plugin_command.snap
@@ -22,6 +22,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_and_cwd_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_and_cwd_plugin_command.snap
index 4d7c327d..dd224994 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_and_cwd_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_and_cwd_plugin_command.snap
@@ -26,6 +26,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_plugin_command.snap
index 6520a806..cbd966d3 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_session_with_layout_plugin_command.snap
@@ -26,6 +26,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_to_mode_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_to_mode_plugin_command.snap
index b4ff3c00..3e1f9e71 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_to_mode_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__switch_to_mode_plugin_command.snap
@@ -332,6 +332,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_active_tab_sync_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_active_tab_sync_plugin_command.snap
index 06cde256..93ca8b8a 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_active_tab_sync_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_active_tab_sync_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_focus_fullscreen_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_focus_fullscreen_plugin_command.snap
index 44747b66..ec786521 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_focus_fullscreen_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_focus_fullscreen_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_embed_or_eject_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_embed_or_eject_plugin_command.snap
index 8e24bff8..c966e97a 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_embed_or_eject_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_embed_or_eject_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_frames_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_frames_plugin_command.snap
index c91f66aa..ad86b0d8 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_frames_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_pane_frames_plugin_command.snap
@@ -10,6 +10,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_tab_plugin_command.snap
index 32965d58..da58b12e 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__toggle_tab_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_pane_plugin_command.snap
index 99df8475..9218fe37 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_pane_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_pane_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_tab_plugin_command.snap
index 7836e7d2..41665cf2 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_tab_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__undo_rename_tab_plugin_command.snap
@@ -11,6 +11,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_chars_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_chars_plugin_command.snap
index abf3d1a2..78e0286e 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_chars_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_chars_plugin_command.snap
@@ -18,6 +18,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_plugin_command.snap
index abf3d1a2..78e0286e 100644
--- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_plugin_command.snap
+++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__write_plugin_command.snap
@@ -18,6 +18,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/plugins/zellij_exports.rs b/zellij-server/src/plugins/zellij_exports.rs
index 01a1738e..abc78254 100644
--- a/zellij-server/src/plugins/zellij_exports.rs
+++ b/zellij-server/src/plugins/zellij_exports.rs
@@ -21,11 +21,21 @@ use std::{
use tokio::sync::oneshot;
use wasmi::{Caller, Linker};
use zellij_utils::data::{
- CommandType, ConnectToSession, DeleteLayoutResponse, EditLayoutResponse, Event,
- FloatingPaneCoordinates, GetFocusedPaneInfoResponse, GetPanePidResponse, HttpVerb,
- KeyWithModifier, LayoutInfo, LayoutMetadata, LayoutParsingError, MessageToPlugin,
- NewPanePlacement, OriginatingPlugin, PaneScrollbackResponse, PermissionStatus, PermissionType,
- PluginPermission, RenameLayoutResponse, SaveLayoutResponse, TabMetadata,
+ BreakPanesToNewTabResponse, BreakPanesToTabWithIndexResponse, CommandType, ConnectToSession,
+ DeleteLayoutResponse, EditLayoutResponse, Event, FloatingPaneCoordinates,
+ FocusOrCreateTabResponse, GetFocusedPaneInfoResponse, GetPaneCwdResponse, GetPanePidResponse,
+ GetPaneRunningCommandResponse, HttpVerb, KeyWithModifier, LayoutInfo, LayoutMetadata,
+ LayoutParsingError, MessageToPlugin, NewPanePlacement, NewTabResponse, NewTabsResponse,
+ OpenCommandPaneBackgroundResponse, OpenCommandPaneFloatingNearPluginResponse,
+ OpenCommandPaneFloatingResponse, OpenCommandPaneInPlaceOfPluginResponse,
+ OpenCommandPaneInPlaceResponse, OpenCommandPaneNearPluginResponse, OpenCommandPaneResponse,
+ OpenFileFloatingNearPluginResponse, OpenFileFloatingResponse, OpenFileInPlaceOfPluginResponse,
+ OpenFileInPlaceResponse, OpenFileNearPluginResponse, OpenFileResponse,
+ OpenTerminalFloatingNearPluginResponse, OpenTerminalFloatingResponse,
+ OpenTerminalInPlaceOfPluginResponse, OpenTerminalInPlaceResponse,
+ OpenTerminalNearPluginResponse, OpenTerminalResponse, OriginatingPlugin,
+ PaneScrollbackResponse, PermissionStatus, PermissionType, PluginPermission,
+ RenameLayoutResponse, SaveLayoutResponse, TabMetadata,
};
use zellij_utils::home::default_layout_dir;
use zellij_utils::input::permission::PermissionCache;
@@ -62,12 +72,27 @@ use zellij_utils::{
},
plugin_command::{
dump_layout_response, dump_session_layout_response, parse_layout_response,
- save_session_response, ProtobufDeleteLayoutResponse, ProtobufDumpLayoutResponse,
- ProtobufDumpSessionLayoutResponse, ProtobufEditLayoutResponse,
+ save_session_response, ProtobufBreakPanesToNewTabResponse,
+ ProtobufBreakPanesToTabWithIndexResponse, ProtobufDeleteLayoutResponse,
+ ProtobufDumpLayoutResponse, ProtobufDumpSessionLayoutResponse,
+ ProtobufEditLayoutResponse, ProtobufFocusOrCreateTabResponse,
ProtobufGenerateRandomNameResponse, ProtobufGetFocusedPaneInfoResponse,
- ProtobufGetLayoutDirResponse, ProtobufGetPanePidResponse, ProtobufParseLayoutResponse,
- ProtobufPluginCommand, ProtobufRenameLayoutResponse, ProtobufSaveLayoutResponse,
- ProtobufSaveSessionResponse,
+ ProtobufGetLayoutDirResponse, ProtobufGetPaneCwdResponse, ProtobufGetPaneInfoResponse,
+ ProtobufGetPanePidResponse, ProtobufGetPaneRunningCommandResponse,
+ ProtobufGetTabInfoResponse, ProtobufNewTabResponse, ProtobufNewTabsResponse,
+ ProtobufOpenCommandPaneBackgroundResponse,
+ ProtobufOpenCommandPaneFloatingNearPluginResponse,
+ ProtobufOpenCommandPaneFloatingResponse,
+ ProtobufOpenCommandPaneInPlaceOfPluginResponse, ProtobufOpenCommandPaneInPlaceResponse,
+ ProtobufOpenCommandPaneNearPluginResponse, ProtobufOpenCommandPaneResponse,
+ ProtobufOpenFileFloatingNearPluginResponse, ProtobufOpenFileFloatingResponse,
+ ProtobufOpenFileInPlaceOfPluginResponse, ProtobufOpenFileInPlaceResponse,
+ ProtobufOpenFileNearPluginResponse, ProtobufOpenFileResponse,
+ ProtobufOpenTerminalFloatingNearPluginResponse, ProtobufOpenTerminalFloatingResponse,
+ ProtobufOpenTerminalInPlaceOfPluginResponse, ProtobufOpenTerminalInPlaceResponse,
+ ProtobufOpenTerminalNearPluginResponse, ProtobufOpenTerminalResponse,
+ ProtobufParseLayoutResponse, ProtobufPluginCommand, ProtobufRenameLayoutResponse,
+ ProtobufSaveLayoutResponse, ProtobufSaveSessionResponse,
},
plugin_ids::{ProtobufPluginIds, ProtobufZellijVersion},
},
@@ -81,7 +106,7 @@ use zellij_utils::plugin_api::plugin_command::{
macro_rules! apply_action {
($action:ident, $error_message:ident, $env: ident) => {
- if let Err(e) = route_action(
+ match route_action(
$action,
$env.client_id,
None,
@@ -96,7 +121,11 @@ macro_rules! apply_action {
$env.default_mode.clone(),
None,
) {
- log::error!("{}: {:?}", $error_message(), e);
+ Ok((_, result)) => result,
+ Err(e) => {
+ log::error!("{}: {:?}", $error_message(), e);
+ None
+ },
}
};
}
@@ -134,6 +163,8 @@ fn host_run_plugin_command(mut caller: Caller<'_, PluginEnv>) {
PluginCommand::CurrentSessionLastSavedTime => {
current_session_last_saved_time(env)
},
+ PluginCommand::GetPaneInfo(pane_id) => get_pane_info(env, pane_id),
+ PluginCommand::GetTabInfo(tab_id) => get_tab_info(env, tab_id),
PluginCommand::OpenFile(file_to_open, context) => {
open_file(env, file_to_open, context)
},
@@ -429,6 +460,10 @@ fn host_run_plugin_command(mut caller: Caller<'_, PluginEnv>) {
send_sigkill_to_pane_id(env, pane_id.into())
},
PluginCommand::GetPanePid { pane_id } => get_pane_pid(env, pane_id.into()),
+ PluginCommand::GetPaneRunningCommand { pane_id } => {
+ get_pane_running_command(env, pane_id.into())
+ },
+ PluginCommand::GetPaneCwd { pane_id } => get_pane_cwd(env, pane_id.into()),
PluginCommand::MovePaneWithPaneId(pane_id) => {
move_pane_with_pane_id(env, pane_id.into())
},
@@ -1021,7 +1056,16 @@ fn open_file(env: &PluginEnv, file_to_open: FileToOpen, context: BTreeMap<String
coordinates: None,
near_current_pane: false,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract pane_id from result and convert to zellij_utils PaneId
+ let pane_id: OpenFileResponse = result.and_then(|r| r.affected_pane_id).map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenFileResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_file response"))
+ .non_fatal();
}
fn run_action(env: &PluginEnv, mut action: Action, context: BTreeMap<String, String>) {
@@ -1113,7 +1157,17 @@ fn open_file_floating(
coordinates: floating_pane_coordinates,
near_current_pane: false,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract pane_id from result and convert to zellij_utils PaneId
+ let pane_id: OpenFileFloatingResponse =
+ result.and_then(|r| r.affected_pane_id).map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenFileFloatingResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_file_floating response"))
+ .non_fatal();
}
fn open_file_in_place(
@@ -1142,7 +1196,17 @@ fn open_file_in_place(
coordinates: None,
near_current_pane: false,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract pane_id from result and convert to zellij_utils PaneId
+ let pane_id: OpenFileInPlaceResponse =
+ result.and_then(|r| r.affected_pane_id).map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenFileInPlaceResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_file_in_place response"))
+ .non_fatal();
}
fn open_file_near_plugin(
@@ -1162,16 +1226,29 @@ fn open_file_near_plugin(
let title = format!("Editing: {}", open_file_payload.path.display());
let start_suppressed = false;
let open_file = TerminalAction::OpenFile(open_file_payload);
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let pty_instr = PtyInstruction::SpawnTerminal(
Some(open_file),
Some(title),
NewPanePlacement::default(),
start_suppressed,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(env.plugin_id)),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
false, // set_blocking
);
let _ = env.senders.send_to_pty(pty_instr);
+
+ // Wait for completion
+ let result = wait_for_action_completion(completion_rx, "open_file_near_plugin", false);
+ let pane_id: OpenFileNearPluginResponse = result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenFileNearPluginResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_file_near_plugin response"))
+ .non_fatal();
}
fn open_file_floating_near_plugin(
@@ -1192,16 +1269,29 @@ fn open_file_floating_near_plugin(
let title = format!("Editing: {}", open_file_payload.path.display());
let start_suppressed = false;
let open_file = TerminalAction::OpenFile(open_file_payload);
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let pty_instr = PtyInstruction::SpawnTerminal(
Some(open_file),
Some(title),
NewPanePlacement::Floating(floating_pane_coordinates),
start_suppressed,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(env.plugin_id)),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
false, // set_blocking
);
let _ = env.senders.send_to_pty(pty_instr);
+
+ // Wait for completion
+ let result = wait_for_action_completion(completion_rx, "open_file_floating_near_plugin", false);
+ let pane_id: OpenFileFloatingNearPluginResponse = result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenFileFloatingNearPluginResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_file_floating_near_plugin response"))
+ .non_fatal();
}
fn open_file_in_place_of_plugin(
@@ -1221,14 +1311,27 @@ fn open_file_in_place_of_plugin(
);
let title = format!("Editing: {}", open_file_payload.path.display());
let open_file = TerminalAction::OpenFile(open_file_payload);
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let pty_instr = PtyInstruction::SpawnInPlaceTerminal(
Some(open_file),
Some(title),
close_plugin_after_replace,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(env.plugin_id)),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
);
let _ = env.senders.send_to_pty(pty_instr);
+
+ // Wait for completion
+ let result = wait_for_action_completion(completion_rx, "open_file_in_place_of_plugin", false);
+ let pane_id: OpenFileInPlaceOfPluginResponse = result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenFileInPlaceOfPluginResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_file_in_place_of_plugin response"))
+ .non_fatal();
}
fn open_terminal(env: &PluginEnv, cwd: PathBuf) {
@@ -1253,7 +1356,16 @@ fn open_terminal(env: &PluginEnv, cwd: PathBuf) {
near_current_pane: false,
borderless: None,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract pane_id from result and convert to zellij_utils PaneId
+ let pane_id: OpenTerminalResponse = result.and_then(|r| r.affected_pane_id).map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenTerminalResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_terminal response"))
+ .non_fatal();
}
fn open_terminal_near_plugin(env: &PluginEnv, cwd: PathBuf) {
@@ -1267,6 +1379,9 @@ fn open_terminal_near_plugin(env: &PluginEnv, cwd: PathBuf) {
});
let name = None;
default_shell.change_cwd(cwd);
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let _ = env.senders.send_to_pty(PtyInstruction::SpawnTerminal(
Some(default_shell),
name,
@@ -1276,9 +1391,19 @@ fn open_terminal_near_plugin(env: &PluginEnv, cwd: PathBuf) {
},
false,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(env.plugin_id)),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
false, // set_blocking
));
+
+ // Wait for completion
+ let result = wait_for_action_completion(completion_rx, "open_terminal_near_plugin", false);
+ let pane_id: OpenTerminalNearPluginResponse = result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenTerminalNearPluginResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_terminal_near_plugin response"))
+ .non_fatal();
}
fn open_terminal_floating(
@@ -1306,7 +1431,17 @@ fn open_terminal_floating(
coordinates: floating_pane_coordinates,
near_current_pane: false,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract pane_id from result and convert to zellij_utils PaneId
+ let pane_id: OpenTerminalFloatingResponse =
+ result.and_then(|r| r.affected_pane_id).map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenTerminalFloatingResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_terminal_floating response"))
+ .non_fatal();
}
fn open_terminal_floating_near_plugin(
@@ -1324,15 +1459,29 @@ fn open_terminal_floating_near_plugin(
});
default_shell.change_cwd(cwd);
let name = None;
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let _ = env.senders.send_to_pty(PtyInstruction::SpawnTerminal(
Some(default_shell),
name,
NewPanePlacement::Floating(floating_pane_coordinates),
false,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(env.plugin_id)),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
false, // set_blocking
));
+
+ // Wait for completion
+ let result =
+ wait_for_action_completion(completion_rx, "open_terminal_floating_near_plugin", false);
+ let pane_id: OpenTerminalFloatingNearPluginResponse = result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenTerminalFloatingNearPluginResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_terminal_floating_near_plugin response"))
+ .non_fatal();
}
fn open_terminal_in_place(env: &PluginEnv, cwd: PathBuf) {
@@ -1357,7 +1506,17 @@ fn open_terminal_in_place(env: &PluginEnv, cwd: PathBuf) {
pane_id_to_replace: None,
close_replace_pane: false,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract pane_id from result and convert to zellij_utils PaneId
+ let pane_id: OpenTerminalInPlaceResponse =
+ result.and_then(|r| r.affected_pane_id).map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenTerminalInPlaceResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_terminal_in_place response"))
+ .non_fatal();
}
fn open_terminal_in_place_of_plugin(
@@ -1375,6 +1534,9 @@ fn open_terminal_in_place_of_plugin(
});
default_shell.change_cwd(cwd);
let name = None;
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let _ = env
.senders
.send_to_pty(PtyInstruction::SpawnInPlaceTerminal(
@@ -1382,8 +1544,19 @@ fn open_terminal_in_place_of_plugin(
name,
close_plugin_after_replace,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(env.plugin_id)),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
));
+
+ // Wait for completion
+ let result =
+ wait_for_action_completion(completion_rx, "open_terminal_in_place_of_plugin", false);
+ let pane_id: OpenTerminalInPlaceOfPluginResponse = result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenTerminalInPlaceOfPluginResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_terminal_in_place_of_plugin response"))
+ .non_fatal();
}
fn open_command_pane_in_place_of_plugin(
@@ -1415,6 +1588,9 @@ fn open_command_pane_in_place_of_plugin(
use_terminal_title,
};
let run_cmd = TerminalAction::RunCommand(run_command_action.into());
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let _ = env
.senders
.send_to_pty(PtyInstruction::SpawnInPlaceTerminal(
@@ -1422,8 +1598,19 @@ fn open_command_pane_in_place_of_plugin(
name,
close_plugin_after_replace,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(env.plugin_id)),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
));
+
+ // Wait for completion
+ let result =
+ wait_for_action_completion(completion_rx, "open_command_pane_in_place_of_plugin", false);
+ let pane_id: OpenCommandPaneInPlaceOfPluginResponse = result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenCommandPaneInPlaceOfPluginResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_command_pane_in_place_of_plugin response"))
+ .non_fatal();
}
fn open_command_pane(
@@ -1461,7 +1648,17 @@ fn open_command_pane(
near_current_pane: false,
borderless: None,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract pane_id from result and convert to zellij_utils PaneId
+ let pane_id: OpenCommandPaneResponse =
+ result.and_then(|r| r.affected_pane_id).map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenCommandPaneResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_command_pane response"))
+ .non_fatal();
}
fn open_command_pane_near_plugin(
@@ -1492,6 +1689,9 @@ fn open_command_pane_near_plugin(
use_terminal_title,
};
let run_cmd = TerminalAction::RunCommand(run_command_action.into());
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let _ = env.senders.send_to_pty(PtyInstruction::SpawnTerminal(
Some(run_cmd),
name,
@@ -1501,9 +1701,19 @@ fn open_command_pane_near_plugin(
},
false,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(env.plugin_id)),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
false, // set_blocking
));
+
+ // Wait for completion
+ let result = wait_for_action_completion(completion_rx, "open_command_pane_near_plugin", false);
+ let pane_id: OpenCommandPaneNearPluginResponse = result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenCommandPaneNearPluginResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_command_pane_near_plugin response"))
+ .non_fatal();
}
fn open_command_pane_floating(
@@ -1541,7 +1751,17 @@ fn open_command_pane_floating(
coordinates: floating_pane_coordinates,
near_current_pane: false,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract pane_id from result and convert to zellij_utils PaneId
+ let pane_id: OpenCommandPaneFloatingResponse =
+ result.and_then(|r| r.affected_pane_id).map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenCommandPaneFloatingResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_command_pane_floating response"))
+ .non_fatal();
}
fn open_command_pane_floating_near_plugin(
@@ -1573,15 +1793,33 @@ fn open_command_pane_floating_near_plugin(
use_terminal_title,
};
let run_cmd = TerminalAction::RunCommand(run_command_action.into());
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let _ = env.senders.send_to_pty(PtyInstruction::SpawnTerminal(
Some(run_cmd),
name,
NewPanePlacement::Floating(floating_pane_coordinates),
false,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(env.plugin_id)),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
false, // set_blocking
));
+
+ // Wait for completion
+ let result = wait_for_action_completion(
+ completion_rx,
+ "open_command_pane_floating_near_plugin",
+ false,
+ );
+ let pane_id: OpenCommandPaneFloatingNearPluginResponse =
+ result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenCommandPaneFloatingNearPluginResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_command_pane_floating_near_plugin response"))
+ .non_fatal();
}
fn open_command_pane_in_place(
@@ -1619,7 +1857,17 @@ fn open_command_pane_in_place(
pane_id_to_replace: None,
close_replace_pane: false,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract pane_id from result and convert to zellij_utils PaneId
+ let pane_id: OpenCommandPaneInPlaceResponse =
+ result.and_then(|r| r.affected_pane_id).map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenCommandPaneInPlaceResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_command_pane_in_place response"))
+ .non_fatal();
}
fn open_command_pane_background(
@@ -1654,15 +1902,28 @@ fn open_command_pane_background(
use_terminal_title,
};
let run_cmd = TerminalAction::RunCommand(run_command_action.into());
+
+ // Create completion channel
+ let (completion_tx, completion_rx) = oneshot::channel();
let _ = env.senders.send_to_pty(PtyInstruction::SpawnTerminal(
Some(run_cmd),
name,
NewPanePlacement::default(),
start_suppressed,
ClientTabIndexOrPaneId::ClientId(env.client_id),
- None, // no completion signal needed for plugin calls
+ Some(NotificationEnd::new(completion_tx)),
false, // set_blocking
));
+
+ // Wait for completion
+ let result = wait_for_action_completion(completion_rx, "open_command_pane_background", false);
+ let pane_id: OpenCommandPaneBackgroundResponse = result.affected_pane_id.map(|p| p.into());
+
+ // Write response to plugin
+ let response = ProtobufOpenCommandPaneBackgroundResponse::from(pane_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write open_command_pane_background response"))
+ .non_fatal();
}
fn rerun_command_pane(env: &PluginEnv, terminal_pane_id: u32) {
@@ -1989,10 +2250,23 @@ fn apply_layout(env: &PluginEnv, layout: Layout) {
tabs_to_open.push(action);
}
}
+ let mut tab_ids = Vec::new();
+
for action in tabs_to_open {
let error_msg = || format!("Failed to create layout tab");
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Collect tab ID from each action
+ if let Some(tab_id) = result.and_then(|r| r.affected_tab_id) {
+ tab_ids.push(tab_id);
+ }
}
+
+ // Write response
+ let response = ProtobufNewTabsResponse::from(tab_ids);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write layout tabs response"))
+ .non_fatal();
}
fn new_tab(env: &PluginEnv, name: Option<String>, cwd: Option<String>) {
@@ -2009,7 +2283,16 @@ fn new_tab(env: &PluginEnv, name: Option<String>, cwd: Option<String>) {
first_pane_unblock_condition: None,
};
let error_msg = || format!("Failed to open new tab");
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Extract tab_id from result - return None if not present
+ let tab_id: NewTabResponse = result.and_then(|r| r.affected_tab_id);
+
+ // Write response to plugin
+ let response = ProtobufNewTabResponse::from(tab_id);
+ wasi_write_object(env, &response.encode_to_vec())
+ .with_context(|| format!("failed to write new_tab response"))
+ .non_fatal();
}
fn go_to_next_tab(env: &PluginEnv) {
@@ -2347,7 +2630,13 @@ fn focus_or_create_tab(env: &PluginEnv, tab_name: String) {
name: tab_name,
create,
};
- apply_action!(action, error_msg, env);
+ let result = apply_action!(action, error_msg, env);
+
+ // Return Some(tab_id) if tab was created or focused, None on error
+ let tab_id: FocusOrCreateTabResponse = result.and_then(|r| r.affected_tab_id);
+
+ let response = ProtobufFocusOrCreateTabResponse::from(tab_id);
+ wasi_write_object(env, &response.encode_to_vec()).non_fatal();
}
fn go_to_tab(env: &PluginEnv, tab_index: u32) {
@@ -2627,6 +2916,133 @@ fn current_session_last_saved_time(env: &PluginEnv) {
let _ = wasi_write_object(env, &response.encode_to_vec());
}
+fn get_pane_info(env: &PluginEnv, pane_id: zellij_utils::data::PaneId) {
+ use crossbeam::channel::RecvTimeoutError;
+ use std::time::Duration;
+
+ let err_context = || {
+ format!(
+ "failed to get pane info for pane {:?} from plugin {}",
+ pane_id,
+ env.name()
+ )
+ };
+
+ // Create channel for response
+ let (response_sender, response_receiver) = crossbeam::channel::bounded(1);
+
+ // Convert from plugin PaneId to server PaneId
+ let server_pane_id: PaneId = pane_id.into();
+
+ // Send request to screen thread
+ env.senders
+ .send_to_screen(ScreenInstruction::GetPaneInfo {
+ pane_id: server_pane_id,
+ response_channel: response_sender,
+ })
+ .with_context(err_context)
+ .non_fatal();
+
+ // Block waiting for response with 100ms timeout
+ let pane_info = match response_receiver.recv_timeout(Duration::from_millis(100)) {
+ Ok(Some(pane_info)) => {
+ // Convert PaneInfo to ProtobufPaneInfo
+ match pane_info.try_into() {
+ Ok(protobuf_pane_info) => Some(protobuf_pane_info),
+ Err(e) => {
+ log::error!(
+ "Failed to convert PaneInfo to protobuf for pane {:?}: {}",
+ pane_id,
+ e
+ );
+ None
+ },
+ }
+ },
+ Ok(None) => None, // Pane not found
+ Err(RecvTimeoutError::Timeout) => {
+ log::error!(
+ "GetPaneInfo timed out for pane {:?} from plugin {}",
+ pane_id,
+ env.plugin_id
+ );
+ None
+ },
+ Err(RecvTimeoutError::Disconnected) => {
+ log::error!(
+ "GetPaneInfo channel disconnected for plugin {}",
+ env.plugin_id
+ );
+ None
+ },
+ };
+
+ let response = ProtobufGetPaneInfoResponse { pane_info };
+ let _ = wasi_write_object(env, &response.encode_to_vec());
+}
+
+fn get_tab_info(env: &PluginEnv, tab_id: usize) {
+ use crossbeam::channel::RecvTimeoutError;
+ use std::time::Duration;
+
+ let err_context = || {
+ format!(
+ "failed to get tab info for tab {} from plugin {}",
+ tab_id,
+ env.name()
+ )
+ };
+
+ // Create channel for response
+ let (response_sender, response_receiver) = crossbeam::channel::bounded(1);
+
+ // Send request to screen thread
+ env.senders
+ .send_to_screen(ScreenInstruction::GetTabInfo {
+ tab_id,
+ response_channel: response_sender,
+ })
+ .with_context(err_context)
+ .non_fatal();
+
+ // Block waiting for response with 100ms timeout
+ let tab_info = match response_receiver.recv_timeout(Duration::from_millis(100)) {
+ Ok(Some(tab_info)) => {
+ // Convert TabInfo to ProtobufTabInfo
+ match tab_info.try_into() {
+ Ok(protobuf_tab_info) => Some(protobuf_tab_info),
+ Err(e) => {
+ log::error!(
+ "Failed to convert TabInfo to protobuf for tab {}: {}",
+ tab_id,
+ e
+ );
+ None
+ },
+ }
+ },
+ Ok(None) => None, // Tab not found
+ Err(RecvTimeoutError::Timeout) => {
+ log::error!(
+ "GetTabInfo timed out for tab {} from plugin {}",
+ tab_id,
+ env.plugin_id
+ );
+ None
+ },
+ Err(RecvTimeoutError::Disconnected) => {
+ log::error!(
+ "GetTabInfo channel disconnected for plugin {}",
+ env.plugin_id
+ );
+ None
+ },
+ };
+
+ let response = ProtobufGetTabInfoResponse { tab_info };
+ let _ = wasi_write_object(env, &response.encode_to_vec());
+}
+
fn list_clients(env: &PluginEnv) {
let _ = env.senders.to_screen.as_ref().map(|sender| {
sender.send(ScreenInstruction::ListClientsToPlugin(
@@ -2931,6 +3347,135 @@ fn get_pane_pid(env: &PluginEnv, pane_id: PaneId) {
.non_fatal();
}
+fn get_pane_running_command(env: &PluginEnv, pane_id: PaneId) {
+ let (sender, receiver) = crossbeam::channel::bounded(1);
+
+ send_get_pane_running_command_request(env, pane_id, sender);
+ let response = await_pane_running_command_response(env, pane_id, receiver);
+ write_pane_running_command_response(env, pane_id, response);
+}
+
+fn send_get_pane_running_command_request(
+ env: &PluginEnv,
+ pane_id: PaneId,
+ sender: crossbeam::channel::Sender<GetPaneRunningCommandResponse>,
+) {
+ env.senders
+ .send_to_pty(PtyInstruction::GetPaneRunningCommand {
+ pane_id,
+ response_channel: sender,
+ })
+ .with_context(|| format!("Failed to get running command for pane {:?}", pane_id))
+ .non_fatal();
+}
+
+fn await_pane_running_command_response(
+ env: &PluginEnv,
+ pane_id: PaneId,
+ receiver: crossbeam::channel::Receiver<GetPaneRunningCommandResponse>,
+) -> GetPaneRunningCommandResponse {
+ use crossbeam::channel::RecvTimeoutError;
+ use std::time::Duration;
+
+ match receiver.recv_timeout(Duration::from_millis(100)) {
+ Ok(response) => response,
+ Err(RecvTimeoutError::Timeout) => {
+ log::error!(
+ "GetPaneRunningCommand timed out for plugin {} requesting pane {:?}",
+ env.plugin_id,
+ pane_id
+ );
+ GetPaneRunningCommandResponse::Err(format!(
+ "Timeout retrieving running command for pane {:?}",
+ pane_id
+ ))
+ },
+ Err(RecvTimeoutError::Disconnected) => {
+ log::error!(
+ "GetPaneRunningCommand channel disconnected for plugin {} requesting pane {:?}",
+ env.plugin_id,
+ pane_id
+ );
+ GetPaneRunningCommandResponse::Err(format!(
+ "Channel disconnected while retrieving running command for pane {:?}",
+ pane_id
+ ))
+ },
+ }
+}
+
+fn write_pane_running_command_response(
+ env: &PluginEnv,
+ pane_id: PaneId,
+ response: GetPaneRunningCommandResponse,
+) {
+ let protobuf_response = ProtobufGetPaneRunningCommandResponse::from(response);
+ wasi_write_object(env, &protobuf_response.encode_to_vec())
+ .with_context(|| format!("Failed to get running command for pane {:?}", pane_id))
+ .non_fatal();
+}
+
+fn get_pane_cwd(env: &PluginEnv, pane_id: PaneId) {
+ let (sender, receiver) = crossbeam::channel::bounded(1);
+
+ send_get_pane_cwd_request(env, pane_id, sender);
+ let response = await_pane_cwd_response(env, pane_id, receiver);
+ write_pane_cwd_response(env, pane_id, response);
+}
+
+fn send_get_pane_cwd_request(
+ env: &PluginEnv,
+ pane_id: PaneId,
+ sender: crossbeam::channel::Sender<GetPaneCwdResponse>,
+) {
+ env.senders
+ .send_to_pty(PtyInstruction::GetPaneCwd {
+ pane_id,
+ response_channel: sender,
+ })
+ .with_context(|| format!("Failed to get CWD for pane {:?}", pane_id))
+ .non_fatal();
+}
+
+fn await_pane_cwd_response(
+ env: &PluginEnv,
+ pane_id: PaneId,
+ receiver: crossbeam::channel::Receiver<GetPaneCwdResponse>,
+) -> GetPaneCwdResponse {
+ use crossbeam::channel::RecvTimeoutError;
+ use std::time::Duration;
+
+ match receiver.recv_timeout(Duration::from_millis(100)) {
+ Ok(response) => response,
+ Err(RecvTimeoutError::Timeout) => {
+ log::error!(
+ "GetPaneCwd timed out for plugin {} requesting pane {:?}",
+ env.plugin_id,
+ pane_id
+ );
+ GetPaneCwdResponse::Err(format!("Timeout retrieving CWD for pane {:?}", pane_id))
+ },
+ Err(RecvTimeoutError::Disconnected) => {
+ log::error!(
+ "GetPaneCwd channel disconnected for plugin {} requesting pane {:?}",
+ env.plugin_id,
+ pane_id
+ );
+ GetPaneCwdResponse::Err(format!(
+ "Channel disconnected while retrieving CWD for pane {:?}",
+ pane_id
+ ))
+ },
+ }
+}
+
+fn write_pane_cwd_response(env: &PluginEnv, pane_id: PaneId, response: GetPaneCwdResponse) {
+ let protobuf_response = ProtobufGetPaneCwdResponse::from(response);
+ wasi_write_object(env, &protobuf_response.encode_to_vec())
+ .with_context(|| format!("Failed to get CWD for pane {:?}", pane_id))
+ .non_fatal();
+}
+
fn save_layout(env: &PluginEnv, layout_name: String, layout_kdl: String, overwrite: bool) {
let err_context = || format!("Failed to save layout '{}'", layout_name);
@@ -3310,7 +3855,12 @@ fn break_panes_to_new_tab(
..Default::default()
}))
});
- let _ = env
+
+ // Create completion channel to receive tab ID
+ let (tx, rx) = tokio::sync::oneshot::channel();
+ let completion_tx = Some(NotificationEnd::new(tx));
+
+ let result = env
.senders
.send_to_screen(ScreenInstruction::BreakPanesToNewTab {
pane_ids,
@@ -3318,7 +3868,17 @@ fn break_panes_to_new_tab(
new_tab_name,
should_change_focus_to_new_tab,
client_id: env.client_id,
+ completion_tx,
});
+
+ let tab_id: BreakPanesToNewTabResponse = if result.is_ok() {
+ wait_for_action_completion(rx, "break_panes_to_new_tab", false).affected_tab_id
+ } else {
+ None
+ };
+
+ let response = ProtobufBreakPanesToNewTabResponse::from(tab_id);
+ wasi_write_object(env, &response.encode_to_vec()).non_fatal();
}
fn break_panes_to_tab_with_index(
@@ -3327,14 +3887,28 @@ fn break_panes_to_tab_with_index(
should_change_focus_to_new_tab: bool,
tab_index: usize,
) {
- let _ = env
+ // Create completion channel to receive tab ID
+ let (tx, rx) = tokio::sync::oneshot::channel();
+ let completion_tx = Some(NotificationEnd::new(tx));
+
+ let result = env
.senders
.send_to_screen(ScreenInstruction::BreakPanesToTabWithIndex {
pane_ids,
tab_index,
client_id: env.client_id,
should_change_focus_to_new_tab,
+ completion_tx,
});
+
+ let tab_id: BreakPanesToTabWithIndexResponse = if result.is_ok() {
+ wait_for_action_completion(rx, "break_panes_to_tab_with_index", false).affected_tab_id
+ } else {
+ None
+ };
+
+ let response = ProtobufBreakPanesToTabWithIndexResponse::from(tab_id);
+ wasi_write_object(env, &response.encode_to_vec()).non_fatal();
}
fn reload_plugin(env: &PluginEnv, plugin_id: u32) {
@@ -3901,13 +4475,17 @@ fn check_command_permission(
PluginCommand::ListClients
| PluginCommand::DumpSessionLayout { .. }
| PluginCommand::GetPanePid { .. }
+ | PluginCommand::GetPaneRunningCommand { .. }
+ | PluginCommand::GetPaneCwd { .. }
| PluginCommand::GenerateRandomName
| PluginCommand::GetLayoutDir
| PluginCommand::GetFocusedPaneInfo
| PluginCommand::DumpLayout(..)
| PluginCommand::ParseLayout(..)
| PluginCommand::SaveSession
- | PluginCommand::CurrentSessionLastSavedTime => PermissionType::ReadApplicationState,
+ | PluginCommand::CurrentSessionLastSavedTime
+ | PluginCommand::GetPaneInfo(..)
+ | PluginCommand::GetTabInfo(..) => PermissionType::ReadApplicationState,
PluginCommand::RebindKeys { .. } | PluginCommand::Reconfigure(..) => {
PermissionType::Reconfigure
},
diff --git a/zellij-server/src/pty.rs b/zellij-server/src/pty.rs
index 587fd18d..595b7066 100644
--- a/zellij-server/src/pty.rs
+++ b/zellij-server/src/pty.rs
@@ -19,8 +19,8 @@ use std::sync::Arc;
use std::{collections::HashMap, os::unix::io::RawFd, path::PathBuf};
use zellij_utils::{
data::{
- CommandOrPlugin, Event, FloatingPaneCoordinates, GetPanePidResponse, NewPanePlacement,
- OriginatingPlugin, SessionInfo,
+ CommandOrPlugin, Event, FloatingPaneCoordinates, GetPaneCwdResponse, GetPanePidResponse,
+ GetPaneRunningCommandResponse, NewPanePlacement, OriginatingPlugin, SessionInfo,
},
errors::prelude::*,
errors::{ContextType, PtyContext},
@@ -146,6 +146,14 @@ pub enum PtyInstruction {
pane_id: PaneId,
response_channel: crossbeam::channel::Sender<GetPanePidResponse>,
},
+ GetPaneRunningCommand {
+ pane_id: PaneId,
+ response_channel: crossbeam::channel::Sender<GetPaneRunningCommandResponse>,
+ },
+ GetPaneCwd {
+ pane_id: PaneId,
+ response_channel: crossbeam::channel::Sender<GetPaneCwdResponse>,
+ },
UpdateAndReportCwds,
Exit,
}
@@ -176,6 +184,8 @@ impl From<&PtyInstruction> for PtyContext {
PtyInstruction::SendSigintToPaneId(..) => PtyContext::SendSigintToPaneId,
PtyInstruction::SendSigkillToPaneId(..) => PtyContext::SendSigkillToPaneId,
PtyInstruction::GetPanePid { .. } => PtyContext::GetPanePid,
+ PtyInstruction::GetPaneRunningCommand { .. } => PtyContext::GetPaneRunningCommand,
+ PtyInstruction::GetPaneCwd { .. } => PtyContext::GetPaneCwd,
PtyInstruction::UpdateAndReportCwds => PtyContext::UpdateAndReportCwds,
PtyInstruction::Exit => PtyContext::Exit,
}
@@ -854,6 +864,20 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box<Layout>) -> Result<()> {
let response = pty.get_pane_pid(pane_id);
let _ = response_channel.send(response);
},
+ PtyInstruction::GetPaneRunningCommand {
+ pane_id,
+ response_channel,
+ } => {
+ let response = pty.get_pane_running_command(pane_id);
+ let _ = response_channel.send(response);
+ },
+ PtyInstruction::GetPaneCwd {
+ pane_id,
+ response_channel,
+ } => {
+ let response = pty.get_pane_cwd(pane_id);
+ let _ = response_channel.send(response);
+ },
PtyInstruction::UpdateAndReportCwds => {
pty.update_and_report_cwds();
},
@@ -2086,6 +2110,79 @@ impl Pty {
},
}
}
+ pub fn get_pane_running_command(&self, pane_id: PaneId) -> GetPaneRunningCommandResponse {
+ match pane_id {
+ PaneId::Terminal(terminal_id) => {
+ if let Some(&child_pid) = self.id_to_child_pid.get(&terminal_id) {
+ // Query OS for current running command
+ let pid = Pid::from_raw(child_pid);
+ if let Some(os_input) = self.bus.os_input.as_ref() {
+ // First, try to get child process command (e.g., nvim running in bash)
+ let ppids_to_cmds =
+ os_input.get_all_cmds_by_ppid(&self.post_command_discovery_hook);
+ let cmd_ps = ppids_to_cmds.get(&format!("{}", child_pid));
+
+ // If no child process, fall back to parent process (e.g., the shell itself)
+ let (_cwds, cmds) = os_input.get_cwds(vec![pid]);
+ let cmd_sysinfo = cmds.get(&pid);
+
+ if let Some(command_args) = cmd_ps {
+ GetPaneRunningCommandResponse::Ok(command_args.clone())
+ } else if let Some(command_args) = cmd_sysinfo {
+ GetPaneRunningCommandResponse::Ok(command_args.clone())
+ } else {
+ GetPaneRunningCommandResponse::Err(format!(
+ "Could not retrieve running command for terminal pane {}",
+ terminal_id
+ ))
+ }
+ } else {
+ GetPaneRunningCommandResponse::Err("OS input not available".to_string())
+ }
+ } else {
+ GetPaneRunningCommandResponse::Err(format!(
+ "Terminal pane {} not found or not running",
+ terminal_id
+ ))
+ }
+ },
+ PaneId::Plugin(plugin_id) => GetPaneRunningCommandResponse::Err(format!(
+ "Cannot get running command for plugin pane {}",
+ plugin_id
+ )),
+ }
+ }
+ pub fn get_pane_cwd(&self, pane_id: PaneId) -> GetPaneCwdResponse {
+ match pane_id {
+ PaneId::Terminal(terminal_id) => {
+ if let Some(&child_pid) = self.id_to_child_pid.get(&terminal_id) {
+ // Query OS for current working directory
+ let pid = Pid::from_raw(child_pid);
+ if let Some(os_input) = self.bus.os_input.as_ref() {
+ let (cwds, _cmds) = os_input.get_cwds(vec![pid]);
+ if let Some(cwd) = cwds.get(&pid) {
+ GetPaneCwdResponse::Ok(cwd.clone())
+ } else {
+ GetPaneCwdResponse::Err(format!(
+ "Could not retrieve CWD for terminal pane {}",
+ terminal_id
+ ))
+ }
+ } else {
+ GetPaneCwdResponse::Err("OS input not available".to_string())
+ }
+ } else {
+ GetPaneCwdResponse::Err(format!(
+ "Terminal pane {} not found or not running",
+ terminal_id
+ ))
+ }
+ },
+ PaneId::Plugin(plugin_id) => {
+ GetPaneCwdResponse::Err(format!("Cannot get CWD for plugin pane {}", plugin_id))
+ },
+ }
+ }
}
impl Drop for Pty {
diff --git a/zellij-server/src/route.rs b/zellij-server/src/route.rs
index 210306f7..c16600af 100644
--- a/zellij-server/src/route.rs
+++ b/zellij-server/src/route.rs
@@ -18,8 +18,8 @@ use uuid::Uuid;
use zellij_utils::{
channels::SenderWithContext,
data::{
- BareKey, ConnectToSession, Direction, Event, InputMode, KeyModifier, NewPanePlacement,
- PluginCapabilities, ResizeStrategy, UnblockCondition,
+ BareKey, ConnectToSession, Direction, Event, InputMode, KeyModifier, ListPanesResponse,
+ NewPanePlacement, PaneListEntry, PluginCapabilities, ResizeStrategy, UnblockCondition,
},
envs,
errors::prelude::*,
@@ -43,6 +43,7 @@ const ACTION_COMPLETION_TIMEOUT: Duration = Duration::from_secs(1);
pub struct ActionCompletionResult {
pub exit_status: Option<i32>,
pub affected_pane_id: Option<PaneId>,
+ pub affected_tab_id: Option<usize>,
}
pub fn wait_for_action_completion(
@@ -60,6 +61,7 @@ pub fn wait_for_action_completion(
ActionCompletionResult {
exit_status: None,
affected_pane_id: None,
+ affected_tab_id: None,
}
},
}
@@ -78,6 +80,7 @@ pub fn wait_for_action_completion(
ActionCompletionResult {
exit_status: None,
affected_pane_id: None,
+ affected_tab_id: None,
}
},
}
@@ -96,6 +99,7 @@ pub struct NotificationEnd {
exit_status: Option<i32>,
unblock_condition: Option<UnblockCondition>,
affected_pane_id: Option<PaneId>, // optional payload of the pane id affected by this action
+ affected_tab_id: Option<usize>, // optional payload of the tab id affected by this action
}
impl Clone for NotificationEnd {
@@ -106,6 +110,7 @@ impl Clone for NotificationEnd {
exit_status: self.exit_status,
unblock_condition: self.unblock_condition,
affected_pane_id: self.affected_pane_id,
+ affected_tab_id: self.affected_tab_id,
}
}
}
@@ -117,6 +122,7 @@ impl NotificationEnd {
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
}
}
@@ -129,6 +135,7 @@ impl NotificationEnd {
exit_status: None,
unblock_condition: Some(unblock_condition),
affected_pane_id: None,
+ affected_tab_id: None,
}
}
@@ -140,6 +147,10 @@ impl NotificationEnd {
self.affected_pane_id = Some(pane_id);
}
+ pub fn set_affected_tab_id(&mut self, tab_id: usize) {
+ self.affected_tab_id = Some(tab_id);
+ }
+
pub fn unblock_condition(&self) -> Option<UnblockCondition> {
self.unblock_condition
}
@@ -151,6 +162,7 @@ impl Drop for NotificationEnd {
let result = ActionCompletionResult {
exit_status: self.exit_status,
affected_pane_id: self.affected_pane_id,
+ affected_tab_id: self.affected_tab_id,
};
let _ = tx.send(result);
}
@@ -1516,6 +1528,41 @@ pub(crate) fn route_action(
))
.with_context(err_context)?;
},
+ Action::ListPanes {
+ show_tab,
+ show_command,
+ show_state,
+ show_geometry,
+ show_all,
+ output_json,
+ } => {
+ let maybe_panes =
+ request_panes_from_screen(&senders, show_all).with_context(err_context)?;
+
+ if let Some(mut pane_entries) = maybe_panes {
+ if show_command || show_all || output_json {
+ enrich_panes_with_pty_data(&mut pane_entries, &senders)
+ .with_context(err_context)?;
+ }
+
+ let output_lines = if output_json {
+ format_panes_as_json(&pane_entries)
+ } else {
+ format_panes_table(
+ &pane_entries,
+ show_tab || show_all,
+ show_command || show_all,
+ show_state || show_all,
+ show_geometry || show_all,
+ )
+ };
+
+ send_output_to_client(cli_client_id, os_input.as_ref(), output_lines);
+ } else {
+ send_error_to_client(cli_client_id, os_input.as_ref(), "Timeout listing panes");
+ }
+ drop(NotificationEnd::new(completion_tx));
+ },
Action::TogglePanePinned => {
senders
.send_to_screen(ScreenInstruction::TogglePanePinned(
@@ -1586,7 +1633,7 @@ pub(crate) fn route_action(
let result = wait_for_action_completion(completion_rx, &action_name, wait_forever);
if let Some(exit_status) = result.exit_status {
if let Some(cli_client_id) = cli_client_id {
- if let Some(os_input) = os_input {
+ if let Some(ref os_input) = os_input {
let _ = os_input.send_to_client(
cli_client_id,
ServerToClientMsg::Exit {
@@ -1596,6 +1643,32 @@ pub(crate) fn route_action(
}
}
}
+ // Return tab ID to CLI clients as plain text
+ if let Some(tab_id) = result.affected_tab_id {
+ if let Some(cli_client_id) = cli_client_id {
+ if let Some(ref os_input) = os_input {
+ let _ = os_input.send_to_client(
+ cli_client_id,
+ ServerToClientMsg::Log {
+ lines: vec![tab_id.to_string()],
+ },
+ );
+ }
+ }
+ }
+ // Return pane ID to CLI clients as plain text
+ if let Some(pane_id) = result.affected_pane_id {
+ if let Some(cli_client_id) = cli_client_id {
+ if let Some(ref os_input) = os_input {
+ let _ = os_input.send_to_client(
+ cli_client_id,
+ ServerToClientMsg::Log {
+ lines: vec![pane_id.to_string()],
+ },
+ );
+ }
+ }
+ }
Ok((should_break, Some(result)))
}
@@ -2113,3 +2186,339 @@ pub(crate) fn route_thread_main(
let _ = to_server.send(ServerInstruction::RemoveClient(client_id));
Ok(())
}
+
+fn request_panes_from_screen(
+ senders: &ThreadSenders,
+ show_all: bool,
+) -> Result<Option<ListPanesResponse>> {
+ use crossbeam::channel::{unbounded, RecvTimeoutError};
+ use std::time::Duration;
+
+ let (response_sender, response_receiver) = unbounded();
+ senders.send_to_screen(ScreenInstruction::ListPanes {
+ show_all,
+ response_channel: response_sender,
+ })?;
+
+ match response_receiver.recv_timeout(Duration::from_secs(1)) {
+ Ok(entries) => Ok(Some(entries)),
+ Err(RecvTimeoutError::Timeout) => {
+ log::error!("ListPanes timed out waiting for Screen response");
+ Ok(None)
+ },
+ Err(RecvTimeoutError::Disconnected) => {
+ log::error!("ListPanes channel disconnected");
+ Ok(None)
+ },
+ }
+}
+
+fn enrich_panes_with_pty_data(
+ pane_entries: &mut [PaneListEntry],
+ senders: &ThreadSenders,
+) -> Result<()> {
+ for entry in pane_entries.iter_mut() {
+ if !entry.pane_info.is_plugin {
+ let pane_id = PaneId::Terminal(entry.pane_info.id);
+ enrich_pane_with_running_command(entry, pane_id, senders)?;
+ enrich_pane_with_cwd(entry, pane_id, senders)?;
+ }
+ }
+ Ok(())
+}
+
+fn enrich_pane_with_running_command(
+ entry: &mut PaneListEntry,
+ pane_id: PaneId,
+ senders: &ThreadSenders,
+) -> Result<()> {
+ use crossbeam::channel::unbounded;
+ use std::time::Duration;
+ use zellij_utils::data::GetPaneRunningCommandResponse;
+
+ let (cmd_sender, cmd_receiver) = unbounded();
+ senders.send_to_pty(PtyInstruction::GetPaneRunningCommand {
+ pane_id,
+ response_channel: cmd_sender,
+ })?;
+
+ if let Ok(GetPaneRunningCommandResponse::Ok(command_vec)) =
+ cmd_receiver.recv_timeout(Duration::from_millis(100))
+ {
+ entry.pane_command = Some(command_vec.join(" "));
+ }
+
+ Ok(())
+}
+
+fn enrich_pane_with_cwd(
+ entry: &mut PaneListEntry,
+ pane_id: PaneId,
+ senders: &ThreadSenders,
+) -> Result<()> {
+ use crossbeam::channel::unbounded;
+ use std::time::Duration;
+ use zellij_utils::data::GetPaneCwdResponse;
+
+ let (cwd_sender, cwd_receiver) = unbounded();
+ senders.send_to_pty(PtyInstruction::GetPaneCwd {
+ pane_id,
+ response_channel: cwd_sender,
+ })?;
+
+ if let Ok(GetPaneCwdResponse::Ok(cwd)) = cwd_receiver.recv_timeout(Duration::from_millis(100)) {
+ entry.pane_cwd = Some(cwd.to_string_lossy().to_string());
+ }
+
+ Ok(())
+}
+
+fn format_panes_as_json(pane_entries: &[PaneListEntry]) -> Vec<String> {
+ vec![serde_json::to_string_pretty(pane_entries).unwrap_or_else(|_| "[]".to_string())]
+}
+
+fn format_panes_table(
+ entries: &[PaneListEntry],
+ show_tab: bool,
+ show_command: bool,
+ show_state: bool,
+ show_geometry: bool,
+) -> Vec<String> {
+ let mut lines = Vec::new();
+ lines.push(build_table_header(
+ show_tab,
+ show_command,
+ show_state,
+ show_geometry,
+ ));
+
+ for entry in entries {
+ lines.push(build_table_row(
+ entry,
+ show_tab,
+ show_command,
+ show_state,
+ show_geometry,
+ ));
+ }
+
+ lines
+}
+
+fn build_table_header(
+ show_tab: bool,
+ show_command: bool,
+ show_state: bool,
+ show_geometry: bool,
+) -> String {
+ let mut header = Vec::new();
+
+ if show_tab {
+ header.push("TAB_ID");
+ header.push("TAB_POS");
+ header.push("TAB_NAME");
+ }
+
+ header.push("PANE_ID");
+ header.push("TYPE");
+ header.push("TITLE");
+
+ if show_command {
+ header.push("COMMAND");
+ header.push("CWD");
+ }
+
+ if show_state {
+ header.push("FOCUSED");
+ header.push("FLOATING");
+ header.push("EXITED");
+ }
+
+ if show_geometry {
+ header.push("X");
+ header.push("Y");
+ header.push("ROWS");
+ header.push("COLS");
+ }
+
+ header.join(" ")
+}
+
+fn build_table_row(
+ entry: &PaneListEntry,
+ show_tab: bool,
+ show_command: bool,
+ show_state: bool,
+ show_geometry: bool,
+) -> String {
+ let mut row = Vec::new();
+
+ if show_tab {
+ row.push(entry.tab_id.to_string());
+ row.push(entry.tab_position.to_string());
+ row.push(entry.tab_name.clone());
+ }
+
+ row.push(format_pane_id(&entry.pane_info));
+ row.push(format_pane_type(&entry.pane_info));
+ row.push(entry.pane_info.title.clone());
+
+ if show_command {
+ row.push(extract_command(entry));
+ row.push(extract_cwd(entry));
+ }
+
+ if show_state {
+ row.push(entry.pane_info.is_focused.to_string());
+ row.push(entry.pane_info.is_floating.to_string());
+ row.push(entry.pane_info.exited.to_string());
+ }
+
+ if show_geometry {
+ row.push(entry.pane_info.pane_x.to_string());
+ row.push(entry.pane_info.pane_y.to_string());
+ row.push(entry.pane_info.pane_rows.to_string());
+ row.push(entry.pane_info.pane_columns.to_string());
+ }
+
+ row.join(" ")
+}
+
+fn format_pane_id(pane_info: &zellij_utils::data::PaneInfo) -> String {
+ if pane_info.is_plugin {
+ format!("plugin_{}", pane_info.id)
+ } else {
+ format!("terminal_{}", pane_info.id)
+ }
+}
+
+fn format_pane_type(pane_info: &zellij_utils::data::PaneInfo) -> String {
+ if pane_info.is_plugin {
+ "plugin".to_string()
+ } else {
+ "terminal".to_string()
+ }
+}
+
+fn extract_command(entry: &PaneListEntry) -> String {
+ entry
+ .pane_command
+ .as_ref()
+ .or(entry.pane_info.terminal_command.as_ref())
+ .or(entry.pane_info.plugin_url.as_ref())
+ .map(|s| s.as_str())
+ .unwrap_or("-")
+ .to_string()
+}
+
+fn extract_cwd(entry: &PaneListEntry) -> String {
+ entry
+ .pane_cwd
+ .as_ref()
+ .map(|s| s.as_str())
+ .unwrap_or("-")
+ .to_string()
+}
+
+fn send_error_to_client(
+ cli_client_id: Option<ClientId>,
+ os_input: Option<&Box<dyn ServerOsApi>>,
+ error_message: &str,
+) {
+ if let Some(cli_client_id) = cli_client_id {
+ if let Some(os_input) = os_input {
+ let _ = os_input.send_to_client(
+ cli_client_id,
+ ServerToClientMsg::LogError {
+ lines: vec![error_message.to_string()],
+ },
+ );
+ }
+ }
+}
+
+fn send_output_to_client(
+ cli_client_id: Option<ClientId>,
+ os_input: Option<&Box<dyn ServerOsApi>>,
+ output_lines: Vec<String>,
+) {
+ if let Some(cli_client_id) = cli_client_id {
+ if let Some(os_input) = os_input {
+ let _ = os_input.send_to_client(
+ cli_client_id,
+ ServerToClientMsg::Log {
+ lines: output_lines,
+ },
+ );
+ }
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_notification_end_sets_affected_tab_id() {
+ let (tx, rx) = oneshot::channel();
+ let mut notification_end = NotificationEnd::new(tx);
+
+ notification_end.set_affected_tab_id(42);
+
+ drop(notification_end);
+
+ let result = rx.blocking_recv().unwrap();
+ assert_eq!(result.affected_tab_id, Some(42));
+ }
+
+ #[test]
+ fn test_notification_end_default_affected_tab_id_none() {
+ let (tx, rx) = oneshot::channel();
+ let notification_end = NotificationEnd::new(tx);
+
+ drop(notification_end);
+
+ let result = rx.blocking_recv().unwrap();
+ assert_eq!(result.affected_tab_id, None);
+ }
+
+ #[test]
+ fn test_action_completion_result_includes_tab_id() {
+ let result = ActionCompletionResult {
+ exit_status: None,
+ affected_pane_id: None,
+ affected_tab_id: Some(123),
+ };
+
+ assert_eq!(result.affected_tab_id, Some(123));
+ }
+
+ #[test]
+ fn test_notification_end_with_pane_and_tab_ids() {
+ let (tx, rx) = oneshot::channel();
+ let mut notification_end = NotificationEnd::new(tx);
+
+ notification_end.set_affected_pane_id(PaneId::Terminal(10));
+ notification_end.set_affected_tab_id(5);
+
+ drop(notification_end);
+
+ let result = rx.blocking_recv().unwrap();
+ assert_eq!(result.affected_pane_id, Some(PaneId::Terminal(10)));
+ assert_eq!(result.affected_tab_id, Some(5));
+ }
+
+ #[test]
+ fn test_notification_end_clone_does_not_copy_channel() {
+ let (tx, _rx) = oneshot::channel();
+ let mut notification_end = NotificationEnd::new(tx);
+ notification_end.set_affected_tab_id(99);
+
+ let cloned = notification_end.clone();
+
+ // Verify the clone has the same data
+ assert_eq!(cloned.affected_tab_id, Some(99));
+ // But channel should be None (as per the Clone implementation comment)
+ assert!(cloned.channel.is_none());
+ }
+}
diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs
index 9c1d5523..761a7a4e 100644
--- a/zellij-server/src/screen.rs
+++ b/zellij-server/src/screen.rs
@@ -41,9 +41,9 @@ use crate::route::NotificationEnd;
use log::{debug, warn};
use zellij_utils::data::{
CommandOrPlugin, Direction, FloatingPaneCoordinates, GetFocusedPaneInfoResponse,
- KeyWithModifier, LayoutInfo, NewPanePlacement, PaneContents, PaneManifest,
- PaneScrollbackResponse, PluginPermission, Resize, ResizeStrategy, SessionInfo, Styling,
- WebSharing,
+ KeyWithModifier, LayoutInfo, ListPanesResponse, NewPanePlacement, PaneContents, PaneInfo,
+ PaneListEntry, PaneManifest, PaneScrollbackResponse, PluginPermission, Resize, ResizeStrategy,
+ SessionInfo, Styling, WebSharing,
};
use zellij_utils::errors::prelude::*;
use zellij_utils::input::command::RunCommand;
@@ -301,6 +301,14 @@ pub enum ScreenInstruction {
client_id: ClientId,
response_channel: crossbeam::channel::Sender<GetFocusedPaneInfoResponse>,
},
+ GetPaneInfo {
+ pane_id: PaneId,
+ response_channel: crossbeam::channel::Sender<Option<PaneInfo>>,
+ },
+ GetTabInfo {
+ tab_id: usize,
+ response_channel: crossbeam::channel::Sender<Option<TabInfo>>,
+ },
EditScrollback(ClientId, Option<NotificationEnd>),
GetPaneScrollback {
pane_id: PaneId,
@@ -530,6 +538,10 @@ pub enum ScreenInstruction {
SerializeLayoutForResurrection,
RenameSession(String, ClientId, Option<NotificationEnd>), // String -> new name
ListClientsMetadata(Option<PathBuf>, ClientId, Option<NotificationEnd>), // Option<PathBuf> - default shell
+ ListPanes {
+ show_all: bool,
+ response_channel: crossbeam::channel::Sender<ListPanesResponse>,
+ },
Reconfigure {
client_id: ClientId,
keybinds: Keybinds,
@@ -572,12 +584,14 @@ pub enum ScreenInstruction {
should_change_focus_to_new_tab: bool,
new_tab_name: Option<String>,
client_id: ClientId,
+ completion_tx: Option<NotificationEnd>,
},
BreakPanesToTabWithIndex {
pane_ids: Vec<PaneId>,
tab_index: usize,
should_change_focus_to_new_tab: bool,
client_id: ClientId,
+ completion_tx: Option<NotificationEnd>,
},
ListClientsToPlugin(PluginId, ClientId),
TogglePanePinned(ClientId, Option<NotificationEnd>),
@@ -673,6 +687,8 @@ impl From<&ScreenInstruction> for ScreenContext {
ScreenInstruction::SaveSession(..) => ScreenContext::SaveSession,
ScreenInstruction::DumpLayoutToPlugin { .. } => ScreenContext::DumpLayoutToPlugin,
ScreenInstruction::GetFocusedPaneInfo { .. } => ScreenContext::GetFocusedPaneInfo,
+ ScreenInstruction::GetPaneInfo { .. } => ScreenContext::GetPaneInfo,
+ ScreenInstruction::GetTabInfo { .. } => ScreenContext::GetTabInfo,
ScreenInstruction::EditScrollback(..) => ScreenContext::EditScrollback,
ScreenInstruction::GetPaneScrollback { .. } => ScreenContext::GetPaneScrollback,
ScreenInstruction::ScrollUp(..) => ScreenContext::ScrollUp,
@@ -788,6 +804,7 @@ impl From<&ScreenInstruction> for ScreenContext {
},
ScreenInstruction::RenameSession(..) => ScreenContext::RenameSession,
ScreenInstruction::ListClientsMetadata(..) => ScreenContext::ListClientsMetadata,
+ ScreenInstruction::ListPanes { .. } => ScreenContext::ListPanes,
ScreenInstruction::Reconfigure { .. } => ScreenContext::Reconfigure,
ScreenInstruction::RerunCommandPane { .. } => ScreenContext::RerunCommandPane,
ScreenInstruction::ResizePaneWithId(..) => ScreenContext::ResizePaneWithId,
@@ -1131,11 +1148,6 @@ impl Screen {
}
}
- /// Generates the next available stable tab ID.
- ///
- /// IDs are monotonically increasing and never reused, even after tabs are closed.
- /// Currently, this is one more than the last currently existing tab ID, or `0` if
- /// no tabs exist in this screen yet.
fn get_new_tab_id(&self) -> usize {
if let Some(id) = self.tabs.keys().last() {
*id + 1
@@ -2247,6 +2259,43 @@ impl Screen {
Ok(pane_manifest)
}
+
+ fn collect_pane_list(&self, show_all: bool) -> Result<ListPanesResponse> {
+ fn should_include_pane(pane_info: &PaneInfo, show_all: bool) -> bool {
+ pane_info.is_selectable || show_all
+ }
+
+ fn create_pane_list_entry(pane_info: PaneInfo, tab: &crate::tab::Tab) -> PaneListEntry {
+ PaneListEntry {
+ pane_info,
+ tab_id: tab.id,
+ tab_position: tab.position,
+ tab_name: tab.name.clone(),
+ pane_command: None,
+ pane_cwd: None,
+ }
+ }
+
+ fn sort_panes_by_tab_and_type(pane_entries: &mut [PaneListEntry]) {
+ pane_entries.sort_by_key(|e| (e.tab_position, !e.pane_info.is_plugin, e.pane_info.id));
+ }
+
+ let mut pane_entries = Vec::new();
+
+ for tab in self.tabs.values() {
+ let pane_infos = tab.pane_infos();
+
+ for pane_info in pane_infos {
+ if should_include_pane(&pane_info, show_all) {
+ pane_entries.push(create_pane_list_entry(pane_info, tab));
+ }
+ }
+ }
+
+ sort_panes_by_tab_and_type(&mut pane_entries);
+ Ok(pane_entries)
+ }
+
fn log_and_report_session_state(&mut self, skip_querying_layouts: bool) -> Result<()> {
let err_context = || format!("Failed to log and report session state");
@@ -2702,6 +2751,7 @@ impl Screen {
move_to_focused_tab: bool,
should_be_in_place: bool,
client_id: ClientId,
+ completion_tx: &mut Option<NotificationEnd>,
) -> Result<bool> {
// true => found and focused, false => not
let err_context = || format!("failed to focus_plugin_pane");
@@ -2741,6 +2791,10 @@ impl Screen {
Some(client_id),
)?;
}
+ // Set affected pane ID for CLI client output
+ if let Some(ref mut completion) = completion_tx {
+ completion.set_affected_pane_id(pane_id);
+ }
return Ok(true);
}
match tab_index_and_plugin_pane_id {
@@ -2753,6 +2807,10 @@ impl Screen {
.context("failed to focus plugin pane")?;
self.log_and_report_session_state(false)
.with_context(err_context)?;
+ // Set affected pane ID for CLI client output
+ if let Some(ref mut completion) = completion_tx {
+ completion.set_affected_pane_id(plugin_pane_id);
+ }
Ok(true)
},
None => Ok(false),
@@ -2902,7 +2960,7 @@ impl Screen {
should_change_focus_to_new_tab: bool,
new_tab_name: Option<String>,
client_id: ClientId,
- ) -> Result<()> {
+ ) -> Result<usize> {
let err_context = || "failed break multiple panes to a new tab".to_string();
let all_tabs = self.get_tabs_mut();
@@ -2960,7 +3018,7 @@ impl Screen {
(client_id, is_web_client),
None,
))?;
- Ok(())
+ Ok(tab_index)
}
pub fn break_pane_to_new_tab(
&mut self,
@@ -3713,6 +3771,54 @@ impl Screen {
active_tab.get_active_pane_id(*client_id)
}
+ fn get_pane_info(&self, pane_id: PaneId) -> Option<PaneInfo> {
+ // Search through all tabs to find the pane
+ for tab in self.tabs.values() {
+ if let Some(pane_info) = tab.get_pane_info(pane_id) {
+ return Some(pane_info);
+ }
+ }
+ None
+ }
+
+ fn get_tab_info(&self, tab_id: usize) -> Option<TabInfo> {
+ // Look up tab by its stable ID
+ self.tabs.get(&tab_id).map(|tab| {
+ let all_focused_clients: Vec<ClientId> = self
+ .active_tab_ids
+ .iter()
+ .filter(|(_c_id, active_tab_id)| **active_tab_id == tab.id)
+ .map(|(c_id, _)| c_id)
+ .copied()
+ .collect();
+ let (active_swap_layout_name, is_swap_layout_dirty) = tab.swap_layout_info();
+ let tab_viewport = tab.get_viewport();
+ let tab_display_area = tab.get_display_area();
+ let selectable_tiled_panes_count = tab.get_selectable_tiled_panes_count();
+ let selectable_floating_panes_count = tab.get_selectable_floating_panes_count();
+
+ TabInfo {
+ position: tab.position,
+ name: tab.name.clone(),
+ active: self.active_tab_ids.values().any(|i| i == &tab.id),
+ panes_to_hide: tab.panes_to_hide_count(),
+ is_fullscreen_active: tab.is_fullscreen_active(),
+ is_sync_panes_active: tab.is_sync_panes_active(),
+ are_floating_panes_visible: tab.are_floating_panes_visible(),
+ other_focused_clients: all_focused_clients,
+ active_swap_layout_name,
+ is_swap_layout_dirty,
+ viewport_rows: tab_viewport.rows,
+ viewport_columns: tab_viewport.cols,
+ display_area_rows: tab_display_area.rows,
+ display_area_columns: tab_display_area.cols,
+ selectable_tiled_panes_count,
+ selectable_floating_panes_count,
+ tab_id: tab.id,
+ }
+ })
+ }
+
fn group_and_ungroup_panes(
&mut self,
pane_ids_to_group: Vec<PaneId>,
@@ -4446,6 +4552,16 @@ pub(crate) fn screen_thread_main(
))
.with_context(err_context)?;
},
+ ScreenInstruction::ListPanes {
+ show_all,
+ response_channel,
+ } => {
+ let err_context = || "Failed to list panes";
+ let pane_entries = screen
+ .collect_pane_list(show_all)
+ .with_context(err_context)?;
+ let _ = response_channel.send(pane_entries);
+ },
ScreenInstruction::DumpLayoutToPlugin {
plugin_id,
tab_index,
@@ -4487,6 +4603,20 @@ pub(crate) fn screen_thread_main(
};
let _ = response_channel.send(response);
},
+ ScreenInstruction::GetPaneInfo {
+ pane_id,
+ response_channel,
+ } => {
+ let pane_info = screen.get_pane_info(pane_id);
+ let _ = response_channel.send(pane_info);
+ },
+ ScreenInstruction::GetTabInfo {
+ tab_id,
+ response_channel,
+ } => {
+ let tab_info = screen.get_tab_info(tab_id);
+ let _ = response_channel.send(tab_info);
+ },
ScreenInstruction::ListClientsToPlugin(plugin_id, client_id) => {
let err_context = || format!("Failed to dump layout");
let session_layout_metadata =
@@ -4999,6 +5129,10 @@ pub(crate) fn screen_thread_main(
.as_mut()
.map(|c| c.set_affected_pane_id(PaneId::Terminal(first_terminal_pane.0)));
}
+ // Set the affected tab ID for plugin API return value
+ completion_tx
+ .as_mut()
+ .map(|c| c.set_affected_tab_id(tab_id));
screen.apply_layout(
layout,
floating_panes_layout,
@@ -5108,7 +5242,7 @@ pub(crate) fn screen_thread_main(
default_shell,
create,
client_id,
- completion_tx,
+ mut completion_tx,
) => {
let client_id = if client_id.is_none() {
None
@@ -5129,6 +5263,16 @@ pub(crate) fn screen_thread_main(
.unwrap_or(false);
if let Ok(tab_exists) = screen.go_to_tab_name(tab_name.clone(), client_id) {
screen.render(None)?;
+ if tab_exists {
+ // Tab already exists - find its ID and set in completion
+ if let Some(existing_tab) =
+ screen.tabs.values().find(|t| t.name == tab_name)
+ {
+ completion_tx
+ .as_mut()
+ .map(|c| c.set_affected_tab_id(existing_tab.id));
+ }
+ }
if create && !tab_exists {
let tab_index = screen.get_new_tab_id();
let should_change_focus_to_new_tab = true;
@@ -5818,7 +5962,7 @@ pub(crate) fn screen_thread_main(
floating_pane_coordinates,
should_focus_plugin,
client_id,
- completion_tx,
+ mut completion_tx,
) => {
let close_replaced_pane = false; // TODO: support this
let mut new_pane_placement = NewPanePlacement::default();
@@ -5870,6 +6014,11 @@ pub(crate) fn screen_thread_main(
});
let run_plugin = Run::Plugin(run_plugin_or_alias);
+ // Set affected pane ID for CLI client output
+ if let Some(ref mut completion) = completion_tx {
+ completion.set_affected_pane_id(PaneId::Plugin(plugin_id));
+ }
+
let close_replaced_pane = false;
if should_be_in_place {
if let Some(pane_id_to_replace) = pane_id_to_replace {
@@ -5976,7 +6125,7 @@ pub(crate) fn screen_thread_main(
pane_id_to_replace,
skip_cache,
client_id,
- completion_tx,
+ mut completion_tx,
) => match pane_id_to_replace {
Some(pane_id_to_replace) if should_open_in_place => {
match screen.active_tab_ids.values().next() {
@@ -6028,6 +6177,7 @@ pub(crate) fn screen_thread_main(
move_to_focused_tab,
should_open_in_place,
client_id,
+ &mut completion_tx,
)? {
screen.render(None)?;
screen.log_and_report_session_state(false)?;
@@ -6695,14 +6845,19 @@ pub(crate) fn screen_thread_main(
should_change_focus_to_new_tab,
new_tab_name,
client_id,
+ mut completion_tx,
} => {
- screen.break_multiple_panes_to_new_tab(
+ let tab_id = screen.break_multiple_panes_to_new_tab(
pane_ids,
default_shell,
should_change_focus_to_new_tab,
new_tab_name,
client_id,
)?;
+ // Set affected tab ID for plugin API return value
+ completion_tx
+ .as_mut()
+ .map(|c| c.set_affected_tab_id(tab_id));
// TODO: is this a race?
let pane_group = screen.get_client_pane_group(&client_id);
if !pane_group.is_empty() {
@@ -6720,13 +6875,19 @@ pub(crate) fn screen_thread_main(
tab_index,
should_change_focus_to_new_tab,
client_id,
+ mut completion_tx,
} => {
+ // tab_index is the target tab ID
screen.break_multiple_panes_to_tab_with_index(
pane_ids,
tab_index,
should_change_focus_to_new_tab,
client_id,
)?;
+ // Set affected tab ID (tab_index is the ID here)
+ completion_tx
+ .as_mut()
+ .map(|c| c.set_affected_tab_id(tab_index));
let pane_group = screen.get_client_pane_group(&client_id);
if !pane_group.is_empty() {
let _ = screen.bus.senders.send_to_background_jobs(
diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs
index dcb57491..2b061c11 100644
--- a/zellij-server/src/tab/mod.rs
+++ b/zellij-server/src/tab/mod.rs
@@ -3538,6 +3538,44 @@ impl Tab {
.copied()
.collect()
}
+ pub fn get_pane_info(&self, pane_id: PaneId) -> Option<PaneInfo> {
+ let current_pane_group: HashMap<ClientId, Vec<PaneId>> =
+ { self.current_pane_group.borrow().clone_inner() };
+
+ // Check tiled panes
+ if let Some(pane) = self.tiled_panes.get_pane(pane_id) {
+ let mut info = pane_info_for_pane(&pane_id, pane, &current_pane_group);
+ // Note: is_focused will be false since we don't have a specific client_id context
+ // Plugins calling this API would need to compare the pane_id with their own focused pane
+ info.is_focused = false;
+ info.is_fullscreen = self.tiled_panes.fullscreen_is_active();
+ info.is_floating = false;
+ info.is_suppressed = false;
+ return Some(info);
+ }
+
+ // Check floating panes
+ if let Some(pane) = self.floating_panes.get_pane(pane_id) {
+ let mut info = pane_info_for_pane(&pane_id, pane, &current_pane_group);
+ info.is_focused = false;
+ info.is_fullscreen = false;
+ info.is_floating = true;
+ info.is_suppressed = false;
+ return Some(info);
+ }
+
+ // Check suppressed panes
+ if let Some((_previous_id, pane)) = self.suppressed_panes.get(&pane_id) {
+ let mut info = pane_info_for_pane(&pane_id, pane, &current_pane_group);
+ info.is_focused = false;
+ info.is_fullscreen = false;
+ info.is_floating = false;
+ info.is_suppressed = true;
+ return Some(info);
+ }
+
+ None
+ }
pub fn set_pane_selectable(&mut self, id: PaneId, selectable: bool) {
if self.is_pending {
self.pending_instructions
diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_default_parameters.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_default_parameters.snap
index 44594fdc..2a2c8a4f 100644
--- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_default_parameters.snap
+++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_default_parameters.snap
@@ -2,4 +2,4 @@
source: zellij-server/src/./unit/screen_tests.rs
expression: "format!(\"{:?}\", *received_pty_instructions.lock().unwrap())"
---
-[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(Some(OpenFile(OpenFilePayload { path: "/file/to/edit", line_number: None, cwd: Some("."), originating_plugin: None })), Some("Editing: /file/to/edit"), Tiled { direction: None, borderless: None }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None }), false), Exit]
+[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(Some(OpenFile(OpenFilePayload { path: "/file/to/edit", line_number: None, cwd: Some("."), originating_plugin: None })), Some("Editing: /file/to/edit"), Tiled { direction: None, borderless: None }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None, affected_tab_id: None }), false), Exit]
diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_line_number.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_line_number.snap
index eb4e7ad7..b93701a2 100644
--- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_line_number.snap
+++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_line_number.snap
@@ -2,4 +2,4 @@
source: zellij-server/src/./unit/screen_tests.rs
expression: "format!(\"{:?}\", *received_pty_instructions.lock().unwrap())"
---
-[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(Some(OpenFile(OpenFilePayload { path: "/file/to/edit", line_number: Some(100), cwd: Some("."), originating_plugin: None })), Some("Editing: /file/to/edit"), Tiled { direction: None, borderless: None }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None }), false), Exit]
+[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(Some(OpenFile(OpenFilePayload { path: "/file/to/edit", line_number: Some(100), cwd: Some("."), originating_plugin: None })), Some("Editing: /file/to/edit"), Tiled { direction: None, borderless: None }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None, affected_tab_id: None }), false), Exit]
diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_split_direction.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_split_direction.snap
index e6adbc55..1c61a5c4 100644
--- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_split_direction.snap
+++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_edit_action_with_split_direction.snap
@@ -2,4 +2,4 @@
source: zellij-server/src/./unit/screen_tests.rs
expression: "format!(\"{:?}\", *received_pty_instructions.lock().unwrap())"
---
-[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(Some(OpenFile(OpenFilePayload { path: "/file/to/edit", line_number: None, cwd: Some("."), originating_plugin: None })), Some("Editing: /file/to/edit"), Tiled { direction: Some(Down), borderless: None }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None }), false), Exit]
+[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(Some(OpenFile(OpenFilePayload { path: "/file/to/edit", line_number: None, cwd: Some("."), originating_plugin: None })), Some("Editing: /file/to/edit"), Tiled { direction: Some(Down), borderless: None }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None, affected_tab_id: None }), false), Exit]
diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_launch_or_focus_plugin_action.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_launch_or_focus_plugin_action.snap
index 2428bce0..adb6d614 100644
--- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_launch_or_focus_plugin_action.snap
+++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_launch_or_focus_plugin_action.snap
@@ -38,6 +38,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),
diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_command_and_cwd.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_command_and_cwd.snap
index a69e3b93..3004bba7 100644
--- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_command_and_cwd.snap
+++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_command_and_cwd.snap
@@ -2,4 +2,4 @@
source: zellij-server/src/./unit/screen_tests.rs
expression: "format!(\"{:?}\", new_pane_instruction)"
---
-Some(SpawnTerminal(Some(RunCommand(RunCommand { command: "htop", args: [], cwd: Some("/some/folder"), hold_on_close: true, hold_on_start: false, originating_plugin: None, use_terminal_title: false })), None, Tiled { direction: Some(Right), borderless: Some(false) }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None }), false))
+Some(SpawnTerminal(Some(RunCommand(RunCommand { command: "htop", args: [], cwd: Some("/some/folder"), hold_on_close: true, hold_on_start: false, originating_plugin: None, use_terminal_title: false })), None, Tiled { direction: Some(Right), borderless: Some(false) }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None, affected_tab_id: None }), false))
diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_default_parameters.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_default_parameters.snap
index d72dcdf5..345421ea 100644
--- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_default_parameters.snap
+++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_default_parameters.snap
@@ -2,4 +2,4 @@
source: zellij-server/src/./unit/screen_tests.rs
expression: "format!(\"{:?}\", *received_pty_instructions.lock().unwrap())"
---
-[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(None, None, Tiled { direction: None, borderless: Some(false) }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None }), false), Exit]
+[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(None, None, Tiled { direction: None, borderless: Some(false) }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None, affected_tab_id: None }), false), Exit]
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 bd120b83..e11a9f23 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
@@ -2,4 +2,4 @@
source: zellij-server/src/./unit/screen_tests.rs
expression: "format!(\"{:?}\", *received_pty_instructions.lock().unwrap())"
---
-[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(Some(RunCommand(RunCommand { command: "htop", args: [], cwd: Some("/some/folder"), hold_on_close: true, hold_on_start: false, originating_plugin: None, use_terminal_title: false })), None, Floating(Some(FloatingPaneCoordinates { x: Some(Fixed(10)), y: None, width: Some(Percent(20)), height: None, pinned: None, borderless: Some(false) })), false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None }), false), Exit]
+[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(Some(RunCommand(RunCommand { command: "htop", args: [], cwd: Some("/some/folder"), hold_on_close: true, hold_on_start: false, originating_plugin: None, use_terminal_title: false })), None, Floating(Some(FloatingPaneCoordinates { x: Some(Fixed(10)), y: None, width: Some(Percent(20)), height: None, pinned: None, borderless: Some(false) })), false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None, affected_tab_id: None }), false), Exit]
diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_split_direction.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_split_direction.snap
index 73319df7..04dde5a4 100644
--- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_split_direction.snap
+++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_pane_action_with_split_direction.snap
@@ -2,4 +2,4 @@
source: zellij-server/src/./unit/screen_tests.rs
expression: "format!(\"{:?}\", *received_pty_instructions.lock().unwrap())"
---
-[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(None, None, Tiled { direction: Some(Right), borderless: Some(false) }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None }), false), Exit]
+[UpdateActivePane(Some(Terminal(0)), 1), UpdateActivePane(Some(Terminal(0)), 1), SpawnTerminal(None, None, Tiled { direction: Some(Right), borderless: Some(false) }, false, ClientId(10), Some(NotificationEnd { channel: None, exit_status: None, unblock_condition: None, affected_pane_id: None, affected_tab_id: None }), false), Exit]
diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_tab_action_with_name_and_layout.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_tab_action_with_name_and_layout.snap
index d53509f4..b3be2b93 100644
--- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_tab_action_with_name_and_layout.snap
+++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_new_tab_action_with_name_and_layout.snap
@@ -103,6 +103,7 @@ NewTab(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
)
diff --git a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_query_tab_names_action.snap b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_query_tab_names_action.snap
index 5c157762..e38487fa 100644
--- a/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_query_tab_names_action.snap
+++ b/zellij-server/src/unit/snapshots/zellij_server__screen__screen_tests__send_cli_query_tab_names_action.snap
@@ -15,6 +15,7 @@ Some(
exit_status: None,
unblock_condition: None,
affected_pane_id: None,
+ affected_tab_id: None,
},
),
),