Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: auto-reflesh $PATH
- X-seq: zsh-users 11236
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: auto-reflesh $PATH
- Date: Sun, 04 Mar 2007 13:16:47 -0800
- In-reply-to: <c12037010703041253q79ee8bf3g741dfe185000baaa@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <c12037010703031514h2730c96te5b721188deda41d@xxxxxxxxxxxxxx> <20070303233214.GE3072@xxxxxxxxxxxxxxx> <c12037010703041253q79ee8bf3g741dfe185000baaa@xxxxxxxxxxxxxx>
On Mar 5, 5:53am, Kazuhiko Uebayashi wrote:
} Subject: Re: auto-reflesh $PATH
}
} > ¹ <http://www.zsh.org/mla/users/2004/msg01066.html>
}
} zstyle ':completion:*' completer \
} _oldlist _expand _force_rehash _complete
}
} to my ~/.zshrc, auto-rehash works fine!
I'd forgotten about that article (and it wasn't obvious that was what
you were asking about).
It'd be interesting to try combining the two ideas, though:
_force_rehash() {
if (( CURRENT == 1 ))
then
local -a modified_path
modified_path=( ${^path}(Nms$SECONDS) )
(( $#modified_path )) && rehash
fi
return 1 # Because we didn't really complete anything
}
I'd expect that to be less intrusive than running rehash on every
command completion, but I could be wrong about the cost of doing the
${^path}(Nms$SECONDS) glob.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author