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

Re: bug: _files depends on extendedglob



> Le 29 mars 2024 à 13:23, Mikael Magnusson <mikachu@xxxxxxxxx> a écrit :
> 
> The completion system sets up the options it uses on entry, if you
> change them you get to keep the pieces.

Good to know; I think I assumed that.

> (Why are you setting the
> emulation mode in a completer function anyway?)

In the linked commit from the original mail I explain the emulation mode: it is because the contributed Git completion script sets the emulation mode to ksh in order to leave most of the work to the bash completion scripts. I therefore (assume I) have to revert to zsh mode for _files to behave sensibly: not doing so produced a strange IIRC.

> If you for whatever
> reason insist on doing this, then you can setopt $_comp_options to
> restore the correct option set before calling _files.

That’s probably a much better workaround than what I had, thanks. I’ve confirmed that it works. Is this documented anywhere that I can rely on?

> -- 
> Mikael Magnusson




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