From 55187496fa18186edaaa0551292d546500dad8e8 Mon Sep 17 00:00:00 2001 From: linsui <36977733+linsui@users.noreply.github.com> Date: Mon, 23 Oct 2023 08:20:21 +0000 Subject: [PATCH] fix: clear Sixel image with empty characters instead of `\x2B[K` to be compatible with GNOME VTE (#309) --- 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(()) })