You are not logged in.
Pages: 1
I recently switched to zsh and found an issue with tab completion. If I install a package that has a command (e.g. /usr/bin/xyz), zsh won't have completions for it until I "show" zsh the command actually exists with a "which xyz". I know bash doesn't have this problem. So far, here's the solution I've found:
zstyle ':completion:*' command-path ~/bin /bin /usr/bin /sbin /usr/sbin /opt/java/jre/bin /opt/mozilla/bin
To me, this seems like an ugly solution since I'd have to maintain the path list. Is there a better way?
Offline
I just use rehash after installing a new program if I need to complete it.
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
Rehash was what I was looking for, thanks. I found a way to have it done automatically:
_force_rehash() {
(( CURRENT == 1 )) && rehash
return 1 # Because we didn't really complete anything
}
zstyle ':completion:*' completer \
_oldlist _expand _force_rehash _complete
Offline
Pages: 1