mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-05-30 21:38:03 -04:00
Add an optional build-time switch to disable scrollback support
This change introduces a new `scrollback` Meson build option (enabled by default) that lets foot be compiled without scrollback history. When the option is off, `FOOT_HAVE_SCROLLBACK` is left undefined and the relevant code is excluded from the build, producing a slimmer terminal for use cases that do not need it. With scrollback disabled: - The `[scrollback]` section in `foot.ini` and its key bindings become no-ops. - In-terminal search is removed, along with the "pipe scrollback" action, the scrollback indicator, and their colors/overlays. - IME hooks for the search box, mouse-wheel scrollback handling, and related `terminal` state are compiled out. - Selection auto-scroll (the timer that scrolls the viewport while a drag-selection extends past the visible area) is removed, since with no scrollback there is nowhere to scroll to. The associated function declarations, `enum selection_scroll_direction`, the `auto_scroll` field on `terminal::selection`, and their init/teardown sites are all excluded from the build. To keep action enumerations stable across build configurations, two range markers (`BIND_ACTION_PIPE_FIRST` / `BIND_ACTION_PIPE_LAST`) are introduced so that pipe-action handling does not depend on `PIPE_SCROLLBACK` being present. The build summary and `foot --version` now report `+scrollback` or `-scrollback`, and the config tests have been updated to account for optional section.
This commit is contained in:
parent
f35e60577f
commit
d28ac267d2
25 changed files with 317 additions and 22 deletions
|
|
@ -111,7 +111,9 @@ key_binding_new_for_seat(struct key_binding_manager *mgr,
|
|||
struct key_set set = {
|
||||
.public = {
|
||||
.key = tll_init(),
|
||||
#if defined(FOOT_HAVE_SCROLLBACK)
|
||||
.search = tll_init(),
|
||||
#endif
|
||||
.url = tll_init(),
|
||||
.mouse = tll_init(),
|
||||
},
|
||||
|
|
@ -152,7 +154,9 @@ key_binding_new_for_conf(struct key_binding_manager *mgr,
|
|||
struct key_set set = {
|
||||
.public = {
|
||||
.key = tll_init(),
|
||||
#if defined(FOOT_HAVE_SCROLLBACK)
|
||||
.search = tll_init(),
|
||||
#endif
|
||||
.url = tll_init(),
|
||||
.mouse = tll_init(),
|
||||
},
|
||||
|
|
@ -531,6 +535,7 @@ convert_key_bindings(struct key_set *set)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(FOOT_HAVE_SCROLLBACK)
|
||||
static void
|
||||
convert_search_bindings(struct key_set *set)
|
||||
{
|
||||
|
|
@ -541,6 +546,7 @@ convert_search_bindings(struct key_set *set)
|
|||
convert_key_binding(set, binding, &set->public.search);
|
||||
}
|
||||
}
|
||||
#endif /* FOOT_HAVE_SCROLLBACK */
|
||||
|
||||
static void
|
||||
convert_url_bindings(struct key_set *set)
|
||||
|
|
@ -597,7 +603,9 @@ load_keymap(struct key_set *set)
|
|||
}
|
||||
|
||||
convert_key_bindings(set);
|
||||
#if defined(FOOT_HAVE_SCROLLBACK)
|
||||
convert_search_bindings(set);
|
||||
#endif
|
||||
convert_url_bindings(set);
|
||||
convert_mouse_bindings(set);
|
||||
|
||||
|
|
@ -638,7 +646,9 @@ static void NOINLINE
|
|||
unload_keymap(struct key_set *set)
|
||||
{
|
||||
key_bindings_destroy(&set->public.key);
|
||||
#if defined(FOOT_HAVE_SCROLLBACK)
|
||||
key_bindings_destroy(&set->public.search);
|
||||
#endif
|
||||
key_bindings_destroy(&set->public.url);
|
||||
key_bindings_destroy(&set->public.mouse);
|
||||
set->public.selection_overrides = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue