[app] section in theme, OSC 11 and OSC 111 for setting and resetting background, updates to default dark and light themes

This commit is contained in:
Zane Weissman 2025-11-06 09:53:14 -05:00 committed by Carlos de Paula
parent 577065cbd0
commit 6387ed0098

View file

@ -23,6 +23,7 @@ impl Term {
last_area: Default::default(),
last_buffer: Default::default(),
};
let background = &THEME.app.background;
enable_raw_mode()?;
static FIRST: SyncCell<bool> = SyncCell::new(false);
@ -37,6 +38,8 @@ impl Term {
Print("\x1b[?12$p"), // Request cursor blink status (DECRQM query for DECSET 12)
Print("\x1b[?u"), // Request keyboard enhancement flags (CSI u)
Print("\x1b[0c"), // Request device attributes
// Set terminal background color
yazi_term::If(!background.is_empty(), Print(format!("\x1b]11;{}\x1b\\", background))),
yazi_term::If(TMUX.get(), EnterAlternateScreen),
yazi_term::SetBackground(true, THEME.app.bg_color()), // Set app background
EnableBracketedPaste,