Open tramhao opened 3 years ago
I solve it by sending control sequence to terminal directly
pub fn clear_image(&mut self) {
write!(self.context.backend_mut(), "\x1b_Ga=d\x1b\\").expect("error delete image");
self.context
.backend_mut()
.flush()
.expect("error flush delete image");
}
If this is the correct way, please close this issue. Thanks.
Thank you for using viuer
. This is a really good point, I think viuer
could use a clear/delete_image
method. I will leave this issue open as a reminder :)
I met this problem again but for iterm2 protocol. I'm using same code to clear picture in iterm2, but not working. I'm using wezterm. Do you know if there is a way to clear image in iterm2? I didn't find related information in their website. Thanks so much.
I faced the same problem: By using termion, for example, clearing the image goes like this:
for i in 0..terminal_row {
print!("{}", cursor::Goto(BEGINNING_COLUMN, BEGINNING_ROW + i as u16));
print!("{}", clear::UntilNewline);
}
Both cursor::Goto
and clear::UntilNewline
in termion
write escape sequences. This works fine when using alacritty, which does not support sixel.
However, with kitty, the above code does not work.
Is there any solution to this, or do I miss something? Thanks.
Firstly, thanks for your work and it provides very good display result in kitty. I'm using it in my repo(https://github.com/tramhao/termusic) to display the album photo. The display works without problems. However, i need to clear the printed image if the song doesn't have an album photo. I cannot figure out how to do it. Thanks so much.