fix(zsh): history loading with shared option #4071
Merged
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.
description
One of the
zsh
maintainers confirmed the use offc -RI
to resolve #4061.Tested on 5.9 (latest release) and 5.0.1.
There is a bit of peculiarity, as the
history
array stands out as the only one among the history-related commands and widgets that needs a non-empty command to be entered in order to be updated.https://zsh.org/mla/users/2024/msg00692.html
The changes should be sufficiently explained by the comments and the variable names themselves. Alternatively, the man pages for reading up on the syntax are listed below, and important aspects were extracted for ease of review.
PS: It's possible for a user to explicitly disable a feature in their shell setup, which I can't imagine why anyone would ever do this.
Currently, the code loads the module if not already, and the features are set. If this causes issues, which I currently don't foresee, we could modify the command to only check if the modules and features are enabled without enabling them: