fix: report effective OSC 11 background
This commit is contained in:
parent
fde0f34137
commit
18d45bc88f
2 changed files with 14 additions and 1 deletions
|
|
@ -3066,7 +3066,7 @@ impl Application for App {
|
|||
&& let Some(terminal) = tab_model.data::<Mutex<Terminal>>(entity)
|
||||
{
|
||||
let terminal = terminal.lock().unwrap();
|
||||
let rgb = terminal.colors()[index].unwrap_or_default();
|
||||
let rgb = terminal.effective_color(index);
|
||||
let text = f(rgb);
|
||||
terminal.input_no_scroll(text.into_bytes());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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