From 1d554dd0cf13b7d0e4473c7d14587b334114b580 Mon Sep 17 00:00:00 2001 From: linsui Date: Mon, 23 Oct 2023 15:18:17 +0800 Subject: [PATCH] fix: clear sixel image with empty characters directly On BlackBox \x2B[K doesn't work for sixel characters --- yazi-adaptor/src/sixel.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yazi-adaptor/src/sixel.rs b/yazi-adaptor/src/sixel.rs index 7ec09ece..b89b48e3 100644 --- a/yazi-adaptor/src/sixel.rs +++ b/yazi-adaptor/src/sixel.rs @@ -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(()) })