mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
conf: make number of scrollback lines configurable
This commit is contained in:
parent
67b4b9401d
commit
4801e39eae
5 changed files with 17 additions and 2 deletions
10
config.c
10
config.c
|
|
@ -162,6 +162,15 @@ parse_section_main(const char *key, const char *value, struct config *conf,
|
||||||
conf->render_worker_count = count;
|
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 {
|
else {
|
||||||
LOG_WARN("%s:%u: invalid key: %s", path, lineno, key);
|
LOG_WARN("%s:%u: invalid key: %s", path, lineno, key);
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -407,6 +416,7 @@ config_load(struct config *conf)
|
||||||
.term = strdup("foot"),
|
.term = strdup("foot"),
|
||||||
.shell = get_shell(),
|
.shell = get_shell(),
|
||||||
.fonts = tll_init(),
|
.fonts = tll_init(),
|
||||||
|
.scrollback_lines = 1000,
|
||||||
|
|
||||||
.colors = {
|
.colors = {
|
||||||
.fg = default_foreground,
|
.fg = default_foreground,
|
||||||
|
|
|
||||||
2
config.h
2
config.h
|
|
@ -11,6 +11,8 @@ struct config {
|
||||||
char *shell;
|
char *shell;
|
||||||
tll(char *) fonts;
|
tll(char *) fonts;
|
||||||
|
|
||||||
|
int scrollback_lines;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint32_t fg;
|
uint32_t fg;
|
||||||
uint32_t bg;
|
uint32_t bg;
|
||||||
|
|
|
||||||
5
footrc
5
footrc
|
|
@ -1,6 +1,7 @@
|
||||||
# term=foot
|
|
||||||
# shell=/usr/bin/zsh
|
|
||||||
# font=monospace
|
# font=monospace
|
||||||
|
# scrollback=1000
|
||||||
|
# shell=/usr/bin/zsh
|
||||||
|
# term=foot
|
||||||
# workers=<number of logical CPUs>
|
# workers=<number of logical CPUs>
|
||||||
|
|
||||||
[cursor]
|
[cursor]
|
||||||
|
|
|
||||||
1
main.c
1
main.c
|
|
@ -387,6 +387,7 @@ main(int argc, char *const *argv)
|
||||||
.alt = {.damage = tll_init(), .scroll_damage = tll_init()},
|
.alt = {.damage = tll_init(), .scroll_damage = tll_init()},
|
||||||
.grid = &term.normal,
|
.grid = &term.normal,
|
||||||
.render = {
|
.render = {
|
||||||
|
.scrollback_lines = conf.scrollback_lines,
|
||||||
.workers = {
|
.workers = {
|
||||||
.count = conf.render_worker_count,
|
.count = conf.render_worker_count,
|
||||||
.queue = tll_init(),
|
.queue = tll_init(),
|
||||||
|
|
|
||||||
|
|
@ -315,6 +315,7 @@ struct terminal {
|
||||||
|
|
||||||
struct wayland wl;
|
struct wayland wl;
|
||||||
struct {
|
struct {
|
||||||
|
int scrollback_lines;
|
||||||
struct wl_callback *frame_callback;
|
struct wl_callback *frame_callback;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue