You are not logged in.
Recently I switched to zsh. What I noticed is that commands are not available in the same terminal window if was installed from. I have to open a new terminal window to make the command available. I guess this is some sourcing issue. I cannot remember to have had with Bash.
To give you an example. I just installed nemo but the command is not available.
:: Retrieving packages ...
cinnamon-desktop-2.0.... 217.2 KiB 2.16M/s 00:00 [############################] 100%
(5/5) checking keys in keyring [############################] 100%
(5/5) checking package integrity [############################] 100%
(5/5) loading package files [############################] 100%
(5/5) checking for file conflicts [############################] 100%
(5/5) checking available disk space [############################] 100%
(1/5) installing exempi [############################] 100%
(2/5) installing cinnamon-desktop [############################] 100%
(3/5) installing libtracker-sparql [############################] 100%
(4/5) installing cinnamon-translations [############################] 100%
(5/5) installing nemo [############################] 100%
➜ ~ ne
neon-config netlogo-3D NetworkManager
neqn netlogo-headless newgrp
net netstat New-Minty-Arch-Colours/
netcap nettle-hash newusers
netlogo nettle-lfib-stream
Anyone else having the same with zsh?
Last edited by orschiro (2014-01-10 21:39:29)
Offline
Try rehash.
Offline
Issue the command, it should work; what you're seeing should only affect tab completion.
Offline
Thanks for your suggestions. Indeed only tab completion is affected. Can the rehash be done automatically rather than manually issuing it after every installation/removal?
Offline
Put this:
zstyle ':completion:*' rehash true
in your .zshrc
Offline
Always rehashing will slow down tab completion noticeably.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
running rehash explicitly after you have installed something new to $PATH obviously
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
running rehash explicitly after you have installed something new to $PATH obviously
This is what I do, and it works just fine. You just have to remember to do it.
Offline
@Mr.Elendig
Is there an alternative solution?
Pacman hooks!
Offline
@dodo3773
A good reason to finally introduce them.
I will mark this as solved. I added zstyle ':completion:*' rehash true to my .zshrc and cannot notice a significant performance decrease.
Thanks!
Offline
Oh, I always had the same issue. Thank goodness for your question.
Usually I open another shell under the same. I mean, simply run zsh from your zsh. Another solution could be to close your terminal emulator then open a new one, but this does take time, and wouldn't make sense from a login shell. I'll try the zstyle suggestion too.
Offline
@dodo3773
A good reason to finally introduce them.
I will mark this as solved. I added zstyle ':completion:*' rehash true to my .zshrc and cannot notice a significant performance decrease.
Thanks!
Yeah, for my use case I have never noticed any slowdown either.
Offline
Hi, I have another issue with zsh 5.0.5 and the completion system
Someone having this message "Failed to issue method call: No such file or directory"?
Real action!
$> ls <Tab>
ls Failed to issue method call: No such file or directory
bin/
files
bin Documents Dropbox Music Pictures Templates
Desktop Downloads Git ...
The only way to fix this is returning to previous version of zsh (with the same ~/.zshrc config ) or starting clean shell with `zsh -f`
I am fighting 3 days with this and can't find a solution
Thanks!!
Offline
Hi, I have another issue with zsh 5.0.5 and the completion system
![]()
Someone having this message "Failed to issue method call: No such file or directory"?
Real action!
$> ls <Tab> ls Failed to issue method call: No such file or directory bin/ files bin Documents Dropbox Music Pictures Templates Desktop Downloads Git ...
The only way to fix this is returning to previous version of zsh (with the same ~/.zshrc config ) or starting clean shell with `zsh -f`
I am fighting 3 days with this and can't find a solution![]()
Thanks!!
After you updated to 5.0.5 did you reboot the machine? I had some kind of issue but a simple reboot fixed it. Not sure if it was because I was starting X from .zprofile or what
Offline
Yeah, for my use case I have never noticed any slowdown either.
For me, I don't see a difference in anything except the journal. I notice that the journal tab completion in zsh can already be sluggish at times, even without rehashing. But when I don't have it set to rehash, it seems to at least be usable.
Offline
@dodo3773
I've already tested any thing and still the same
I forgot to say that in every new open terminal, it asks for password.
(~)% ls <Tab> [sudo] password for ivo:
Offline
I experienced this, and it was because it was caused by a function (or set of functions) that were being sourced when the shell starts. In particular, it was a set of systemctl shortcuts.
Offline
@ivoarch
Start a new thread and post your .zshrc etc..etc...(would make more sense anyways as it may get more hits then a thread that is already solved ) First it may be good to go through your options, functions, etc... in your .zshrc and one at a time comment them out until maybe you can find the culprit.
@WonderWoofy & @Mr.Elendig
I cannot seem to reproduce. Is it something you did specifically or? Also, are we talking about journalctl <tab><tab> or? Maybe there is something different in my .zshrc that is preventing this? Here is mine (tried to trim the aliases and funtions and stuff out (it's kind of a mess I know )):
NOPRECMD=1
function precmd() {
if [[ $TERM != linux ]]; then
print -Pn "\e]2;%~\a"
fi
}
preexec () {
if [[ $TERM != linux ]]; then
print -Pn "\e]2;%~ : $1\a"
fi
}
ulimit -c 0
autoload -U compinit
compinit
zstyle ':completion:*' menu select
export HISTFILE=~/.zsh_history
export HISTSIZE=50000
export SAVEHIST=50000
setopt share_history
eval `dircolors -b`
setopt autopushd pushdminus pushdsilent pushdtohome
setopt autocd
setopt cdablevars
setopt ignoreeof
setopt interactivecomments
setopt nobanghist
setopt hist_ignore_all_dups
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_SPACE
setopt SH_WORD_SPLIT
setopt nohup
setopt completealiases
setopt correct
unsetopt nomatch
autoload -U promptinit
promptinit
autoload -U colors && colors
zstyle ':completion:*' rehash true
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric
zstyle ':completion:*' list-dirs-first true
zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' use-cache on
zstyle ':completion::complete:*' cache-path ~/.zsh/cache
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.*' insert-sections true
zstyle ':completion:*:man:*' menu yes select
zstyle ':completion:*:processes' command 'ps -ax'
zstyle ':completion:*:processes-names' command 'ps -aeo comm='
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:*:killall:*:processes-names' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:*:killall:*' menu yes select
compdef _gnu_generic tar terminator wine
compdef _pids cpulimit
compdef _pids ps
zstyle ':completion:*:cd:*' ignore-parents parent pwd
typeset -g -A key
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line
bindkey '^?' backward-delete-char
bindkey '^[[1~' beginning-of-line
bindkey '^[[5~' up-line-or-history
bindkey '^[[3~' delete-char
bindkey '^[[4~' end-of-line
bindkey '^[[6~' down-line-or-history
bindkey '^[[7~' beginning-of-line
bindkey '^[[8~' end-of-line
bindkey '^[[A' up-line-or-search
bindkey '^[[D' backward-char
bindkey '^[[B' down-line-or-search
bindkey '^[[C' forward-char
bindkey '^i' expand-or-complete-prefix
LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:';
export LS_COLORS
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward
compdef gksu=sudo
export EDITOR="vim"
export VIDEO_FORMAT=NTSC
GPG_TTY=`tty`
export GPG_TTY
export PAGER=vimpager
alias less=$PAGER
alias zless=$PAGER
eval $(dircolors -b /home/dodo3773/.zsh/LS_COLORS)
DONTSETRPROMPT=1
if [ ${UID} -ne 0 ]; then
PS1="%{%F{white}%}%~ %{%F{green}%}%{%f%}%(10l.
.)>> "
RPROMPT='%{%F{green}%}[%{%F{red}%}%"%?%{%F{green}%}]'
else
PS1="%{%F{red}%}%~ %{%F{green}%}%{%f%}%(10l.
.)>> "
RPROMPT='%{%F{green}%}[%{%F{red}%}%"%?%{%F{green}%}]'
fi
zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==02=01}:${(s.:.)LS_COLORS}")'
unambigandmenu() {
zle expand-or-complete
zle magic-space
zle backward-delete-char
zle expand-or-complete
}
zle -N unambigandmenu
bindkey "^i" unambigandmenu
The only zsh packages I have installed are (aside from some scripts / functions / completions I found around):
extra/zsh 5.0.5-1 [installed]
aur/zsh-completions-git 0.10.0.55.g1d6a2aa-1 [installed: 20120808-2]
Offline
Ok solved
![]()
Just removed antigen and worksThanks!!
Nice nice. Sometimes it's just a matter of trial and error
Offline
My functions were doing very similar things to your alias there. Maybe it is something poorly formatted in the zsh completions for systemctl?
Offline
enabeling automatic rehash will slow down completion when you have a cache *miss*, if you generally don't get misses then you won't notice a big difference. (also depends on the os cache ofcourse)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline