From 0b429fde240e6a0656348839b7f2e327ab1a2074 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Sun, 24 Jul 2022 00:35:43 +0800 Subject: [PATCH] Log warning message if nu failed to sync history (#6106) Fixes #6088 Signed-off-by: nibon7 --- crates/nu-cli/src/repl.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/nu-cli/src/repl.rs b/crates/nu-cli/src/repl.rs index c7abc7820..ee527b045 100644 --- a/crates/nu-cli/src/repl.rs +++ b/crates/nu-cli/src/repl.rs @@ -6,7 +6,7 @@ use crate::{ NuHighlighter, NuValidator, NushellPrompt, }; use lazy_static::lazy_static; -use log::{info, trace}; +use log::{info, trace, warn}; use miette::{IntoDiagnostic, Result}; use nu_color_config::get_color_config; use nu_engine::{convert_env_values, eval_block}; @@ -216,7 +216,10 @@ pub fn evaluate_repl( if is_perf_true { info!("sync history {}:{}:{}", file!(), line!(), column!()); } - line_editor.sync_history().into_diagnostic()?; + + if let Err(e) = line_editor.sync_history() { + warn!("Failed to sync history: {}", e); + } } if is_perf_true {