VScode shell

Vscode Integrated Terminal closes immediately upon opening

I started facing this issue suddenly after vscode upgrades and resolved the issue by following approach.

Follow these instruction one by one until it resolves the issue. You may have to restart your vscode multiple times during the process.

  • Upgrade vscode
  • Point $SHELL to correct shell path
    Find which shell you have, echo $SHELL mine is /bin/zsh after that I checked where my zsh shell is installed
## Find shell
echo $SHELL

## Check where zsh is installed or working from
which zsh

I got /usr/local/bin/zsh after that I updated my SHELL to correct zsh

## Filename: ~/.zshrc
export SHELL=/usr/local/bin/zsh
  • Update vscode terminal shell profile
    Open settings and scroll down in terminal section and set to your shell.
  • Restart vscode in verbose mode to check for further details
code --verbose --log debug

see if anything is unusual and share those logs here

export SHELL=/usr/local/bin/bash

References

https://github.com/Microsoft/vscode/issues/62041