diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 2217bef2..3c66ff1d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,6 +42,18 @@ fn pop_keyboard_enhancement_flags() -> io::Result<()> { Ok(()) } +fn set_host_color_scheme_reports(enabled: bool) -> io::Result<()> { + use std::io::Write; + + let sequence = if enabled { + crate::terminal_theme::HOST_COLOR_SCHEME_REPORT_ENABLE_SEQUENCE + } else { + crate::terminal_theme::HOST_COLOR_SCHEME_REPORT_DISABLE_SEQUENCE + }; + io::stdout().write_all(sequence.as_bytes())?; + io::stdout().flush() +} + mod agent_resume; mod api; mod app; @@ -102,6 +114,12 @@ const DEFAULT_CONFIG: &str = r##"# herdr configuration # vesper # name = "catppuccin" +# Follow host terminal light/dark appearance and switch Herdr UI themes. +# Existing manual behavior is unchanged unless this is true. +# auto_switch = false +# dark_name = "catppuccin" +# light_name = "catppuccin-latte" + # Override individual color tokens on top of the base theme. # Accepts: hex (#rrggbb), named colors, rgb(r,g,b), or panel_bg = "reset" # [theme.custom] @@ -665,6 +683,7 @@ fn main() -> io::Result<()> { DisableBracketedPaste, DisableMouseCapture ); + let _ = set_host_color_scheme_reports(false); let _ = pop_keyboard_enhancement_flags(); ratatui::restore(); original_hook(info); @@ -691,6 +710,7 @@ fn main() -> io::Result<()> { execute!(io::stdout(), DisableMouseCapture)?; } execute!(io::stdout(), EnableBracketedPaste, EnableFocusChange)?; + set_host_color_scheme_reports(true)?; push_keyboard_enhancement_flags()?; // Some hosts do not honor Kitty keyboard enhancement pushes for @@ -728,6 +748,7 @@ fn main() -> io::Result<()> { DisableBracketedPaste, DisableMouseCapture )?; + set_host_color_scheme_reports(false)?; ratatui::restore(); // Drop app (and all workspaces/panes) before runtime shuts down |
