title: "Unable to resolve your shell environment"
body: <p>On macOS Big Sur, I installed MacPorts and installed bash using it. I set my default shell to the MacPorts version of bash <code>/opt/local/bin/bash</code> by using <code>chsh</code>.</p>
  <p>All was well.</p>
  <p>I decided I would rather use Homebrew. I uninstalled MacPorts, installed Homebrew, installed bash via homebrew, and set my default shell to <code>/opt/homebrew/bin/bash</code> via <code>chsh</code>.</p>
  <p>All was well, except when I am first starting vscode (from Finder) which reports:</p>
  <pre><code>Unable to resolve your shell environment: A system error occurred (spawn /opt/local/bin/bash ENOENT)
  </code></pre>
  <p>This is a totally reasonable complaint, since that binary no longer exists. It makes this complaint when launched from Finder, but not when launched from the terminal. There is no reference to this prior version of bash in my user <code>settings.json</code> file, nor is it in my <code>.bashrc</code>.</p>
  <p>Where the heck could vscode be getting this path to bash from?!</p>
  <p>Edit (2021-10-11): there is something strange going on here. If I open an integrated terminal in vscode:</p>
  <pre class="lang-sh prettyprint-override"><code>$ echo $SHELL
  /opt/local/bin/bash
  $ ls -lh $SHELL
  ls: /opt/local/bin/bash: No such file or directory
  $ ps -p $$
    PID TTY           TIME CMD
  45388 ttys001    0:00.12 /bin/bash -l
  
  </code></pre>
  <p>(there are no such problems in the regular macOS Terminal app)</p>
  <p>Edit again (2021-10-12):</p>
  <ul>
  <li>I tried resetting vscode (via <code>rm -rf ~/Library/Application\ Support/Code</code>).</li>
  <li>I tried resetting vscode's cache (via <code>rm -rf ~/Library/Caches/com.microsoft.*</code>),</li>
  <li>I downloaded iTerm2 and ran it; it loaded the correct shell (<code>/opt/homebrew/bin/bash</code>) without issue (tried this in hopes of determining if there was some other setting in macOS pointing at the old macports version of bash).</li>
  </ul>