From 20c0add00fd29cfac602dc213af3728b0aef68a9 Mon Sep 17 00:00:00 2001 From: Eric Nielsen <4120606+ericbn@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:16:26 -0500 Subject: [PATCH] Updated Troubleshooting (markdown) --- Troubleshooting.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Troubleshooting.md b/Troubleshooting.md index 6424043..868231e 100644 --- a/Troubleshooting.md +++ b/Troubleshooting.md @@ -3,18 +3,20 @@ If you are using the `completion` module, there can be a conflict if other scripts are running `compinit` too. Follow these steps to check: -1. Run the following code in your terminal: +1. Run the following code in your terminal, which will add lines to your `~/.zshenv` file: ```zsh - setopt EXTENDED_GLOB - for ZDOTFILE in /etc/(zsh/)#(z|.z)(shenv|profile|shrc|login)(N) ${ZDOTDIR:-${HOME}}/.z(shenv|profile|shrc|login)(N); do - if grep -Eq '^[^#]*\bcompinit\b' ${ZDOTFILE}; then - print -u2 -P "%F{yellow}! You seem to be already calling %Bcompinit%b in %B${ZDOTFILE}%b.%f" - fi - done + >>! ~/.zshenv <<\END + autoload -Uz +X compinit + functions[_original_compinit]=${functions[compinit]} + functions[compinit]=$'print -u2 \'warning: compinit being called at \'${funcfiletrace[1]} + '${functions[compinit]} + END ``` -2. If there's any output, you can either: - * Remove the `compinit` call from each of the mentioned files: +2. Restart your terminal. + +3. If there's a warning message, you can either: + * 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 @@ -26,4 +28,8 @@ these steps to check: 1. Remove or comment the `zmodule completion` line from your `~/.zimrc` file. 2. Run `zimfw build` in your command prompt. -3. Restart your terminal. +4. Restart your terminal. + +5. Repeat steps 3-4 if there's another warning message. + +6. Remove the lines added to `~/.zshenv` by the first step.