fix: clear sixel image with empty characters directly

On BlackBox \x2B[K doesn't work for sixel characters
This commit is contained in:
linsui 2023-10-23 15:18:17 +08:00
parent 2df1dae5af
commit 1d554dd0cf

View file

@ -21,10 +21,11 @@ impl Sixel {
pub(super) fn image_hide(rect: Rect) -> Result<()> {
let stdout = BufWriter::new(stdout().lock());
let s = " ".repeat(rect.width as usize);
Term::move_lock(stdout, (0, 0), |stdout| {
for y in rect.top()..rect.bottom() {
Term::move_to(stdout, rect.x, y)?;
Term::kill_to_end(stdout)?;
stdout.write_all(s.as_bytes())?;
}
Ok(())
})