fix: report effective OSC 11 background
This commit is contained in:
parent
fde0f34137
commit
18d45bc88f
2 changed files with 14 additions and 1 deletions
|
|
@ -386,6 +386,19 @@ impl Terminal {
|
|||
&self.colors
|
||||
}
|
||||
|
||||
pub fn effective_color(&self, index: usize) -> Rgb {
|
||||
if index == NamedColor::Background as usize {
|
||||
self.colors[index].unwrap_or_else(|| {
|
||||
// Allow using an unset background
|
||||
let [r, g, b, _] =
|
||||
cosmic_text::Color(WINDOW_BG_COLOR.load(Ordering::SeqCst)).as_rgba();
|
||||
Rgb { r, g, b }
|
||||
})
|
||||
} else {
|
||||
self.colors[index].unwrap_or_default()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn default_attrs(&self) -> &Attrs<'static> {
|
||||
&self.default_attrs
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue