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

zsh config doesn't initialize correctly with shell integration enabled #145587

Closed
roblourens opened this issue Mar 21, 2022 · 1 comment · Fixed by #145610
Closed

zsh config doesn't initialize correctly with shell integration enabled #145587

roblourens opened this issue Mar 21, 2022 · 1 comment · Fixed by #145610
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-shell-integration Shell integration, command decorations, etc. verified Verification succeeded
Milestone

Comments

@roblourens
Copy link
Member

Turned on shell integration again, and my zsh configuration still isn't loading correctly, so I dug into it. I have these lines in my .zshrc which come from Prezto:

if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
  echo init
  source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi

With shell integration disabled, $ZDOTDIR is not defined, and it enters the block. With it enabled, $ZDOTDIR is /var/folders/tx/p0ycbfpj37786p760wwdg6y80000gn/T/vscode-zsh so my config isn't sourced

@Tyriar
Copy link
Member

Tyriar commented Mar 21, 2022

I guess ZDOTDIR should be unset before we run the init scripts:

if [ -f ~/.zshenv ]; then
. ~/.zshenv
fi
if [[ -o "login" && -f ~/.zprofile ]]; then
. ~/.zprofile
fi
if [ -f ~/.zshrc ]; then
. ~/.zshrc
fi
unset ZDOTDIR # ensure ~/.zlogout runs as expected

@Tyriar Tyriar added this to the March 2022 milestone Mar 21, 2022
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal-shell-integration Shell integration, command decorations, etc. labels Mar 21, 2022
Tyriar added a commit that referenced this issue Mar 21, 2022
@roblourens roblourens added the verified Verification succeeded label Mar 23, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal-shell-integration Shell integration, command decorations, etc. verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@roblourens @Tyriar @meganrogge and others