microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.38k stars 29.32k forks source link

Bash Version from inside the script is old and not what was explicitly defined in VSCODE settings #150871

Closed lamyergeier closed 2 years ago

lamyergeier commented 2 years ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Install Latest Bash from homebrew. Change the default terminal for MAC OS from System preferences and using chsh command on terminal
  2. Change the terminal settings in VSCODE
    "terminal.integrated.profiles.osx": {
        "new bash": { // profile name
            "path": "/usr/local/bin/bash"
        }
    },
    "terminal.integrated.defaultProfile.osx": "new bash",
  1. Now VScode shows
$ echo $BASH_VERSION
5.1.16(1)-release
  1. Run a bash script from VSCODE terminal
cat a.sh
#!/usr/bin/env bash
echo $BASH_VERSION

It prints the old version 3 of Bash.

Issues

The bashscript uses old version of Bash.

meganrogge commented 2 years ago

If you create a second terminal, is the bash version correct?

lamyergeier commented 2 years ago

@meganrogge Yes. Have you tried to replicate my steps?

meganrogge commented 2 years ago

/duplicate #142425

vscodenpa commented 2 years ago

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!

lamyergeier commented 2 years ago

@meganrogge my first terminal is always correct. This is not a duplicate. It has nothing to do with that issue.

meganrogge commented 2 years ago

You indicated above that the version used for the first terminal you create is wrong and the second and beyond are correct.

Is that accurate?

lamyergeier commented 2 years ago

@meganrogge No I didn't indicate that. Could you please cite the statement which reflects that?

I didn't claim any issue with the terminal but for the version of bash inside bash script.