aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/plugin_api/plugin_command.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2023-11-05 15:32:05 +0100
committerGitHub <noreply@github.com>2023-11-05 15:32:05 +0100
commit28a165a969a9e1ee9f1fe66e4d63134b895b2ef7 (patch)
tree678ec1cd9d536d9cb7fcdb071e27cf12caf43afb /zellij-utils/src/plugin_api/plugin_command.rs
parentdocs(changelog): styled underlines (diff)
downloadsl0ppij-28a165a969a9e1ee9f1fe66e4d63134b895b2ef7.tar.gz
sl0ppij-28a165a969a9e1ee9f1fe66e4d63134b895b2ef7.tar.xz
sl0ppij-28a165a969a9e1ee9f1fe66e4d63134b895b2ef7.zip
feat(ux): allow renaming sessions (#2903)
* change session name through the cli * change session name from the session-manager * style(fmt): rustfmt
Diffstat (limited to 'zellij-utils/src/plugin_api/plugin_command.rs')
-rw-r--r--zellij-utils/src/plugin_api/plugin_command.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/plugin_command.rs b/zellij-utils/src/plugin_api/plugin_command.rs
index 6b70b18e..ed476687 100644
--- a/zellij-utils/src/plugin_api/plugin_command.rs
+++ b/zellij-utils/src/plugin_api/plugin_command.rs
@@ -635,6 +635,12 @@ impl TryFrom<ProtobufPluginCommand> for PluginCommand {
_ => Err("Mismatched payload for DeleteDeadSession"),
},
Some(CommandName::DeleteAllDeadSessions) => Ok(PluginCommand::DeleteAllDeadSessions),
+ Some(CommandName::RenameSession) => match protobuf_plugin_command.payload {
+ Some(Payload::RenameSessionPayload(new_session_name)) => {
+ Ok(PluginCommand::RenameSession(new_session_name))
+ },
+ _ => Err("Mismatched payload for RenameSession"),
+ },
None => Err("Unrecognized plugin command"),
}
}
@@ -1059,6 +1065,10 @@ impl TryFrom<PluginCommand> for ProtobufPluginCommand {
name: CommandName::DeleteAllDeadSessions as i32,
payload: None,
}),
+ PluginCommand::RenameSession(new_session_name) => Ok(ProtobufPluginCommand {
+ name: CommandName::RenameSession as i32,
+ payload: Some(Payload::RenameSessionPayload(new_session_name)),
+ }),
}
}
}