aboutsummaryrefslogtreecommitdiff
path: root/src/ghostty
diff options
context:
space:
mode:
authorMo <77584024+hamidi-dev@users.noreply.github.com>2026-08-06 00:54:01 +0200
committerGitHub <noreply@github.com>2026-08-06 01:54:01 +0300
commitf83980db5c91e0b8e155ed7fff4e1dbb89c17bcc (patch)
tree9e689b208f4fce03f178277eaa94f54ae84902b5 /src/ghostty
parentea047db8e47defc80aee2d1972cdccc3b61ad4e1 (diff)
fix: render OSC 4 palette overrides instead of forwarding the index (#2162)
Co-authored-by: Can Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/ghostty')
-rw-r--r--src/ghostty/mod.rs15
1 files changed, 15 insertions, 0 deletions
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,