From 6829ad7a3060a4c9a8732a344fac481377dcae2b Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Sun, 19 Jul 2020 07:47:55 -0500 Subject: [PATCH] hopefully the final fix for history (#2222) --- crates/nu-cli/src/cli.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/nu-cli/src/cli.rs b/crates/nu-cli/src/cli.rs index f744e77ae5..308ad64999 100644 --- a/crates/nu-cli/src/cli.rs +++ b/crates/nu-cli/src/cli.rs @@ -554,9 +554,6 @@ pub async fn cli( let _ = ansi_term::enable_ansi_support(); } - // we are ok if history does not exist - let _ = rl.load_history(&History::path()); - #[cfg(feature = "ctrlc")] { let cc = context.ctrl_c.clone(); @@ -644,9 +641,12 @@ pub async fn cli( .map(|i| i.value.expect_int()) .unwrap_or(100_000); - // rl.set_max_history_size(max_history_size as usize); - rustyline::config::Configurer::set_max_history_size(&mut rl, max_history_size as usize); - rustyline::Editor::set_max_history_size(&mut rl, max_history_size as usize); + rl.set_max_history_size(max_history_size as usize); + // rustyline::config::Configurer::set_max_history_size(&mut rl, max_history_size as usize); + // rustyline::Editor::set_max_history_size(&mut rl, max_history_size as usize); + + // we are ok if history does not exist + let _ = rl.load_history(&History::path()); let key_timeout = config .get("key_timeout")