From 01b14ff316caadb2b3e672f6c2b4f866b8d8b3fe Mon Sep 17 00:00:00 2001 From: frozolotl <44589151+frozolotl@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:11:22 +0200 Subject: [PATCH] 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. --- crates/typst-cli/src/watch.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/typst-cli/src/watch.rs b/crates/typst-cli/src/watch.rs index 412c20620..8ef1c5712 100644 --- a/crates/typst-cli/src/watch.rs +++ b/crates/typst-cli/src/watch.rs @@ -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)?;