SQLite History MVP with timestamp, duration, working directory, exit status metadata (#5721)

This PR adds support for an SQLite history via nushell/reedline#401

The SQLite history is enabled by setting history_file_format: "sqlite" in config.nu.

* somewhat working sqlite history
* Hook up history command
* Fix error in SQlitebacked with empty lines

When entering an empty line there previously was the "No command run"
error with `SqliteBackedHistory` during addition of the metadata

May be considered a temporary fix

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
phiresky
2022-06-14 22:53:33 +02:00
committed by GitHub
parent 534e1fc3ce
commit 42dbfd1fa0
12 changed files with 243 additions and 127 deletions

View File

@ -1239,6 +1239,7 @@ pub fn eval_variable(
let mut history_path = config_path.clone();
history_path.push("history.txt");
// let mut history_path = config_files::get_history_path(); // todo: this should use the get_history_path method but idk where to put that function
output_cols.push("history-path".into());
output_vals.push(Value::String {