Skip to content

config: register display.newline_before_prompt + apply on config set#366

Merged
berrym merged 1 commit into
masterfrom
config/register-newline-before-prompt
Jun 26, 2026
Merged

config: register display.newline_before_prompt + apply on config set#366
berrym merged 1 commit into
masterfrom
config/register-newline-before-prompt

Conversation

@berrym

@berrym berrym commented Jun 26, 2026

Copy link
Copy Markdown
Owner

newline-before-prompt was reachable only through the
display lle newline-before builtin: config.display_newline_before_prompt
was a struct-only field, never registered — so config get/set/show and
TOML couldn't see it, and a config set wouldn't take effect until restart
(the composer keeps its own copy, seeded only at integration init).

  • Register display.newline_before_prompt as a bound display key (CREG), so
    the central config reaches it like the other display toggles.
  • Route the display lle newline-before builtin through config_registry_set
    so its toggle lands in the SESSION layer (visible to config show/save,
    survives a mode switch).
  • Add lle_shell_integration_sync_prompt_config(), called from
    config_apply_settings on every config set, to push the global config's
    newline-before and transient-prompt flags into the composer — so a config
    set applies at the next prompt, not only after a restart.

Verified deterministically: config get/set/show reach the key, it
survives a lush → bash → lush round-trip, and the builtin toggle is reflected
in config get. test_config gains a binding round-trip guard. Clean under
-Werror; 157/157 tests.

The newline-before-prompt feature was reachable only through the
`display lle newline-before` builtin: config.display_newline_before_prompt
was a struct-only field, never registered, so config get/set/show and TOML
could not see it. Register it as a bound display key, so the central config
reaches it like the other display toggles, and route the builtin's on/off
through config_registry_set so its change lands in the SESSION layer
(visible to config show / config save and surviving a mode switch).

A config set now takes effect at runtime. The prompt composer keeps its own
copy of the flag, seeded only at integration init, so add
lle_shell_integration_sync_prompt_config() -- called from
config_apply_settings on every config set -- to push the global config's
newline-before and transient-prompt flags into the composer. Without it a
config set would apply only after a restart.

Verified: config get/set/show reach the key, it survives a lush -> bash ->
lush round-trip (SESSION layer), and the builtin's toggle is reflected in
config get. test_config gains a binding round-trip guard.
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 28.57143% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/builtins/display/lle_newline_before.c 0.00% 6 Missing ⚠️
src/lle/lle_shell_integration.c 33.33% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@berrym berrym merged commit 5e0142e into master Jun 26, 2026
5 checks passed
@berrym berrym deleted the config/register-newline-before-prompt branch June 26, 2026 13:36
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