From e070d37d3341334c48cf279d90838be10a3ab94d Mon Sep 17 00:00:00 2001 From: Harshil Date: Mon, 22 Jun 2026 01:32:16 +0530 Subject: [PATCH] fix: ctrl-c / eof loses command history --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c067130..1b1671b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,6 +50,7 @@ fn shell_loop() { }; rl.add_history_entry(&raw).unwrap_or_default(); + rl.save_history(&hist_path).unwrap_or_default(); match parse(raw) { Ok(parsed) => match parsed { @@ -88,10 +89,12 @@ fn shell_loop() { } Err(ReadlineError::Interrupted) => { - break; + println!("^C"); + continue; } Err(ReadlineError::Eof) => { + println!(); break; }