diff options
| author | sigoden <sigoden@gmail.com> | 2024-04-08 23:27:37 +0000 |
|---|---|---|
| committer | sigoden <sigoden@gmail.com> | 2024-04-08 23:27:37 +0000 |
| commit | 22800109597857bfc05bc762ade561b376a2923d (patch) | |
| tree | 4681c7575d08f32372425abe3f3a326790e144f9 /src | |
| parent | 2738988fc47f0f068b6c78e556760a0dbca8d932 (diff) | |
| download | aichat-22800109597857bfc05bc762ade561b376a2923d.tar.gz | |
refactor: change ctrlc message text
Diffstat (limited to 'src')
| -rw-r--r-- | src/repl/mod.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs index cc642cc..50ff33b 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -131,11 +131,15 @@ impl Repl { } Ok(Signal::CtrlC) => { self.abort.set_ctrlc(); - if already_ctrlc && ctrlc_exit { - break; + if ctrlc_exit { + if already_ctrlc { + break; + } + already_ctrlc = true; + println!("(To exit, press Ctrl+C again or Ctrl+D or type .exit)\n"); + } else { + println!("(To exit, press Ctrl+D or type .exit)\n"); } - already_ctrlc = true; - println!("(To exit, press Ctrl+C again or Ctrl+D or type .exit)\n"); } Ok(Signal::CtrlD) => { self.abort.set_ctrld(); |
