aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/input/options.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/input/options.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/input/options.rs')
-rw-r--r--zellij-utils/src/input/options.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/zellij-utils/src/input/options.rs b/zellij-utils/src/input/options.rs
index bb90b7b1..854ef271 100644
--- a/zellij-utils/src/input/options.rs
+++ b/zellij-utils/src/input/options.rs
@@ -48,6 +48,16 @@ pub struct Options {
/// Set the default theme
#[clap(long, value_parser)]
pub theme: Option<String>,
+ /// Theme name to apply when the host terminal reports a dark color palette
+ /// (CSI 2031 / DSR 997). Requires `theme_light` to also be set; if either
+ /// is missing the static `theme` remains authoritative.
+ #[clap(long, value_parser)]
+ pub theme_dark: Option<String>,
+ /// Theme name to apply when the host terminal reports a light color palette
+ /// (CSI 2031 / DSR 997). Requires `theme_dark` to also be set; if either
+ /// is missing the static `theme` remains authoritative.
+ #[clap(long, value_parser)]
+ pub theme_light: Option<String>,
/// Set the default mode
#[clap(long, arg_enum, hide_possible_values = true, value_parser)]
pub default_mode: Option<InputMode>,
@@ -319,6 +329,8 @@ impl Options {
let layout_dir = other.layout_dir.or_else(|| self.layout_dir.clone());
let theme_dir = other.theme_dir.or_else(|| self.theme_dir.clone());
let theme = other.theme.or_else(|| self.theme.clone());
+ let theme_dark = other.theme_dark.or_else(|| self.theme_dark.clone());
+ let theme_light = other.theme_light.or_else(|| self.theme_light.clone());
let on_force_close = other.on_force_close.or(self.on_force_close);
let scroll_buffer_size = other.scroll_buffer_size.or(self.scroll_buffer_size);
let copy_command = other.copy_command.or_else(|| self.copy_command.clone());
@@ -376,6 +388,8 @@ impl Options {
Options {
simplified_ui,
theme,
+ theme_dark,
+ theme_light,
default_mode,
default_shell,
default_cwd,
@@ -454,6 +468,8 @@ impl Options {
let layout_dir = other.layout_dir.or_else(|| self.layout_dir.clone());
let theme_dir = other.theme_dir.or_else(|| self.theme_dir.clone());
let theme = other.theme.or_else(|| self.theme.clone());
+ let theme_dark = other.theme_dark.or_else(|| self.theme_dark.clone());
+ let theme_light = other.theme_light.or_else(|| self.theme_light.clone());
let on_force_close = other.on_force_close.or(self.on_force_close);
let scroll_buffer_size = other.scroll_buffer_size.or(self.scroll_buffer_size);
let copy_command = other.copy_command.or_else(|| self.copy_command.clone());
@@ -507,6 +523,8 @@ impl Options {
Options {
simplified_ui,
theme,
+ theme_dark,
+ theme_light,
default_mode,
default_shell,
default_cwd,