aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/plugin_api/plugin_command.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-02-29 16:26:25 +0100
committerGitHub <noreply@github.com>2024-02-29 16:26:25 +0100
commit896b09aa6f9190b4dc838314b028b63e0f2461b7 (patch)
tree80aeda55e00e51dfc3d0fd8b6b4f6e6bbf493efd /zellij-utils/src/plugin_api/plugin_command.rs
parentdocs(changelog): pipe to plugin id (diff)
downloadsl0ppij-896b09aa6f9190b4dc838314b028b63e0f2461b7.tar.gz
sl0ppij-896b09aa6f9190b4dc838314b028b63e0f2461b7.tar.xz
sl0ppij-896b09aa6f9190b4dc838314b028b63e0f2461b7.zip
feat(plugins): allow specifying the cwd when switching sessions (#3172)
* feat(plugins): allow specifying the cwd when switching sessions * style(fmt): rustfmt
Diffstat (limited to 'zellij-utils/src/plugin_api/plugin_command.rs')
-rw-r--r--zellij-utils/src/plugin_api/plugin_command.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/plugin_command.rs b/zellij-utils/src/plugin_api/plugin_command.rs
index 6ce7422e..ab9d5294 100644
--- a/zellij-utils/src/plugin_api/plugin_command.rs
+++ b/zellij-utils/src/plugin_api/plugin_command.rs
@@ -689,6 +689,7 @@ impl TryFrom<ProtobufPluginCommand> for PluginCommand {
tab_position: payload.tab_position.map(|p| p as usize),
pane_id,
layout: payload.layout.and_then(|l| l.try_into().ok()),
+ cwd: payload.cwd.map(|c| PathBuf::from(c)),
}))
},
_ => Err("Mismatched payload for SwitchSession"),
@@ -1222,6 +1223,7 @@ impl TryFrom<PluginCommand> for ProtobufPluginCommand {
pane_id: switch_to_session.pane_id.map(|p| p.0),
pane_id_is_plugin: switch_to_session.pane_id.map(|p| p.1),
layout: switch_to_session.layout.and_then(|l| l.try_into().ok()),
+ cwd: switch_to_session.cwd.map(|c| c.display().to_string()),
})),
}),
PluginCommand::OpenTerminalInPlace(cwd) => Ok(ProtobufPluginCommand {