Skip to content

Commit 83be517

Browse files
watch: clears terminal before entering loop
If someone is sliding in and out of "watch" mode, it can make it hard to tell which error messages are still relevant. This patch resolves that by clearing the terminal entirely before entering watch's loop.
1 parent 79a5694 commit 83be517

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ fn main() {
8080
}
8181

8282
if matches.subcommand_matches("watch").is_some() {
83+
/* Clears the terminal with an ANSI escape code.
84+
Works in UNIX and newer Windows terminals. */
85+
println!("\x1Bc");
8386
watch(&exercises).unwrap();
8487
}
8588

0 commit comments

Comments
 (0)