From 503613c8ecbea752a234daf30cb0ad5a8bf93e4e Mon Sep 17 00:00:00 2001 From: akbash Date: Fri, 24 Jul 2026 01:28:35 +0300 Subject: fix: inherit host palette in pane queries (#1759) refs #1752 Co-authored-by: Ogulcan Celik --- src/app/mod.rs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'src/app/mod.rs') 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] -- cgit v1.2.3