aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/data.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-02-17 15:43:28 +0100
committerGitHub <noreply@github.com>2026-02-17 15:43:28 +0100
commit4e66a0beff5e41bda1dbde521fa1d2858c46fe7b (patch)
tree380bee5eeac56bea2ebf341cccbe69615585e394 /zellij-utils/src/data.rs
parentFix startup message and cache file creation (#4705) (diff)
downloadsl0ppij-4e66a0beff5e41bda1dbde521fa1d2858c46fe7b.tar.gz
sl0ppij-4e66a0beff5e41bda1dbde521fa1d2858c46fe7b.tar.xz
sl0ppij-4e66a0beff5e41bda1dbde521fa1d2858c46fe7b.zip
Revamp the sequence plugin (#4713)
* initial pipe interface * initial open_x_pane_in_new_tab plugin api implementation * fix: send CommandPaneExited for command panes opened as initial_terminals in new tabs from plugins * open panes in place of specific pane id plugin commands - initial implementation * sequence and plugin api ux * focus self when starting * combine ui and pipe paths * highlight selected pane * initial sequence removal of editing capabilities * fix: translate plugin paths in api * properly trim commands when loaded from pipe or pasted text * minor ux fixes * get ctrl c to work properly * behavior fixes * more ui fixes * fix tests * close tab and end sequence properly * default to AND * zellij sequence alias * add alias * consolidate paths * rustfmt * fix ui padding * add pr * fix: reset scrolling when resetting terminal state
Diffstat (limited to 'zellij-utils/src/data.rs')
-rw-r--r--zellij-utils/src/data.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/zellij-utils/src/data.rs b/zellij-utils/src/data.rs
index b770eee0..675cbcfe 100644
--- a/zellij-utils/src/data.rs
+++ b/zellij-utils/src/data.rs
@@ -54,6 +54,7 @@ impl UnblockCondition {
pub enum CommandOrPlugin {
Command(RunCommandAction),
Plugin(RunPluginOrAlias),
+ File(FileToOpen), // open file in configured editor
}
impl CommandOrPlugin {
@@ -2622,7 +2623,7 @@ pub enum PermissionStatus {
Denied,
}
-#[derive(Debug, Default, Clone)]
+#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct FileToOpen {
pub path: PathBuf,
pub line_number: Option<usize>,
@@ -3450,6 +3451,23 @@ pub enum PluginCommand {
GetPaneInfo(PaneId),
GetTabInfo(usize), // tab_id
GetSessionEnvironmentVariables,
+ OpenCommandPaneInNewTab(CommandToRun, Context),
+ OpenPluginPaneInNewTab {
+ plugin_url: String,
+ configuration: BTreeMap<String, String>,
+ context: Context,
+ },
+ OpenEditorPaneInNewTab(FileToOpen, Context),
+ OpenCommandPaneInPlaceOfPaneId(PaneId, CommandToRun, bool, Context), // bool = close_replaced_pane
+ OpenTerminalPaneInPlaceOfPaneId(PaneId, FileToOpen, bool),
+ OpenEditPaneInPlaceOfPaneId(PaneId, FileToOpen, bool, Context),
+}
+
+// Response type for plugin API methods that open a pane in a new tab
+#[derive(Debug, Clone, Default, Serialize, Deserialize)]
+pub struct OpenPaneInNewTabResponse {
+ pub tab_id: Option<usize>,
+ pub pane_id: Option<PaneId>,
}
// Response types for plugin API methods that create tabs
@@ -3482,3 +3500,6 @@ pub type OpenCommandPaneNearPluginResponse = Option<PaneId>;
pub type OpenCommandPaneFloatingNearPluginResponse = Option<PaneId>;
pub type OpenCommandPaneInPlaceOfPluginResponse = Option<PaneId>;
pub type OpenCommandPaneBackgroundResponse = Option<PaneId>;
+pub type OpenCommandPaneInPlaceOfPaneIdResponse = Option<PaneId>;
+pub type OpenTerminalPaneInPlaceOfPaneIdResponse = Option<PaneId>;
+pub type OpenEditPaneInPlaceOfPaneIdResponse = Option<PaneId>;