conf: make number of scrollback lines configurable

This commit is contained in:
Daniel Eklöf 2019-08-01 19:28:14 +02:00
parent 67b4b9401d
commit 4801e39eae
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 17 additions and 2 deletions

View file

@ -162,6 +162,15 @@ parse_section_main(const char *key, const char *value, struct config *conf,
conf->render_worker_count = count;
}
else if (strcmp(key, "scrollback") == 0) {
unsigned long lines;
if (!str_to_ulong(value, 10, &lines)) {
LOG_ERR("%s:%d: expected an integer: %s", path, lineno, value);
return false;
}
conf->scrollback_lines = lines;
}
else {
LOG_WARN("%s:%u: invalid key: %s", path, lineno, key);
return false;
@ -407,6 +416,7 @@ config_load(struct config *conf)
.term = strdup("foot"),
.shell = get_shell(),
.fonts = tll_init(),
.scrollback_lines = 1000,
.colors = {
.fg = default_foreground,