Skip to content

config: migrate the display section to registry bindings#364

Merged
berrym merged 1 commit into
masterfrom
config/migrate-display-section
Jun 26, 2026
Merged

config: migrate the display section to registry bindings#364
berrym merged 1 commit into
masterfrom
config/migrate-display-section

Conversation

@berrym

@berrym berrym commented Jun 26, 2026

Copy link
Copy Markdown
Owner

The display section kept its keys in both the legacy config_options[]
table and the CREG registry, with hand-written display_sync_to/from_runtime
hooks copying between them. config set wrote the struct field directly via
the legacy table, so a user's config set display.X was re-seeded the next
time a mode preset applied — it never reached the registry's SESSION layer.

This binds the eight dual-table display keys to their runtime cells and
removes their legacy rows, making the registry the sole writer:

  • display.syntax_highlighting, display.autosuggestions,
    display.transient_prompt, display.theme_hot_reload,
    display.optimization_level, display.lle.pager.{enabled,min_lines,wrap_search}

config set, TOML load, and per-mode defaults now route through the registry
and write-through to the struct via the binding. A config set on a display
key — and the display lle … builtins, which already set the registry — now
lands in the SESSION layer and survives a mode switch (the previous
behavior re-seeded the user's value on the next mode preset).

display_sync_to/from_runtime are deleted and the section's hooks set to
NULL. display.performance_monitoring and display.ambiguous_width stay
legacy-only for now — neither is synced, so neither had the clobber; they are
their own migrate/wire backlog items.

Verified live: config set display.transient_prompt false survives a
lush → bash → lush round-trip; the per-mode defaults still resolve (lush on,
bash/zsh/posix off); config show display lists every key. Clean under
-Werror; 156/156 tests.

The display section kept its keys in both the legacy config_options[] table
and the CREG registry, with hand-written display_sync_to/from_runtime hooks
copying between them. config set wrote the struct field directly via the
legacy table, so a user's `config set display.X` was re-seeded the next time
a mode preset applied -- it never reached the registry's SESSION layer.

Bind the eight dual-table display keys (syntax_highlighting, autosuggestions,
transient_prompt, theme_hot_reload, optimization_level, and the three
lle.pager.* keys) to their runtime cells and remove their legacy rows, so the
registry is the sole writer: config set, TOML, and per-mode defaults route
through the registry and write-through to the struct via the binding. A
config set on a display key -- and the display lle ... builtins, which
already set the registry -- now lands in the SESSION layer and survives a
mode switch.

The display_sync_to/from_runtime hooks are deleted and the section's hooks
set to NULL. performance_monitoring and ambiguous_width stay legacy-only for
now; neither is synced, so neither had the clobber.

Verified: config set display.transient_prompt false survives a
lush -> bash -> lush round-trip; mode defaults still resolve (lush on,
bash/zsh/posix off); config show display lists every key. 156/156 tests.
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@berrym berrym merged commit cfe2cf7 into master Jun 26, 2026
5 checks passed
@berrym berrym deleted the config/migrate-display-section branch June 26, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant