diff --git a/src/cli.rs b/src/cli.rs index b410fadf00..ef809ecc10 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -399,6 +399,7 @@ pub async fn cli() -> Result<(), Box> { LineResult::CtrlC => { if ctrlcbreak { + let _ = rl.save_history(&History::path()); std::process::exit(0); } else { context.with_host(|host| host.stdout("CTRL-C pressed (again to quit)")); diff --git a/src/commands/classified.rs b/src/commands/classified.rs index b042441403..eb51f9c4c6 100644 --- a/src/commands/classified.rs +++ b/src/commands/classified.rs @@ -130,7 +130,7 @@ impl InternalCommand { CommandAction::AddSpanSource(uuid, span_source) => { context.add_span_source(uuid, span_source); } - CommandAction::Exit => std::process::exit(0), + CommandAction::Exit => std::process::exit(0), // TODO: save history.txt CommandAction::EnterHelpShell(value) => { match value { Tagged { @@ -170,7 +170,7 @@ impl InternalCommand { CommandAction::LeaveShell => { context.shell_manager.remove_at_current(); if context.shell_manager.is_empty() { - std::process::exit(0); + std::process::exit(0); // TODO: save history.txt } } },