fix: export env vars in bash/zsh completion hooks#112
Merged
Conversation
…ion hooks The bash and zsh registration scripts set COMPLETE and _COMPLETE_INDEX as shell variables inside $(...) subshells, but never export them. This means the CLI binary does not see them in process.env, falls through to normal arg parsing, and errors on the -- separator. Fish and nushell are unaffected because they use inline prefix syntax (COMPLETE=fish cmd ...) which always exports to the child. Signed-off-by: LeTamanoir <martin.saldinger@kiln.fi>
923b9ef to
876c780
Compare
Contributor
Author
|
Sorry somehow I opened a PR about this but mistakenly closed it, gonna try to not blow up this one 😁 |
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.
Summary
COMPLETEand_COMPLETE_INDEXas shell variables inside$(...)subshells, but neverexportthemprocess.env.COMPLETEto enter completion mode - since the vars aren't exported, it never sees them--separator, and outputs an error that the shell interprets as completion candidatesCOMPLETE=fish cmd ...)Reproduction