I’m trying to get VS Code to default to zsh
but it seems intent on running bash
instead.
I’m on a Mac with OS 13.6.7 installed and I’m following along with the advice in this SO thread as well as this GitHub issue. I’ve updated my settings.json
based on that advice:
{
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.profiles.osx": {
"zsh": {
"path": "/bin/zsh",
"args": [
"-l",
"-i"
]
}
},
"terminal.integrated.shellIntegration.enabled": false
}
But no matter what I do, as soon as I open up a terminal within VS Code and run echo $SHELL
, I get /bin/bash
. Meanwhile, if I run the same command in an ordinary terminal, I get /bin/zsh
.
When I inspect the default profile within the VS Code GUI it shows zsh
as the default:
And the terminal view makes it look like it’s using zsh
but an echo $SHELL
says otherwise:
Have read through the VS Code docs and talked to ChatGPT but no luck so far. Any advice?
2
Answers
If you want the
SHELL
variable to be set, you have to set it. Put into your ~/.zshenv the commandand unless one of your other startup files resets the variable, you should be fine.
My guess is that your account is configured with
bash
as login shell. By the time your VSC is called, SHELL is set to bash, and this is inherited by your zsh.If you want the
SHELL
variable to be set, you have to set it. Put into your ~/.zshenv the commandand unless one of your other startup files resets the variable, you should be fine.
Note: The
=
is for path name expansion and ensures that the absolute path of your zsh is stored intoSHELL
.My guess is that your account is configured with
bash
as login shell. By the time your VSC is called, SHELL is set to bash, and this is inherited by your zsh.