1
0
Fork 0
mirror of synced 2024-12-22 06:01:06 -05:00
9 Troubleshooting
Eric Nielsen edited this page 2024-10-02 09:23:26 -05:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Completion is not working

If you are using the completion module, there can be a conflict if other scripts are calling compinit too. Also, if youre using this module, your should not do source ~/.zshrc when you want to reload your shell configuration, as this will cause compinit to be called twice. Do exec zsh instead.

In case you're getting a "warning: compinit being called again after completion module at .../modules/completion/init.zsh" mentioning Zim's completion module, then possibly this means your ${ZIM_HOME}/init.zsh script in being sourced twice. Double check your ~/.zshrc file.

If you use Ubuntu and installed Zsh with apt, then add the following line to your ~/.zshenv file:

skip_global_compinit=1

In case you're getting a "warning: compinit being called again after completion module at ..." message in the terminal, mentioning another script, then remove the compinit call from the mentioned file.

In case you're getting a "warning: completion was already initialized before completion module." message in the terminal, then follow these steps to check further:

  1. Run the following code in your terminal, which will add lines to your ~/.zshenv file:

    >>! ~/.zshenv <<\END
    autoload -Uz +X compinit
    functions[compinit]=$'print -u2 \'compinit being called at \'${funcfiletrace[1]}
    '${functions[compinit]}
    END
    
  2. Restart your terminal.

  3. If there's a "compinit being called at ..." message in the terminal, and it mentions Zim's "modules/completion/init.zsh" file, then you're good. Otherwise, remove the compinit call from the mentioned file:

    • If you can edit the mentioned file, remove or comment the lines similar to these:
      autoload -Uz compinit
      compinit
      
    • If the mentioned file is read-only, read it and look for specific instructions on how the compinit call should be disabled.
  4. Restart your terminal.

  5. If there's another "compinit being called at ..." message, then repeat steps 3-4 .

  6. Remove the lines added to ~/.zshenv in the first step.