We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f7b5bd commit 4f2468eCopy full SHA for 4f2468e
1 file changed
src/main.rs
@@ -143,15 +143,18 @@ fn main() {
143
144
fn spawn_watch_shell(failed_exercise_hint: &Arc<Mutex<Option<String>>>) {
145
let failed_exercise_hint = Arc::clone(failed_exercise_hint);
146
- println!("Type 'hint' to get help");
+ println!("Type 'hint' to get help or 'clear' to clear the screen");
147
thread::spawn(move || loop {
148
let mut input = String::new();
149
match io::stdin().read_line(&mut input) {
150
Ok(_) => {
151
- if input.trim().eq("hint") {
+ let input = input.trim();
152
+ if input.eq("hint") {
153
if let Some(hint) = &*failed_exercise_hint.lock().unwrap() {
154
println!("{}", hint);
155
}
156
+ } else if input.eq("clear") {
157
+ println!("\x1B[2J\x1B[1;1H");
158
} else {
159
println!("unknown command: {}", input);
160
0 commit comments