Fix shift of first output line

This commit is contained in:
mo8it 2024-04-10 03:56:41 +02:00
parent f034899c7f
commit a46d66134b

View file

@ -127,6 +127,9 @@ You can keep working on this exercise or jump into the next one by removing the
} }
pub fn render(&mut self) -> Result<()> { pub fn render(&mut self) -> Result<()> {
// Prevent having the first line shifted after clearing because of the prompt.
self.writer.write_all(b"\n")?;
self.writer.execute(Clear(ClearType::All))?; self.writer.execute(Clear(ClearType::All))?;
if let Some(stdout) = &self.stdout { if let Some(stdout) = &self.stdout {