From 8eb44537ecb35aebf2aa95018ab8806ab899e0f7 Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Mon, 19 Oct 2020 20:06:21 +0800 Subject: 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(). --- cli/repl.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/repl.rs b/cli/repl.rs index be887e941..1bb5df096 100644 --- a/cli/repl.rs +++ b/cli/repl.rs @@ -402,7 +402,8 @@ pub async fn run( editor.lock().unwrap().add_history_entry(line.as_str()); } Err(ReadlineError::Interrupted) => { - break; + println!("exit using ctrl+d or close()"); + continue; } Err(ReadlineError::Eof) => { break; -- cgit v1.2.3