aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-tile
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-10-22 15:27:40 +0200
committerGitHub <noreply@github.com>2024-10-22 15:27:40 +0200
commitd671ab650e231d353a05a2808c0984e952de38c4 (patch)
tree38a0604f9b4b20adfed5cf3e8324c59fbdf1ff2b /zellij-tile
parentdocs(changelog): wasmtime patch upgrade (diff)
downloadsl0ppij-d671ab650e231d353a05a2808c0984e952de38c4.tar.gz
sl0ppij-d671ab650e231d353a05a2808c0984e952de38c4.tar.xz
sl0ppij-d671ab650e231d353a05a2808c0984e952de38c4.zip
feat(plugins): add API to list clients, their focused panes and running commands/plugins (#3687)
* fix(list-clients): properly show client info after a tab was closed * feat(plugins): add API to list clients, their focused panes and running commands/plugins * style(fmt): rustfmt
Diffstat (limited to 'zellij-tile')
-rw-r--r--zellij-tile/src/shim.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/zellij-tile/src/shim.rs b/zellij-tile/src/shim.rs
index c51a93d8..bc1b4844 100644
--- a/zellij-tile/src/shim.rs
+++ b/zellij-tile/src/shim.rs
@@ -854,6 +854,15 @@ pub fn dump_session_layout() {
unsafe { host_run_plugin_command() };
}
+/// Get a list of clients, their focused pane and running command or focused plugin back as an
+/// Event::ListClients (note: this event must be subscribed to)
+pub fn list_clients() {
+ let plugin_command = PluginCommand::ListClients;
+ let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap();
+ object_to_stdout(&protobuf_plugin_command.encode_to_vec());
+ unsafe { host_run_plugin_command() };
+}
+
/// Change configuration for the current user
pub fn reconfigure(new_config: String, save_configuration_file: bool) {
let plugin_command = PluginCommand::Reconfigure(new_config, save_configuration_file);