diff --git a/crates/nu-cli/src/cli.rs b/crates/nu-cli/src/cli.rs index d71a44ab8..1b586c54b 100644 --- a/crates/nu-cli/src/cli.rs +++ b/crates/nu-cli/src/cli.rs @@ -568,6 +568,13 @@ pub async fn cli( rl.set_edit_mode(edit_mode); + let max_history_size = config::config(Tag::unknown())? + .get("history_size") + .map(|i| i.value.expect_int()) + .unwrap_or(100); + + rl.set_max_history_size(max_history_size as usize); + let key_timeout = config::config(Tag::unknown())? .get("key_timeout") .map(|s| s.value.expect_int()) diff --git a/docs/commands/config.md b/docs/commands/config.md index 8e1880f37..f86abacd2 100644 --- a/docs/commands/config.md +++ b/docs/commands/config.md @@ -37,6 +37,7 @@ Syntax: `config {flags}` | table_mode | "light" or other | enable lightweight or normal tables | | edit_mode | "vi" or "emacs" | changes line editing to "vi" or "emacs" mode | | key_timeout | integer (milliseconds) | vi: the delay to wait for a longer key sequence after ESC | +| history_size | integer | maximum entries that will be stored in history (100 default) | | completion_mode | "circular" or "list" | changes completion type to "circular" (default) or "list" mode | ## Examples