Thursday, January 10, 2008

geek entry: One reason ZSH can have problems.

[Warning: non-geeks or geeks in areas other than unix can stop reading now. This isn't going to be relevant to you.]

OK, so, after doing a google search, I failed to find help for the following error message from zsh:

_main_complete: function definition file not found

(it's actually something like "_main_complete:12: _main_complete: function definition file not found", but the 12 can vary, so the main thing is the rest of the error message.)

Anyway, it seems to me that the problem, in at least my case, is this:

As a former ksh user, I have dot-files that set FPATH, and that seems to break this. Or at least it does with my current value.

Commenting out the line from .profile or wherever you have that sets FPATH seems to fix the problem (though you also loose that functionality). Alternately, just making sure the previous value of $FPATH (i.e. the one the shell had before getting to your dot-files) is in your new value also seems to work.

edit: so, instead of FPATH=/what/ever, try FPATH=$FPATH:/what/ever

Hopefully this'll help someone... the only hits I found weren't helpful in my case.


Anonymous said...

Thanks for the post! I'm a first-time Ubuntu convert from Debian and had moved my .zshrc file over from the old machine to the new one. I found this blog post and you were able to take care of the problem. Thanks!

apthorpe said...

It looks like defaults are being picked up from /etc/zsh/zshrc

Every time I copy my .zshrc file to a new machine, I have to readjust my FPATH to take into account new version numbers (/usr/share/zsh/x.y.z/functions) and I'd really like to avoid that. Simply not setting fpath in my .zshrc seemed to fix matters - thanks for the tip!