WIP: fix(complete): escaping in zsh completion #3713
Closed
+27
−5
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.
I basically went through the reproducer from #1596 and tried to narrow down which characters cause issues in:
turns out, there are a few edge cases (due to the tool tip handling) that need different escaping in the two versions. In a few cases (see comment) escaping is only needed in without-tooltip, but doesn't lead to wrong suggestions with-tooltip, so i didn't add a distinction. Note: i only went through what comes in with
.possible_values
. (at time of writing). I didn't check what happens to characters inPossibleValue::help
or other strings that get written to completion functionsfrom the top of my head, that could be
I'm a tad surprised that the escaping for single quote that was already in the code base didn't work for me …
Marking as WIP because I'm wondering: should we pursue this further? is fancy characters just a won't-fix? do we want to cover the other user-defined strings exhaustively before merging?