Commit 70a0817
Expand zsh compdef patterns (#311)
* Expand zsh compdef patterns
* Fix zsh bridge losing 85% of completers due to bare #compdef aborting the glob loop
Lines like "#compdef -value-,DISPLAY,-default-" were reduced to a bare
"#compdef" by the sed option-stripping step. This reached the while
loop, matched the glob-character check, and caused an invalid pattern
error that aborted the entire loop, dropping all subsequent entries.
Filter these bare #compdef strings before the loop so glob expansion
runs to completion.
Assisted-by: Crush:glm-5.2
* Isolate glob expansion in subshell to contain malformed patterns
A bare #compdef was one bad pattern that aborted the while loop, but
malformed globs like unmatched parens or brackets from other zsh
completion packages could cause the same failure. Running the expansion
in a subshell with stderr suppressed ensures any bad pattern only
skips that single entry instead of aborting the entire loop.
Assisted-by: Crush:glm-5.2
---------
Co-authored-by: rsteube-bot <rsteube-bot@users.noreply.github.com>1 parent 093178b commit 70a0817
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
0 commit comments