diff options
Diffstat (limited to 'src/app/mod.rs')
| -rw-r--r-- | src/app/mod.rs | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index b56c128c..f6dbe261 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1702,6 +1702,11 @@ impl App { self.update_host_terminal_theme(kind, color); } } + crate::raw_input::RawInputEvent::HostPaletteColors { colors } => { + if apply_host_terminal_theme { + self.update_host_terminal_palette_colors(&colors); + } + } crate::raw_input::RawInputEvent::HostColorSchemeChanged(appearance) => { if apply_host_terminal_theme { self.set_host_terminal_appearance(appearance, true); @@ -5797,7 +5802,7 @@ last_pane = "prefix+tab" fn route_client_input_updates_host_terminal_theme_from_osc_response() { let mut app = test_app(); - app.route_client_input(b"\x1b]11;#123456\x07".to_vec()); + app.route_client_input(b"\x1b]11;#123456\x07\x1b]4;7;rgb:aaaa/bbbb/cccc\x1b\\".to_vec()); assert_eq!( app.state.host_terminal_theme.background, @@ -5807,6 +5812,34 @@ last_pane = "prefix+tab" b: 0x56, }) ); + assert_eq!( + app.state.host_terminal_theme.palette[7], + Some(crate::terminal_theme::RgbColor { + r: 0xaa, + g: 0xbb, + b: 0xcc, + }) + ); + + app.route_client_input(crate::raw_input::GHOSTTY_COLOR_SCHEME_DARK_REPORT.to_vec()); + assert_eq!( + app.state.host_terminal_theme.palette[7], + Some(crate::terminal_theme::RgbColor { + r: 0xaa, + g: 0xbb, + b: 0xcc, + }) + ); + + app.route_client_input(b"\x1b]4;7;rgb:dddd/eeee/ffff\x1b\\".to_vec()); + assert_eq!( + app.state.host_terminal_theme.palette[7], + Some(crate::terminal_theme::RgbColor { + r: 0xdd, + g: 0xee, + b: 0xff, + }) + ); } #[tokio::test] |
