Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command not found: .autocomplete.__init_ #287

Closed
beauwilliams opened this issue Jun 4, 2021 · 6 comments
Closed

command not found: .autocomplete.__init_ #287

beauwilliams opened this issue Jun 4, 2021 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@beauwilliams
Copy link

  • zsh-autocomplete version: e40c131
  • Zsh version: zsh-5.3-0-g4cfdbdb
  • Framework: none
  • Plugin manager: none
$ cd ~zsh-autocomplete
$ git switch main       # Make sure you test with the `main` branch.
$ git pull              # Update to the latest commit.
$ cd $(mktemp -d)       # Create a temp dir and enter it.
$ # Restart Zsh without config files or environment variables in this dir:
$ exec env -i HOME=$PWD PS1='%# ' TERM=$TERM zsh -f
% source /path/to/zsh-autocomplete/zsh-autocomplete.plugin.zsh
% ⚠️INSERT YOUR STEPS THAT REPRODUCE THE PROBLEM⚠️

ERROR: command not found: .autocomplete.__init_

Open shell, with minimal zshrc (single line) with source ~/.zsh/zsh-autocomplete/zsh-autocomplete.plugin.zsh
Produces error each time we start the shell

We can 'fix' the error by running exec zsh -d

Screenshot: https://i.ibb.co/Pw7GBnW/Screen-Shot-2021-06-04-at-2-56-05-pm.png

@beauwilliams beauwilliams added the bug Something isn't working label Jun 4, 2021
@marlonrichert
Copy link
Owner

  • Zsh version: zsh-5.3-0-g4cfdbdb

I don't test with Zsh < 5.7. So, no guarantees that zsh-autocomplete will work with Zsh 5.3.

We can 'fix' the error by running exec zsh -d

So, that means there's something in your global dotfiles (/etc/z*) that's messing things up. Please try to find out what it is. 🙂

What OS are you using?

@marlonrichert marlonrichert added the question Further information is requested label Jun 4, 2021
@beauwilliams
Copy link
Author

Yes I was a bit surprised to see 5.3 pop up. I did some digging and it seems the variables are not correctly reflecting the version I am running: https://i.ibb.co/cbQvhx9/Screen-Shot-2021-06-05-at-9-19-37-am.png

As far as I am aware, should be 5.8 running on OSX.

I'll do some digging around. I found some files in /private/etc but did not immediately suggest anything that could be causing the error.

@beauwilliams
Copy link
Author

Interestingly, running zsh -o SOURCE_TRACE fixes the error. I have no idea why..

Here is the output:
+/etc/zshrc:1>
+/Users/admin/.zshrc:1>
+/Users/admin/.zsh/.fzf.zsh:1>
+/usr/local/opt/fzf/shell/key-bindings.zsh:1>
+/Users/admin/.zsh/.p10k.zsh:1>
+/Users/admin/.zsh/powerlevel10k/powerlevel10k.zsh-theme:1>
+/Users/admin/.zsh/powerlevel10k/internal/p10k.zsh:1>
+/Users/admin/.zsh/powerlevel10k/internal/configure.zsh:1>
+/Users/admin/.zsh/powerlevel10k/internal/worker.zsh:1>
+/Users/admin/.zsh/powerlevel10k/internal/parser.zsh:1>
+/Users/admin/.zsh/powerlevel10k/internal/icons.zsh:1>
+/Users/admin/.iterm2_shell_integration.zsh:1>
+/Users/admin/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh:1>
+/Users/admin/.zsh/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh:1>
+/Users/admin/.zsh/fast-syntax-highlighting/fast-highlight:1>
+/Users/admin/.zsh/fast-syntax-highlighting/fast-string-highlight:1>
+/Users/admin/.zsh/zsh-vim-mode-enhanced/zsh-vi-mode.plugin.zsh:1>
+/Users/admin/.zsh/zsh-vim-mode-enhanced/zsh-vi-mode.zsh:1>
+/Users/admin/.zsh/boss-git-zsh-plugin/boss-git.plugin.zsh:1>
+/Users/admin/.zsh/enhancd/init.sh:1>
+/Users/admin/.zsh/enhancd/src/cd.sh:1>
+/Users/admin/.zsh/enhancd/src/command.sh:1>
+/Users/admin/.zsh/enhancd/src/entry.sh:1>
+/Users/admin/.zsh/enhancd/src/filepath.sh:1>
+/Users/admin/.zsh/enhancd/src/filter.sh:1>
+/Users/admin/.zsh/enhancd/src/flag.sh:1>
+/Users/admin/.zsh/enhancd/src/history.sh:1>
+/Users/admin/.zsh/enhancd/src/ltsv.sh:1>
+/Users/admin/.zsh/enhancd/src/sources.sh:1>
+/Users/admin/.zsh/enhancd/src/completion.zsh:1>
+/Users/admin/.zsh/zsh-completions/zsh-completions.plugin.zsh:1>
+/Users/admin/.zsh/alias-tips/alias-tips.plugin.zsh:1>
+/Users/admin/.zsh/plugin-osx/osx-aliases.plugin.zsh:1>
+/Users/admin/.zsh/hacker-quotes/hacker-quotes.plugin.zsh:1>
+/Users/admin/.zsh/zsh-autocomplete/zsh-autocomplete.plugin.zsh:1>
+/Users/admin/.ghcup/env:1>
+/Users/admin/.zsh/powerlevel10k/gitstatus/gitstatus.plugin.zsh:1>

@marlonrichert
Copy link
Owner

marlonrichert commented Jun 7, 2021

Yes I was a bit surprised to see 5.3 pop up. I did some digging and it seems the variables are not correctly reflecting the version I am running: https://i.ibb.co/cbQvhx9/Screen-Shot-2021-06-05-at-9-19-37-am.png

What do you get from the following?

print $SHELL $ZSH_VERSION
$SHELL --version

Interestingly, running zsh -o SOURCE_TRACE fixes the error. I have no idea why..

Perhaps because the zsh command points to Zsh 5.8, but when you initially start your shell, it actually runs Zsh 5.3?

@beauwilliams
Copy link
Author

Yep, something is not right. Bit odd, maybe its a homebrew issue..

I don't know exactly what to trust here, but I assume --version is correct in saying its 5.8. But the variables say otherwise. Yep good idea, it might be something that happens during init. perhaps zsh 5.3 calls zsh5.8

https://i.ibb.co/NtWSTCK/Screen-Shot-2021-06-07-at-6-20-22-pm.png

@beauwilliams
Copy link
Author

Okay so here is the fix, fyi for anyone else. This is related to homebrew. You need version > 5.4? for this plugin and so you need the login shell to reflect a version above that. You can get login shell with print $SHELL $ZSH_VERSION as suggested above. Note that zsh --version prints the shell you are using at the moment, but not the "default" shell as you can call it.

To change the login shell on an OSX machine (perhaps unix generally) you need append the path to your shell e.g the version homebrew installed /usr/local/bin/zsh to the file /etc/shells

Afterward you will be able to successfully run chsh -s /usr/local/bin/zsh without encountering an error chsh: /usr/local/bin/zsh: non-standard shell

marlonrichert added a commit that referenced this issue Jun 7, 2021
5.3 and lower don't support `autoload` by absolute path.

This came up in issue #287.
@marlonrichert marlonrichert added documentation Improvements or additions to documentation and removed bug Something isn't working question Further information is requested labels Jun 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants