From f83980db5c91e0b8e155ed7fff4e1dbb89c17bcc Mon Sep 17 00:00:00 2001 From: Mo <77584024+hamidi-dev@users.noreply.github.com> Date: Thu, 6 Aug 2026 00:54:01 +0200 Subject: fix: render OSC 4 palette overrides instead of forwarding the index (#2162) Co-authored-by: Can Celik --- src/ghostty/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ghostty') diff --git a/src/ghostty/mod.rs b/src/ghostty/mod.rs index 685c0735..ef67b86f 100644 --- a/src/ghostty/mod.rs +++ b/src/ghostty/mod.rs @@ -865,6 +865,21 @@ impl Terminal { } } + pub fn default_palette(&self) -> Result<[RgbColor; 256], Error> { + let mut out = [ffi::GhosttyColorRgb::default(); 256]; + // SAFETY: self.raw is a live terminal handle, and out is exactly the + // 256-entry array this data kind writes. + unsafe { + ffi::ghostty_terminal_get( + self.raw, + ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_COLOR_PALETTE_DEFAULT, + out.as_mut_ptr().cast(), + ) + .into_result()?; + } + Ok(out.map(Into::into)) + } + pub fn resize( &mut self, cols: u16, -- cgit v1.2.3