mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
16 lines
393 B
Rust
16 lines
393 B
Rust
pub struct SetBackground(pub bool, pub String);
|
|
|
|
impl crossterm::Command for SetBackground {
|
|
fn write_ansi(&self, f: &mut impl std::fmt::Write) -> std::fmt::Result {
|
|
if self.1.is_empty() {
|
|
Ok(())
|
|
} else if self.0 {
|
|
write!(f, "\x1b]11;{}\x1b\\", self.1)
|
|
} else {
|
|
write!(f, "\x1b]111\x1b\\")
|
|
}
|
|
}
|
|
|
|
#[cfg(windows)]
|
|
fn execute_winapi(&self) -> std::io::Result<()> { Ok(()) }
|
|
}
|