z-shell / zi

✨ A Swiss Army Knife for Zsh - Unix Shell
https://wiki.zshell.dev
MIT License
735 stars 42 forks source link

[bug]: #286

Closed md1440 closed 1 year ago

md1440 commented 1 year ago

Environment

Fedora 38 x86_64

Reproduction steps

1. Z-shell is configured with pretty standard settings according to the documentation
2. Start VSCode

Expected behavior

1. Zsh runs in Vscode with z-shell
2. I can execute exec zsh -il without issues

Current behavior

1. When starting VSCode and loading the terminal following output is registered:
/usr/share/autojump/autojump.zsh:13: command not found: uname
/usr/libexec/grepconf.sh: line 5: grep: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found
/etc/profile.d/kde.sh:7: command not found: grep
zsh: readlink: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'
zsh: basename: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'
zsh: awk: command not found...
zsh: grep: command not found...
Install package 'grep' to provide command 'grep'? [N/y] Install package 'gawk' to provide command 'awk'? [N/y] 
2. Regardless of how many times I confirm with y similar information will pop up for each plugin and it will ultimately complete without having z-shell loaded
3. The shell environment will not have access to any standard commands
4. Also, in the normal terminal, when running exec zsh -il I run into similar issues

Code snippet

./zshrc typeset -A ZI ZI[BIN_DIR]="${HOME}/.zi/bin" source "${ZI[BIN_DIR]}/zi.zsh"

autoload -Uz compinit compinit

(( ${+_comps} )) && _comps[zi]=_zi

if [[ -r "${XDG_CONFIG_HOME:-${HOME}/.config}/zi/init.zsh" ]]; then source "${XDG_CONFIG_HOME:-${HOME}/.config}/zi/init.zsh" && zzinit fi

zi snippet 'https://github.com/robbyrussell/oh-my-zsh/raw/master/plugins/git/git.plugin.zsh'

zi snippet 'https://github.com/sorin-ionescu/prezto/blob/master/modules/helper/init.zsh'

zi light z-shell/H-S-MW zi light z-shell/z-a-meta-plugins zi light-mode for z-shell/z-a-meta-plugins @annexes @annexes+ @console-tools @ext-git @fuzzy @prezto @z-shell @z-shell+ @zsh-users+fast @zunit

zstyle ':completion:' completer _complete _match _approximate zstyle ':completion::match:' original only zstyle -e ':completion::approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3>7?7:($#PREFIX+$#SUFFIX)/3))numeric)'

zstyle ':completion::matches' group 'yes' zstyle ':completion::options' description 'yes' zstyle ':completion::options' auto-description '%d' zstyle ':completion::corrections' format ' %F{green}-- %d (errors: %e) --%f' zstyle ':completion::descriptions' format ' %F{yellow}-- %d --%f' zstyle ':completion::messages' format ' %F{purple} -- %d --%f' zstyle ':completion::warnings' format ' %F{red}-- no matches found --%f' zstyle ':completion::default' list-prompt '%S%M matches%s' zstyle ':completion:' format ' %F{yellow}-- %d --%f' zstyle ':completion:' group-name '' zstyle ':completion:' verbose yes zstyle ':completion:' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[.-]= r:|=' 'l:|= r:|=' zstyle ':completion:*:functions' ignored-patterns '(|pre(cmd|exec))' zstyle ':completion:' use-cache true zstyle ':completion:*' rehash true

zstyle ':completion:*' menu select

zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

Additional information

❯ zi zstatus
Directories set: Home: /home/marc/.zi Binary: /home/marc/.zi/bin Plugin: /home/marc/.zi/plugins Snippet: /home/marc/.zi/snippets Service: /home/marc/.zi/services Modules: /home/marc/.zi/zmodules User-land: /home/marc/.zi/polaris Completions:/home/marc/.zi/completions Loaded plugins: 42 Light loaded: 41 Downloaded plugins: 44 Compiled plugins: 20 Enabled completions: 163 Disabled completions: 0 Completions available overall: 164 Snippets loaded: PZTM::archive , PZTM::directory , PZT::modules/helper/init.zsh , PZT::modules/spectrum/init.zsh , PZTM::utility

Self-service

Have you read the Contributing Guidelines?

Are you familiar with the Contributor Covenant Code of Conduct?

Contact Details

mdafeldecker@gmail.com

md1440 commented 1 year ago

Ok, when open VSCode via the terminal itself from the root of the project via command code . the terminal will load as expected. The error occurred only when starting VSCode via the dash icon. I am not sure if that is expected behavior or not...

ss-o commented 1 year ago

Hi @md1440 :wave:

It seems that the issue is unrelated to Zi, and based on the behavior you provided it appears to be a misconfiguration in VSCode settings or Zsh configuration/environment. There are too many possibilities to guess it.

Verify the configuration or the files/contents that are initialized. I recommend backing up current Zsh configuration/environment files and starting with the vanilla Zsh session in VSCode. If successful, then recover Zsh configuration/environment files in small steps while verifying the contents and periodically restarting the VSCode Zsh session. This should help to identify what causes the issue.

md1440 commented 1 year ago

Thank you @ss-o , much appreciated. You're correct, it appears to have been some weird misconfiguration. It's all running fine now.

github-actions[bot] commented 11 months ago

Issue closed and locked due to lack of activity. If you encounter this same issue, please open a new issue and refer to this closed one.