Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error message when loading VS Code Unable to resolve your shell environment: A system error occured(spawn/user/bin/zsh ENOENT

Hi I am running Ubuntu 20.04 I used to have zsh installed and oh-my-zsh I have uninstalled them both and now when I start vs code using the GUI from my Desktop I receive the following error message with screenshot below

Unable to resolve your shell environment: A system error occured(spawn/user/bin/zsh ENOENT

Screenshot when VS Code Loads:

Screenshot when VS Code Loads

I have gone into the settings for vs code in default profile for linux and have set it to bash

default profile linux set to bash

when I open up vs code from the terminal by running the command code . I do not receive this error since I am in a bash terminal. I have been looking around all over to find where does vs code look for a .zsh path when loading from the GUI. thank you.

Edit: here is my settings.json

{
  "terminal.integrated.tabs.enabled": true,
  "files.trimTrailingWhitespace": true,
  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true,
  "editor.tabSize": 2,
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  "editor.formatOnSave": true,
  "liveServer.settings.CustomBrowser": "chrome",
  "update.mode": "none",
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "liveServer.settings.host": "localhost",
  "window.zoomLevel": 3,
  "files.autoSave": "afterDelay",
  "editor.minimap.enabled": false,
  "terminal.integrated.automationProfile.linux": {

  },
  "terminal.integrated.defaultProfile.linux": "bash",
  "terminal.integrated.profiles.linux": {
    
    "bash": {
      "path": "bash",
      "icon": "terminal-bash"
    },
    "fish": {
      "path": "fish"
    },
    "tmux": {
      "path": "tmux",
      "icon": "terminal-tmux"
    },
    "pwsh": {
      "path": "pwsh",
      "icon": "terminal-powershell"
    }
  },
  "terminal.integrated.defaultProfile.osx": ""
}

also included a error message I am getting for line 21 at

"terminal.integrated.automationProfile.linux": {

  },

error message on line 21:

error message on line 21

line 20 through 21 has mark for error:

line 20 through 21 has mark for error

like image 659
maritochapin Avatar asked Apr 27 '26 22:04

maritochapin


1 Answers

Based on this vscode issue comment:

sudo chsh -s /usr/bin/bash

then when I check what is my shell by running

echo $SHELL

it now points to /usr/bin/bash

The error is no longer appearing when launching VS Code from GUI.

like image 160
maritochapin Avatar answered May 06 '26 01:05

maritochapin