aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-server/src/plugins
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-03-30 16:02:09 +0200
committerGitHub <noreply@github.com>2026-03-30 16:02:09 +0200
commit8ce05f0bbd58acbbca95f95ae14fdc4e866f7391 (patch)
tree57c6d9ee2231a556f938df4f2629511a711518df /zellij-server/src/plugins
parentdocs(changelog): recent windows fixes (diff)
downloadsl0ppij-8ce05f0bbd58acbbca95f95ae14fdc4e866f7391.tar.gz
sl0ppij-8ce05f0bbd58acbbca95f95ae14fdc4e866f7391.tar.xz
sl0ppij-8ce05f0bbd58acbbca95f95ae14fdc4e866f7391.zip
Layout string flag (#4956)
* allow sending a stringified layout with --layout-string * add --tab-id to all the things * fix windows tests * add pr
Diffstat (limited to 'zellij-server/src/plugins')
-rw-r--r--zellij-server/src/plugins/wasm_bridge.rs21
-rw-r--r--zellij-server/src/plugins/zellij_exports.rs11
2 files changed, 28 insertions, 4 deletions
diff --git a/zellij-server/src/plugins/wasm_bridge.rs b/zellij-server/src/plugins/wasm_bridge.rs
index 47b6e493..31d7e74b 100644
--- a/zellij-server/src/plugins/wasm_bridge.rs
+++ b/zellij-server/src/plugins/wasm_bridge.rs
@@ -287,7 +287,7 @@ impl WasmBridge {
skip_cache: bool,
client_id: Option<ClientId>,
) -> Result<(PluginId, ClientId)> {
- let err_context = move || format!("failed to load plugin");
+ let _err_context = move || format!("failed to load plugin");
let client_id = client_id
.and_then(|client_id| {
@@ -321,9 +321,22 @@ impl WasmBridge {
match run {
Some(run) => {
- let plugin = PluginConfig::from_run_plugin(run)
- .with_context(|| format!("failed to resolve plugin {run:?}"))
- .with_context(err_context)?;
+ let plugin = match PluginConfig::from_run_plugin(run) {
+ Some(plugin) => plugin,
+ None => {
+ self.next_plugin_id += 1;
+ let mut loading_indication =
+ LoadingIndication::new(run.location.to_string());
+ handle_plugin_loading_failure(
+ &self.senders,
+ plugin_id,
+ &mut loading_indication,
+ format!("Failed to resolve plugin: {}", run.location),
+ Some(client_id),
+ );
+ return Ok((plugin_id, client_id));
+ },
+ };
let plugin_name = run.location.to_string();
self.cached_events_for_pending_plugins
diff --git a/zellij-server/src/plugins/zellij_exports.rs b/zellij-server/src/plugins/zellij_exports.rs
index 026be937..24113d0b 100644
--- a/zellij-server/src/plugins/zellij_exports.rs
+++ b/zellij-server/src/plugins/zellij_exports.rs
@@ -1164,6 +1164,7 @@ fn open_plugin_pane_floating(
skip_cache: false,
cwd: Some(env.plugin_cwd.clone()),
coordinates: floating_pane_coordinates,
+ tab_id: None,
};
let error_msg = || format!("Failed to open floating plugin pane");
let result = apply_action!(action, error_msg, env);
@@ -1403,6 +1404,7 @@ fn open_file(env: &PluginEnv, file_to_open: FileToOpen, context: BTreeMap<String
start_suppressed,
coordinates: None,
near_current_pane: false,
+ tab_id: None,
};
let result = apply_action!(action, error_msg, env);
@@ -1505,6 +1507,7 @@ fn open_file_floating(
start_suppressed,
coordinates: floating_pane_coordinates,
near_current_pane: false,
+ tab_id: None,
};
let result = apply_action!(action, error_msg, env);
@@ -1545,6 +1548,7 @@ fn open_file_in_place(
start_suppressed,
coordinates: None,
near_current_pane: false,
+ tab_id: None,
};
let result = apply_action!(action, error_msg, env);
@@ -1705,6 +1709,7 @@ fn open_terminal(env: &PluginEnv, cwd: PathBuf) {
pane_name: None,
near_current_pane: false,
borderless: None,
+ tab_id: None,
};
let result = apply_action!(action, error_msg, env);
@@ -1780,6 +1785,7 @@ fn open_terminal_floating(
pane_name: None,
coordinates: floating_pane_coordinates,
near_current_pane: false,
+ tab_id: None,
};
let result = apply_action!(action, error_msg, env);
@@ -1855,6 +1861,7 @@ fn open_terminal_in_place(env: &PluginEnv, cwd: PathBuf) {
near_current_pane: false,
pane_id_to_replace: None,
close_replaced_pane: false,
+ tab_id: None,
};
let result = apply_action!(action, error_msg, env);
@@ -2139,6 +2146,7 @@ fn open_command_pane(
pane_name: name,
near_current_pane: false,
borderless: None,
+ tab_id: None,
};
let result = apply_action!(action, error_msg, env);
@@ -2246,6 +2254,7 @@ fn open_command_pane_floating(
pane_name: name,
coordinates: floating_pane_coordinates,
near_current_pane: false,
+ tab_id: None,
};
let result = apply_action!(action, error_msg, env);
@@ -2356,6 +2365,7 @@ fn open_command_pane_in_place(
near_current_pane: false,
pane_id_to_replace: None,
close_replaced_pane: false,
+ tab_id: None,
};
let result = apply_action!(action, error_msg, env);
@@ -4423,6 +4433,7 @@ fn try_edit_layout(
start_suppressed: false,
coordinates: None,
near_current_pane: true,
+ tab_id: None,
};
// Route the action - this is fallible