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

Re: Having a hard time dealing with a completion collision



On Tue, 2020-02-18 at 21:17 +0200, Doron Behar wrote:
> On Tue, Feb 18, 2020 at 05:02:20PM +0000, Peter Stephenson wrote:
> > 
> > The files have different names, so they're both loaded.  To get the
> > first file to be loaded used by compdef, remove the ~/.zcompdump* file
> > --- exact names vary depending on configuration but it's safe to
> > remove any you find --- and it will be regenerated with the correct
> > configuration next time you start the shell.
> If I remove the ~/.zcompdump* files and don't ran the `compdef` command,
> the same issue occurs.

That suggests something unusual in your set up as the compinit script
handles this case by design.  For example,

- fpath is being modified after compinit;
- something is using "compdef" explicitly for the wrong function.

Obviously, those are just random guesses.  You can get a bit further
by looking in the appropriate .zcompdump file.  If it's showing
the wrong function, that suggests the fpath was not set up
correctly at the point compinit was run.  If it's showing
the right function, something monkeyed with the definition later.
  
If you care enough, you could instrument compdef to print a message
when it handles one of the two functions.

However, your workaround of using compdef by hand will be fine.

pws



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