diff --git a/src/main.rs b/src/main.rs index 3b2e704..0651975 100644 --- a/src/main.rs +++ b/src/main.rs @@ -263,11 +263,17 @@ impl FramebufferWriter { impl fmt::Write for FramebufferWriter { fn write_char(&mut self, c: char) -> fmt::Result { - self.out_string.push(c); + if c == '\u{8}' { + self.out_string.pop(); + } else { + self.out_string.push(c); + } Ok(()) } fn write_str(&mut self, s: &str) -> core::fmt::Result { - self.out_string.push_str(s); + for c in s.chars() { + self.write_char(c)?; + } Ok(()) } }