mac vscode bash: shopt: globstar: invalid shell option name [duplicate]
Asked Answered
A

0

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

Alejandrinaalejandro answered 8/3, 2019 at 16:13 Comment(6)
bash --version tells you what version you'd start if you ran the command bash, not what version of bash you're running now.Gertudegerty
Run echo "$BASH_VERSION" instead.Gertudegerty
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.Gertudegerty
(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).Gertudegerty
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.Alejandrinaalejandro
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.Skatole

© 2022 - 2024 — McMap. All rights reserved.