Open luitzifa opened 6 years ago
Update: I found the source of my Problems:
# If you don't want compinit called here, place the line
# skip_global_compinit=1
# in your $ZDOTDIR/.zshenv or $ZDOTDIR/.zprofile
if [[ -z "$skip_global_compinit" ]]; then
autoload -U compinit
compinit
fi
So all i had to do is:
echo 'export skip_global_compinit=1' >> ~./.zprofile
Oof this is a bit weird. I'm not sure the best way to solve this since I'd rather not add that export to the prezto runcoms...
Ups totally forgot where this condition is from. It's from /etc/zsh/zshrc
in Ubuntu 18.04.
So yes, it's pretty distri specific. So maybe just close and hope everyone will find it by themself?
I'll leave this open for now - it may be worth adding anyway, especially if it's in Ubuntu since it's so commonly used.
Does this affect git completions? I am having an issue with git add
completing with
-- not a git repository --
even inside git repositories. Doing the above does not fix the issue, but this issue seems close enough to my problem that I wanted to check.
I bump into a similar problem. in Opensuse 15.0 /etc/zshrc
(from package zsh) there is
autoload -U compinit
compinit
in modules/completion/init.zsh
there is
if (( $#_comp_files )); then
compinit -i -C
else
compinit -i
fi
compinit -i -C
doesn't seem to load new _function
in $fpath
, I had to compinit again.
I hope this helps.
Could tab completion no working be caused by users permissions and compaudit
?
I ran into a a similar problem with a fresh install. I eventually discover that replacing the .zcompdump
created after install with the old one, would make tab completion work again. But now I receive a zsh compinit: insecure directories, run compaudit for list
error when starting the Terminal.
Running compaudit
show the culprit is my non default /usr/local/Cellar/zsh/
and /usr/local/share/zsh/
permissions. Basically the whole usr/local
tree belongs to the group staff
and has 2775
permissions set.
To silence the warnings I ran:
sudo find /usr/local/Cellar/zsh/ -type d -exec chmod 2755 {} \;
sudo find /usr/local/share/zsh/ -type d -exec chmod 2755 {} \;
Everything works fine now and erasing and reinstalling prezto won't cause any issues.
It seems that the whole problem was caused by the non-default permissions, but the big problem was the lack of clues about what was wrong. Instead of causing an error or raising a warning, tab completions was silently failing. Maybe a permissions checking would be in order?
In Ubuntu 18.10, I "fixed" this by doing:
# disable default behavior in /etc/zsh/zshrc
echo 'export skip_global_compinit=1' >> ~/.zprofile
echo autoload -U compinit >> ~/.zshrc
echo compinit >> ~/.zshrc
My command-specific tab-completions work now.
Im mint 19 I used @stealthybox fix but I added -C
to the compinit instruction to avoid long start time
@burgesQ using compinit -C
definitely starts faster, but it breaks command completion for me. I'm not educated as to why.
but it breaks command completion for me
In the end I've struggled the same error once I rebooted my pc (& so maybe my zsh session ?). The first fix I found was to manually run a compinit
at boot. Then the compinit -C
in my zshrc
was then loading the new cache file for each new shell.
After some digging I found some interesting stuff here, and after cleaning the old caches files the completion (& my startup time) worked back like a charm.
So in then end I had to :
export skip_global_compinit=1' to
.zprofile`rm -rf ~/.zcomp{cache,file}*
zshrc
) :
autoload -Uz compinit if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then compinit; else compinit -C; fi;
@burgesQ acutally this is already done by the completion module: https://github.com/sorin-ionescu/prezto/blob/master/modules/completion/init.zsh#L35-L41
Quick question:
Is it required to delete the ~/.zcompdump
in order to get new completions to work after updating the completion submodule?
Hoping there's a better story here if so. I spent a while trying to figure out why it wasn't working and I'm assuming that the check means that it won't load new completions until 20h have passed.
I'm not sure if this is what was happening, but maybe we can add a note to the completion readme if so?
I came across this the other day while setting up a new computer –– found that all completions I was adding to my FPATH
weren't being found. I kept deleting ~/.zcompdump
, but I think that gets copied from ~/.cache/prezto/zcompdump
and I had go delete that too.
Description
Completions from completion-module are not working in new shell. I was able to verify that they are loaded by putting just a simple echo into the
init.sh
of the module.Expected behavior
When i type
vagrant
and push tab:Actual behavior
When i type
vagrant
and push tab:Steps to Reproduce
Add a new user and freshly install zprezto...
Versions