add support for specifying max history size in config (#1829) (#1837)

This commit is contained in:
lightclient 2020-05-18 16:27:08 -06:00 committed by GitHub
parent 6efabef8d3
commit 3144dc7f93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -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())

View File

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