Zsh-autocomplete: Not able to change directories without cd.

Created on 6 May 2020  Β·  16Comments  Β·  Source: marlonrichert/zsh-autocomplete

Not able to cd to a directory without cd, permission denied.
Without plugin.
tanish@us01:tanish/tanish_main1
β–Ά IOR
tanish/tanish_main1/IOR

With plugin.
tanish@us01:tanish/tanish_main
β–Ά IOR
zsh: permission denied: IOR

Most helpful comment

Why is unsetopt AUTO_CD required for the plugin to work?

All 16 comments

Why is unsetopt AUTO_CD required for the plugin to work?

It’s not strictly required. It just felt like it works better without it. I can remove it.

@TanishBansal It's gone now. Please git pull to update. πŸ™‚

With the current master, and as noted by @hliu202 I still need to setopt AUTO_CD after zsh-autocomplete is sourced.
I didn't set it previously before adding zsh-autocomplete, but somehow it still worked as if it was set.

Ah, I think I know what the problem is. I probably introduced it in 0d3ff05933a7e1482e01399c73e8532030ababaf. I think I know how to fix it.

Thanks!

@CallumHoward I pushed in a new fix. Please try again. πŸ™‚

Huh, I tried it and it causes my shell to exit before the first command gets executed.
To clarify, I can type a command, but as soon as I hit return, the shell exits.

What else are you using? If you comment out everything else in your .zshrc, does it still happen? Something might be conflicting with what zsh-autocomplete is doing.

yep, narrowed it down to https://github.com/zdharma/fast-syntax-highlighting
Actually, I'm investigating further and it seems there is more than one conflict, will update.
Also seems to be this one https://github.com/softmoth/zsh-vim-mode/

Ok, sorry it seems I am getting inconsistent results or I was mistaken. It seems that it is just https://github.com/softmoth/zsh-vim-mode/ alone that is incompatible. fast-syntax-highlighting seems to work fine with zsh-autocomplete.

Thanks, I'll test it.

I tried https://github.com/softmoth/zsh-vim-mode/ and although it didn't make my shell exit, it did cause all kinds of other problems in zsh-autocomplete.

I found a solution for it, though: You need to source zsh-vim-mode after zsh-autocomplete. Otherwise, its keymap tracking feature will undo some of the work that zsh-autocomplete does.

Huh, I was already sourcing it after. Perhaps it is another setting somewhere, I'll try and narrow it down some more.

Actually, after some more testing, I find that even if I change the order of sourcing the two, zsh-vim-mode _still_ messes up some of zsh-autocomplete features. So, scratch that.

Have you tried adding VIM_MODE_TRACK_KEYMAP=no to your .zshrc?

The only way I can find to stop zsh-vim-mode from messing with zsh-autocomplete is to

  1. Set VIM_MODE_TRACK_KEYMAP=no.
  2. Source zsh-vim-mode _before_ zsh-autocomplete.

But I'm closing this issue now, because the discussion is going really off topic. Feel free to open a new one. πŸ™‚

Sourcing zsh-autocomplete after seemed to fix it, all seems to be working well now without the need for setopt AUTO_CD also. Thanks for your help!

OK, sourcing it after still led to some unexpected results for me, but I'm glad it works for you. πŸ™‚

Was this page helpful?
0 / 5 - 0 ratings