Home > database >  Update Bash version for VSCode's integrated terminal | MacOS
Update Bash version for VSCode's integrated terminal | MacOS

Time:12-04

After following these instructions to update Bash and set it as my default shell on MacOS, I found that it didn't have any effect on the integrated terminal in VSCode. As shown by:

echo $0 which returned /bin/bash instead of /opt/homebrew/bin/bash.

and

echo $BASH_VERSION which returned 3.2.57(1)-release instead of 5.1.12(1)-release(or later).

 

Applying the same instructions inside VSCode, using sudo on chsh and setting "Terminal > integrated > Default Profile: Osx" to "Bash" all didn't have any effect.

How do I fix this?

 


Short instructions
  1. Download newest Bash version using Homebrew: brew install bash.

  2. Whitelist updated version (path: /opt/homebrew/bin/bash) to /etc/shells using Vim.

  3. Set as default shell using chsh -s /opt/homebrew/bin/bash.

CodePudding user response:

Simply add the following line to settings.json (which can be found inside settings) to override the original path:

// "...",

"terminal.integrated.shell.osx": "/opt/homebrew/bin/bash",

// "...",
  • Related