0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

fix(cli/repl): keyboard interrupt should continue (#7960)

This changes the behavior of keyboard interrupts (ctrl+c) to continue,
clearing the current line instead of exiting.

Exit can still be done with ctrl+d or by calling close().
This commit is contained in:
Casper Beyer 2020-10-19 20:06:21 +08:00 committed by GitHub
parent f5c23f8058
commit 8eb44537ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -402,7 +402,8 @@ pub async fn run(
editor.lock().unwrap().add_history_entry(line.as_str()); editor.lock().unwrap().add_history_entry(line.as_str());
} }
Err(ReadlineError::Interrupted) => { Err(ReadlineError::Interrupted) => {
break; println!("exit using ctrl+d or close()");
continue;
} }
Err(ReadlineError::Eof) => { Err(ReadlineError::Eof) => {
break; break;