config: register display.newline_before_prompt + apply on config set#366
Merged
Conversation
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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
newline-before-promptwas reachable only through thedisplay lle newline-beforebuiltin:config.display_newline_before_promptwas a struct-only field, never registered — so
config get/set/showandTOML couldn't see it, and a
config setwouldn't take effect until restart(the composer keeps its own copy, seeded only at integration init).
display.newline_before_promptas a bound display key (CREG), sothe central config reaches it like the other display toggles.
display lle newline-beforebuiltin throughconfig_registry_setso its toggle lands in the SESSION layer (visible to
config show/save,survives a mode switch).
lle_shell_integration_sync_prompt_config(), called fromconfig_apply_settingson everyconfig set, to push the global config'snewline-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/showreach the key, itsurvives a lush → bash → lush round-trip, and the builtin toggle is reflected
in
config get.test_configgains a binding round-trip guard. Clean under-Werror; 157/157 tests.