Clear screen instead of resetting the terminal (#2431)

Resetting the terminal can change color themes and other settings.
This commit changes the behavior to just clear the screen.
This commit is contained in:
frozolotl 2023-10-19 10:11:22 +02:00 committed by GitHub
parent 56510d9df0
commit 01b14ff316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,7 +157,7 @@ impl Status {
if std::io::stderr().is_terminal() {
// Clear the terminal.
let esc = 27 as char;
write!(w, "{esc}c{esc}[1;1H")?;
write!(w, "{esc}[2J{esc}[1;1H")?;
}
w.set_color(&color)?;