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

Re: Setting cdablevars adds 10-15s to run time for non existing command

Meant to reply to this a while ago but it fell down the stack.

On Thu, Mar 18, 2021 at 4:42 PM Experts Ravioli
<experts.ravioli@xxxxxxxxx> wrote:
> If I use `setopt cdablevars` in my .zshrc and then I try to run a `insert_random_command_name_here` (which does not exist) the prompt returns after 10-15s.
> setopt autocd autopushd pushdminus pushdsilent pushdtohome cdablevars
> Does anyone have any idea?

It's not (just) cdablevars, it's autocd.  When you have both of those
set, zsh attempts to interpret 'insert_random_command_name_here' as a
possible reference to a directory to which to (auto)cd, which in turn
results in a check for whether it should create parameter table
entries for any location that might be related to that name.  If your
$path and $cdpath contain either a lot of directories or some
potentially-slow remote mount points, that operation could be very
time consuming.  If it succeeded, the result would be cached and be
fast the next time, but failure is always slow.

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