aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/plugin_api/action.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-04-28 17:14:59 +0200
committerGitHub <noreply@github.com>2026-04-28 17:14:59 +0200
commit227142dd567ee72bcc137c116bc1ce2b818975e7 (patch)
tree8958a994dddb80bf20ce1e6bf2694687736b0b19 /zellij-utils/src/plugin_api/action.rs
parentupgrade rustls-webpki (#5106) (diff)
downloadsl0ppij-227142dd567ee72bcc137c116bc1ce2b818975e7.tar.gz
sl0ppij-227142dd567ee72bcc137c116bc1ce2b818975e7.tar.xz
sl0ppij-227142dd567ee72bcc137c116bc1ce2b818975e7.zip
Support CSI2031 (dark/light theme switching) + remove STDIN cache to avoid stale color queries (#5105)
* initial phase 1 implementation * various fies * some fixes * fix fragmented stdin cases * some fixes * renaming * guard against old clients * implement csi 2031 * allow toggling theme with actions * rustfmt * fix: finalize trailing characters in ansi parser as well * add pr
Diffstat (limited to 'zellij-utils/src/plugin_api/action.rs')
-rw-r--r--zellij-utils/src/plugin_api/action.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/action.rs b/zellij-utils/src/plugin_api/action.rs
index cbd62e5b..cd3e1522 100644
--- a/zellij-utils/src/plugin_api/action.rs
+++ b/zellij-utils/src/plugin_api/action.rs
@@ -611,6 +611,18 @@ impl TryFrom<ProtobufAction> for Action {
Some(_) => Err("Detach should not have a payload"),
None => Ok(Action::Detach),
},
+ Some(ProtobufActionName::SetDarkTheme) => match protobuf_action.optional_payload {
+ Some(_) => Err("SetDarkTheme should not have a payload"),
+ None => Ok(Action::SetDarkTheme),
+ },
+ Some(ProtobufActionName::SetLightTheme) => match protobuf_action.optional_payload {
+ Some(_) => Err("SetLightTheme should not have a payload"),
+ None => Ok(Action::SetLightTheme),
+ },
+ Some(ProtobufActionName::ToggleTheme) => match protobuf_action.optional_payload {
+ Some(_) => Err("ToggleTheme should not have a payload"),
+ None => Ok(Action::ToggleTheme),
+ },
Some(ProtobufActionName::LeftClick) => match protobuf_action.optional_payload {
Some(OptionalPayload::LeftClickPayload(payload)) => {
let position = payload.try_into()?;
@@ -1567,6 +1579,18 @@ impl TryFrom<Action> for ProtobufAction {
name: ProtobufActionName::Detach as i32,
optional_payload: None,
}),
+ Action::SetDarkTheme => Ok(ProtobufAction {
+ name: ProtobufActionName::SetDarkTheme as i32,
+ optional_payload: None,
+ }),
+ Action::SetLightTheme => Ok(ProtobufAction {
+ name: ProtobufActionName::SetLightTheme as i32,
+ optional_payload: None,
+ }),
+ Action::ToggleTheme => Ok(ProtobufAction {
+ name: ProtobufActionName::ToggleTheme as i32,
+ optional_payload: None,
+ }),
Action::LaunchOrFocusPlugin {
plugin: run_plugin_or_alias,
should_float,