File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -143,15 +143,18 @@ fn main() {
143
143
144
144
fn spawn_watch_shell ( failed_exercise_hint : & Arc < Mutex < Option < String > > > ) {
145
145
let failed_exercise_hint = Arc :: clone ( failed_exercise_hint) ;
146
- println ! ( "Type 'hint' to get help" ) ;
146
+ println ! ( "Type 'hint' to get help or 'clear' to clear the screen " ) ;
147
147
thread:: spawn ( move || loop {
148
148
let mut input = String :: new ( ) ;
149
149
match io:: stdin ( ) . read_line ( & mut input) {
150
150
Ok ( _) => {
151
- if input. trim ( ) . eq ( "hint" ) {
151
+ let input = input. trim ( ) ;
152
+ if input. eq ( "hint" ) {
152
153
if let Some ( hint) = & * failed_exercise_hint. lock ( ) . unwrap ( ) {
153
154
println ! ( "{}" , hint) ;
154
155
}
156
+ } else if input. eq ( "clear" ) {
157
+ println ! ( "\x1B [2J\x1B [1;1H" ) ;
155
158
} else {
156
159
println ! ( "unknown command: {}" , input) ;
157
160
}
You can’t perform that action at this time.
0 commit comments