From a36d2a1586fda5f5f70c065e898455527d265512 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Tue, 21 Jul 2020 02:19:04 -0400 Subject: [PATCH] Revert "hopefully the final fix for history (#2222)" (#2235) This reverts commit 6829ad7a3060a4c9a8732a344fac481377dcae2b. --- 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 7b633e0f70..ef8d904fc7 100644 --- a/crates/nu-cli/src/cli.rs +++ b/crates/nu-cli/src/cli.rs @@ -555,6 +555,9 @@ 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(); @@ -642,12 +645,9 @@ 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); - - // we are ok if history does not exist - let _ = rl.load_history(&History::path()); + // 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); let key_timeout = config .get("key_timeout")