summaryrefslogtreecommitdiffstats
path: root/zellij-utils
diff options
context:
space:
mode:
Diffstat (limited to 'zellij-utils')
-rw-r--r--zellij-utils/assets/prost/api.plugin_command.rs3
-rw-r--r--zellij-utils/src/data.rs1
-rw-r--r--zellij-utils/src/plugin_api/plugin_command.proto1
-rw-r--r--zellij-utils/src/plugin_api/plugin_command.rs8
4 files changed, 13 insertions, 0 deletions
diff --git a/zellij-utils/assets/prost/api.plugin_command.rs b/zellij-utils/assets/prost/api.plugin_command.rs
index ca067fd97..3bf49d36d 100644
--- a/zellij-utils/assets/prost/api.plugin_command.rs
+++ b/zellij-utils/assets/prost/api.plugin_command.rs
@@ -421,6 +421,7 @@ pub enum CommandName {
ScanHostFolder = 82,
WatchFilesystem = 83,
DumpSessionLayout = 84,
+ CloseSelf = 85,
}
impl CommandName {
/// String value of the enum field names used in the ProtoBuf definition.
@@ -514,6 +515,7 @@ impl CommandName {
CommandName::ScanHostFolder => "ScanHostFolder",
CommandName::WatchFilesystem => "WatchFilesystem",
CommandName::DumpSessionLayout => "DumpSessionLayout",
+ CommandName::CloseSelf => "CloseSelf",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -604,6 +606,7 @@ impl CommandName {
"ScanHostFolder" => Some(Self::ScanHostFolder),
"WatchFilesystem" => Some(Self::WatchFilesystem),
"DumpSessionLayout" => Some(Self::DumpSessionLayout),
+ "CloseSelf" => Some(Self::CloseSelf),
_ => None,
}
}
diff --git a/zellij-utils/src/data.rs b/zellij-utils/src/data.rs
index 78fbbd770..b0e0a8861 100644
--- a/zellij-utils/src/data.rs
+++ b/zellij-utils/src/data.rs
@@ -1379,4 +1379,5 @@ pub enum PluginCommand {
ScanHostFolder(PathBuf), // TODO: rename to ScanHostFolder
WatchFilesystem,
DumpSessionLayout,
+ CloseSelf,
}
diff --git a/zellij-utils/src/plugin_api/plugin_command.proto b/zellij-utils/src/plugin_api/plugin_command.proto
index b05c8ac8a..b961593e7 100644
--- a/zellij-utils/src/plugin_api/plugin_command.proto
+++ b/zellij-utils/src/plugin_api/plugin_command.proto
@@ -96,6 +96,7 @@ enum CommandName {
ScanHostFolder = 82;
WatchFilesystem = 83;
DumpSessionLayout = 84;
+ CloseSelf = 85;
}
message PluginCommand {
diff --git a/zellij-utils/src/plugin_api/plugin_command.rs b/zellij-utils/src/plugin_api/plugin_command.rs
index 232a9f2dc..080dd9e28 100644
--- a/zellij-utils/src/plugin_api/plugin_command.rs
+++ b/zellij-utils/src/plugin_api/plugin_command.rs
@@ -871,6 +871,10 @@ impl TryFrom<ProtobufPluginCommand> for PluginCommand {
Some(_) => Err("DumpSessionLayout should have no payload, found a payload"),
None => Ok(PluginCommand::DumpSessionLayout),
},
+ Some(CommandName::CloseSelf) => match protobuf_plugin_command.payload {
+ Some(_) => Err("CloseSelf should have no payload, found a payload"),
+ None => Ok(PluginCommand::CloseSelf),
+ },
None => Err("Unrecognized plugin command"),
}
}
@@ -1389,6 +1393,10 @@ impl TryFrom<PluginCommand> for ProtobufPluginCommand {
name: CommandName::DumpSessionLayout as i32,
payload: None,
}),
+ PluginCommand::CloseSelf => Ok(ProtobufPluginCommand {
+ name: CommandName::CloseSelf as i32,
+ payload: None,
+ }),
}
}
}