From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8385 invoked by alias); 4 Dec 2012 15:43:25 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17456 Received: (qmail 20078 invoked from network); 4 Dec 2012 15:43:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at cs.dal.ca does not designate permitted sender hosts) Message-ID: <50BE1828.4060302@cs.dal.ca> Date: Tue, 04 Dec 2012 11:35:04 -0400 From: Norbert Zeh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: Path does not update until I logout/log in References: <1354631592.83211.YahooMailNeo@web140005.mail.bf1.yahoo.com> In-Reply-To: <1354631592.83211.YahooMailNeo@web140005.mail.bf1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12-12-04 10:33 AM, John wrote: > If I install a new executable via my package manager, zsh doesn't allow me to see it via auto-completion until I either source my ~/.zshrc again. Is there a setting that would control this? Note that under bash, I don't need to tweak anything to get this behavior. > > Here is another tangible example: > > 1) Open two xterms > 2) In one xterm do this: sudo ln -s /usr/bin/top /usr/bin/newsymlink > > Now, if in the 2nd xterm I start typing, nothing happens for autocomplete: newsy > > Here is my config file: > > $ cat ~/.zshrc > ZSH=$HOME/.zsh > > for config_file ($ZSH/lib/*.zsh) source $config_file > > > for i in aliases commonrc functions zsh ; do [[ -f $HOME/.$i ]] && . $HOME/.$i ; done > > > PROMPT='%(!.%{$fg_bold[red]%}.%{$fg_bold[white]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) %#%{$reset_color%} ' > > > REPORTTIME=5 > > autoload -U compinit > > compinit -i zsh uses a hash table to store the list of known commands. When you install a new command in your path, you need to update this hashtable by invoking "rehash". This is similar to csh, I believe (been a while since I used this last). bash, on the other hand, does a search for valid commands every single time. zsh provides this possibility, too, by setting the "rehash" option, but this is disabled by default because it incurs a speed penalty. Cheers, Norbert