From 01a1b790ae5af81c6b3623420ca6d968e8bc51b7 Mon Sep 17 00:00:00 2001 From: lifning <> Date: Fri, 26 Nov 2021 15:59:33 -0800 Subject: [PATCH] avoid garbage to the right of the "screen" by resetting color after each line --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 46f7914..36e0a15 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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