Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Update _twisted completion



Phil Pennock wrote:
> Wait what, a function to be eval'd, so can do anything in the shell
> environment, which runs because I press tab when seeing what options
> this "command the user is not familiar with" might offer?

I don't think it is much worse than what the current _twisted does.
And in the end you have little choice than to trust all the software
you install and use on your system.

It'd be better if the packaging for Linux distributions (or BSD, opencsw
etc) coordinated things so that completion functions that aren't
distributed with zsh can go in somewhere suitable
(/usr/share/zsh/site-functions or /etc/zsh_completion.d) and then
get checked by compaudit.

I'm not especially familiar with twisted but in general, if the
completion function is going to be calling binaries to generate matches,
it is better to produce lists of things like sub-commands, options, etc
than a full completion function. These can then be used by any shell.

Another comment on _twisted is that using echo for error messages in
completion functions tends not to work too well because it mucks up
the line editor. `zle -M' or simply printing nothing (but generating no
matches) work better.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author