aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c10
-rw-r--r--config.h2
-rw-r--r--footrc5
-rw-r--r--main.c1
-rw-r--r--terminal.h1
5 files changed, 17 insertions, 2 deletions
diff --git a/config.c b/config.c
index 5ed2308b..2e41b98e 100644
--- a/config.c
+++ b/config.c
@@ -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,
diff --git a/config.h b/config.h
index 0686127e..2a6075cc 100644
--- a/config.h
+++ b/config.h
@@ -11,6 +11,8 @@ struct config {
char *shell;
tll(char *) fonts;
+ int scrollback_lines;
+
struct {
uint32_t fg;
uint32_t bg;
diff --git a/footrc b/footrc
index 5f8fdaf3..2c4961ff 100644
--- a/footrc
+++ b/footrc
@@ -1,6 +1,7 @@
-# term=foot
-# shell=/usr/bin/zsh
# font=monospace
+# scrollback=1000
+# shell=/usr/bin/zsh
+# term=foot
# workers=<number of logical CPUs>
[cursor]
diff --git a/main.c b/main.c
index 55639c65..68e22e31 100644
--- a/main.c
+++ b/main.c
@@ -387,6 +387,7 @@ main(int argc, char *const *argv)
.alt = {.damage = tll_init(), .scroll_damage = tll_init()},
.grid = &term.normal,
.render = {
+ .scrollback_lines = conf.scrollback_lines,
.workers = {
.count = conf.render_worker_count,
.queue = tll_init(),
diff --git a/terminal.h b/terminal.h
index 98ac7a72..aab8d290 100644
--- a/terminal.h
+++ b/terminal.h
@@ -315,6 +315,7 @@ struct terminal {
struct wayland wl;
struct {
+ int scrollback_lines;
struct wl_callback *frame_callback;
struct {