8

Running vscode on Mac. I updated the Mac bash version and, as you can see the built-in vscode terminal shows the same version of bash as that of the Mac terminal. When I source my .bash_profile, I get the invalid shell option name error in the vscode terminal. What is causing this?

FWIW - the Terminal > Integrated > Shell: Osx is set to bin/bash, if that is not obvious. And, my SHELL variable is the same.

enter image description here

Bill Turner
  • 869
  • 1
  • 13
  • 27
  • 2
    `bash --version` tells you what version you'd start if you ran the command `bash`, not what version of bash you're running *now*. – Charles Duffy Mar 08 '19 at 16:17
  • 3
    Run `echo "$BASH_VERSION"` instead. – Charles Duffy Mar 08 '19 at 16:18
  • 4
    To be clear, `globstar` was added in bash 4.0, and MacOS `/bin/bash` is 3.2. Thus, the issue is *clearly* that you're running the Apple-provided instance of bash from `/bin`, not the newer one that's added to the PATH in your dotfiles after the older version is already started. – Charles Duffy Mar 08 '19 at 16:18
  • 1
    (BTW, it's pertinent/important to describe *how* you installed a newer bash; it's configured a bit differently based on whether you use Nixpkgs, or MacPorts, or HomeBrew, or built your own by hand; btw, of those options, the list is in my suggested order of preference). – Charles Duffy Mar 08 '19 at 16:22
  • 1
    changing the version in vscode preferences to point to /usr/local/bin/bash rather than /bin/bash did the trick. i did understand, btw, all about globstar being a 4.x thing, thus the reason i upgraded bash in the first place - likely via homebrew. I did that months ago. – Bill Turner Mar 08 '19 at 22:35
  • In PhpStorm (or any other of the JetBrains IDEs) you have to change the "Shell Path" under Tools-->Terminal from `/bin/bash` to `/usr/local/bin/bash` or whatever the path to the new version of bash is. – FullStack Alex Apr 28 '20 at 16:59

0 Answers0