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.
The Zsh completion script uses different primitives to load completion items into Zsh depending on whether a completion item has a description or not.
_describe
function is used, which expects item plus description pairs as values, separated by a colon. In turn, any colon within the item must be escaped.compadd
builtin is used, which expects literal items, without escaping. Actually escaping colons in the item will corrupt the item.click
's built-in Zsh completion class does not escape colons in the item. So it only handles the second case correctly, not the first; see e.g. #2703. This PR fixes this by choosing a suitable serialization, for each item separately, according to the abovementioned escaping requirements.Since at its core this is an issue of two systems not agreeing on the format for exchanging data, and since we principally control both systems, we could fix this on either side. However, because the Zsh completion script is typically already installed in the user's shell, which is both harder to detect within
click
and harder to change or influence, we opt to change theclick
side instead, even if it the serialization needs to be more irregular.Resolves #2703
CHANGES.rst
summarizing the change and linking to the issue.CHANGES.rst
has no entry yet for post-8.2.0 changes... versionchanged::
entries in any relevant code docs.