aboutsummaryrefslogtreecommitdiff
path: root/src/app/mod.rs
diff options
context:
space:
mode:
authorakbash <akbash@herdr.dev>2026-07-24 01:28:35 +0300
committerGitHub <noreply@github.com>2026-07-24 01:28:35 +0300
commit503613c8ecbea752a234daf30cb0ad5a8bf93e4e (patch)
tree34b71e4c7055244ed191c043457c572e3ccfc935 /src/app/mod.rs
parent58ad2c6438cf25cdf7e95528c7114d3bf12626d2 (diff)
fix: inherit host palette in pane queries (#1759)
refs #1752 Co-authored-by: Ogulcan Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/app/mod.rs')
-rw-r--r--src/app/mod.rs35
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]