avoid garbage to the right of the "screen" by resetting color after each line

This commit is contained in:
lifning 2021-11-26 15:59:33 -08:00
parent 203f575914
commit 01a1b790ae

View file

@ -141,9 +141,8 @@ impl RetroCallbacks for AnsiVideoComponent {
let processed = processor.process(&rgba_img).into_iter().next().unwrap().1;
write!(self.screen, "{}", termion::cursor::Goto(1, 1)).unwrap();
for line in self.encode_frame(&processed).lines() {
write!(self.screen, "{}\r\n", line).unwrap();
write!(self.screen, "{}\x1B[0m\r\n", line).unwrap();
}
write!(self.screen, "\x1B[0m").unwrap();
self.screen.flush().unwrap();
} else if force_redraw {
// TODO: draw last copy