mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Avoid update_last_command_context "No command run" error (#6483)
* Avoid update_last_command_context "No command run" error When using `executehostcommand` bindings without having run actual user input commands yet, update_last_command_context is guaranteed to fail. A function has been added to reedline that allows checking for this case. * Update to most recent reedline Includes bugfixes around the (SQlite) history Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
@ -324,7 +324,8 @@ pub fn evaluate_repl(
|
||||
Ok(Signal::Success(s)) => {
|
||||
let history_supports_meta =
|
||||
matches!(config.history_file_format, HistoryFileFormat::Sqlite);
|
||||
if history_supports_meta && !s.is_empty() {
|
||||
if history_supports_meta && !s.is_empty() && line_editor.has_last_command_context()
|
||||
{
|
||||
line_editor
|
||||
.update_last_command_context(&|mut c| {
|
||||
c.start_timestamp = Some(chrono::Utc::now());
|
||||
@ -445,7 +446,8 @@ pub fn evaluate_repl(
|
||||
},
|
||||
);
|
||||
|
||||
if history_supports_meta && !s.is_empty() {
|
||||
if history_supports_meta && !s.is_empty() && line_editor.has_last_command_context()
|
||||
{
|
||||
line_editor
|
||||
.update_last_command_context(&|mut c| {
|
||||
c.duration = Some(cmd_duration);
|
||||
|
Reference in New Issue
Block a user