mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 14:02:22 -05:00
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.
This commit is contained in:
parent
79a569422c
commit
83be517e77
1 changed files with 3 additions and 0 deletions
|
@ -80,6 +80,9 @@ fn main() {
|
|||
}
|
||||
|
||||
if matches.subcommand_matches("watch").is_some() {
|
||||
/* Clears the terminal with an ANSI escape code.
|
||||
Works in UNIX and newer Windows terminals. */
|
||||
println!("\x1Bc");
|
||||
watch(&exercises).unwrap();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue