Log warning message if nu failed to sync history (#6106)

Fixes #6088

Signed-off-by: nibon7 <nibon7@163.com>
This commit is contained in:
nibon7 2022-07-24 00:35:43 +08:00 committed by GitHub
parent 388ff78a26
commit 0b429fde24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {