Post #2540052
2026-05-11 17:52 UTC
Went source diving to understand why `compadd` in `zsh` won't take a literal array with `-d` parameter despite `man zshcompwid` stating that it should take it.
The answer is... Yes, it takes arrays, but for `compadd` specifically an array is anything in parens, with commas and spaces as separators. It supports escaping, but that's about it. Very different from what an array in `zsh` actually is.
https://github.com/zsh-users/zsh/blob/ef574dbb79a4a0bcdaa02819954b39c9614b4b05/Src/Zle/compcore.c#L1971-L1983
This won't be fixed, but now you know.
Replies (1)
-
@manpacket@functional.cafe 2026-05-11 18:03
https://github.com/zsh-users/zsh/pull/170 - but maybe...