aboutsummaryrefslogtreecommitdiff
path: root/src/terminal_theme.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-08-03 02:05:27 +0300
committerGitHub <noreply@github.com>2026-08-03 02:05:27 +0300
commit10eb0bc744165ae91dfce9fd731fe170410b34ec (patch)
tree8622d429d9453c2e8d06630322804a702973d94a /src/terminal_theme.rs
parentcbc31d34a1fb3da64415737de57ad10fe6af5ba5 (diff)
fix: propagate host color scheme to pane apps (#2214)
refs #714
Diffstat (limited to 'src/terminal_theme.rs')
-rw-r--r--src/terminal_theme.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/terminal_theme.rs b/src/terminal_theme.rs
index 154b36fe..ffe78a95 100644
--- a/src/terminal_theme.rs
+++ b/src/terminal_theme.rs
@@ -11,6 +11,15 @@ pub enum HostAppearance {
Light,
}
+impl HostAppearance {
+ pub const fn color_scheme_report(self) -> &'static [u8] {
+ match self {
+ Self::Dark => b"\x1b[?997;1n",
+ Self::Light => b"\x1b[?997;2n",
+ }
+ }
+}
+
impl RgbColor {
pub fn inferred_appearance(self) -> HostAppearance {
let luminance = u32::from(self.r) * 299 + u32::from(self.g) * 587 + u32::from(self.b) * 114;