aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/config.c b/config.c
index 283a72ea..2b989d62 100644
--- a/config.c
+++ b/config.c
@@ -288,7 +288,37 @@ parse_section_main(const char *key, const char *value, struct config *conf,
LOG_ERR("%s:%d: expected an integer: %s", path, lineno, value);
return false;
}
- conf->scrollback_lines = lines;
+ conf->scrollback.lines = lines;
+ }
+
+ else if (strcmp(key, "scrollback-indicator-style") == 0) {
+ if (strcmp(value, "none") == 0)
+ conf->scrollback.indicator.style = SCROLLBACK_INDICATOR_STYLE_NONE;
+ else if (strcmp(value, "fixed") == 0)
+ conf->scrollback.indicator.style = SCROLLBACK_INDICATOR_STYLE_FIXED;
+ else if (strcmp(value, "relative") == 0)
+ conf->scrollback.indicator.style = SCROLLBACK_INDICATOR_STYLE_RELATIVE;
+ else {
+ LOG_ERR("%s:%d: scrollback-indicator-style must be one of "
+ "'none', 'fixed' or 'moving'",
+ path, lineno);
+ return false;
+ }
+ }
+
+ else if (strcmp(key, "scrollback-indicator-format") == 0) {
+ if (strcmp(value, "percent") == 0) {
+ conf->scrollback.indicator.format
+ = SCROLLBACK_INDICATOR_FORMAT_PERCENTAGE;
+ } else if (strcmp(value, "line") == 0) {
+ conf->scrollback.indicator.format
+ = SCROLLBACK_INDICATOR_FORMAT_LINENO;
+ } else {
+ LOG_ERR("%s:%d: 'scrollback-indicator-format must be one "
+ "of 'percent' or 'line'",
+ path, lineno);
+ return false;
+ }
}
else {
@@ -917,8 +947,13 @@ config_load(struct config *conf, const char *conf_path)
.pad_y = 2,
.startup_mode = STARTUP_WINDOWED,
.fonts = tll_init(),
- .scrollback_lines = 1000,
-
+ .scrollback = {
+ .lines = 1000,
+ .indicator = {
+ .style = SCROLLBACK_INDICATOR_STYLE_RELATIVE,
+ .format = SCROLLBACK_INDICATOR_FORMAT_PERCENTAGE,
+ },
+ },
.colors = {
.fg = default_foreground,
.bg = default_background,