When opening zsh on the normal terminal I have no errors, while when I open it on vscode I get this:
z4h: core parameters have unexpectedly changed
Expected:
ZDOTDIR=/Users/*******
Found:
ZDOTDIR=/var/folders/0f/**************/T/vscode-zsh
Restore the parameters or restart Zsh with exec zsh.
Restore the parameters or restart Zsh with exec zsh.
I installed zsh with z4h and for a while it worked well. Then it started showing this error randomly.
PS: I tried restarting Zsh with exec zsh.
CodePudding user response:
The message shows vscode executes zsh from /var/folders/0f/**************/T/vscode-zsh
.
But no z4h's setting there. A workaround as below:
Backup if the
/var/folders/0f/**************/T/vscode-zsh/.zshenv
and/var/folders/0f/**************/T/vscode-zsh/.zshrc
that existed in the pathCopy
/Users/*******/.zshenv
and/Users/*******/.zshrc
to/var/folders/0f/**************/T/vscode-zsh/
Restart the terminal on vscode
CodePudding user response:
If it still doesn't work. Another way that execute zsh with the same path. You need to reset the environment variable ZIM_HOME
to the Expected path.
In vscode
CMD Shift P
Choose
Preferences: Open Settings (JSON)
Add a keyname
terminal.integrated.profiles.osx
Add the following value to this key.
{ "zsh": { "path": "/bin/zsh", "ZIM_HOME": "/Users/*******/.zim" } }
It would look like as below finally.
{ ... "terminal.integrated.profiles.osx": { "zsh": { "path": "/bin/zsh", "ZIM_HOME": "/Users/*******/.zim" } } ... }
Restart the terminal.