Closed hhoffstaette closed 3 years ago
Thanks for the report. Should be fixed in zsh-10.8.
While the commit probably does fix an issue with zram-init's own zsh-completion for the zram-init command, it's not the one I reported above. The above issue reproduces also when the _zram-init
completion is not installed at all.
Btw if you think this is a bug in zsh's _init_d
completion please let me know and I'll go bug them instead. :)
The whole approach of parsing a script like this might be considered a bug, but it is probably among the best they can do. Anyway, let's work around this problem. I would not like to rename the variable, so I hope putting the assignment not at the beginning is sufficient (at least my tests indicated that opts is not set in the completion afterwards). Hopefully really “fixed” now in 10.9
I just installed zram-init on Gentoo and while everything is working fine (thank you!), I've been puzzled by a strange zsh completion error for the init script that I really don't understand:
The
_init_d
completer is the stock zsh-5.8 script, and the line that complains is the first one in the followign block where it parses the script for commands:After a lot of trial and error I managed to trace the problem to the ZramIgnore() function and first suspected the use of eval. However as it turns out this is not the case; the only problem is the use of the
opts
identifier here. Renaming the field tooptions
lets the completer pass without error. Apparently the field name and the completion parser conflict on the identifier name, which is all sorts of terrible for a parser. Was wondering if you have any suggestions. Maybe it's just a matter of quoting and/or identifier expansion?