If you only need the $PATH to be set in the integrated terminal, you can use VS Code's terminal.integrated.env.<platform> setting (added in version 1.15). Find the setting for your platform in the settings, click "Edit in settings.json", and add a "PATH" field like so:
"terminal.integrated.env.osx": {
"PATH": "${env:PATH}:/my/path"
}
(Replace .osx with .linux or .windows as needed.)
The expression ${env:PATH} causes the existing contents of the $PATH environment variable to be inserted. This way you can extend it without hard-coding it.
As for having the $PATH available everwhere in VS Code, so that it will
be used by extensions that call binaries, the only workaround I've found so far is this:
Configure your shell to have the
$PATHyou want. For example, I'm using Bash, and my~/.bash_profilehas the following line:PATH="$PATH:$HOME/bin"In VS Code, press ⇧⌘P and type
install 'code' commandif you haven't done so before.Quit VS Code.
Launch VS Code not by clicking its icon in the dock, but by opening Terminal.app and typing
code. Your newly set path will be active in VS Code until you quit it.If VS Code restarts, for example due to an upgrade, the
$PATHwill reset to the system default. In that case, quit VS Code and re-launch it by typingcode.
Update: VS Code on Mac and Linux now apparently tries to automatically resolve the shell environment when it is started by clicking the icon (rather than via code). It does this by temporarily starting a shell and reading the environment variables. I haven't tested this though.
If you only need the $PATH to be set in the integrated terminal, you can use VS Code's terminal.integrated.env.<platform> setting (added in version 1.15). Find the setting for your platform in the settings, click "Edit in settings.json", and add a "PATH" field like so:
"terminal.integrated.env.osx": {
"PATH": "${env:PATH}:/my/path"
}
(Replace .osx with .linux or .windows as needed.)
The expression ${env:PATH} causes the existing contents of the $PATH environment variable to be inserted. This way you can extend it without hard-coding it.
As for having the $PATH available everwhere in VS Code, so that it will
be used by extensions that call binaries, the only workaround I've found so far is this:
Configure your shell to have the
$PATHyou want. For example, I'm using Bash, and my~/.bash_profilehas the following line:PATH="$PATH:$HOME/bin"In VS Code, press ⇧⌘P and type
install 'code' commandif you haven't done so before.Quit VS Code.
Launch VS Code not by clicking its icon in the dock, but by opening Terminal.app and typing
code. Your newly set path will be active in VS Code until you quit it.If VS Code restarts, for example due to an upgrade, the
$PATHwill reset to the system default. In that case, quit VS Code and re-launch it by typingcode.
Update: VS Code on Mac and Linux now apparently tries to automatically resolve the shell environment when it is started by clicking the icon (rather than via code). It does this by temporarily starting a shell and reading the environment variables. I haven't tested this though.
In:
> Preferences: Open Settings (JSON)
add to the JSON file:
"terminal.integrated.env.windows": {
"PATH": "${env:PATH}"
},
-> terminal.integrated.env should end with .osx, .linux or .windows depending on your OS.
In order to check if it works execute in your VS Code Terminal:
# For PowerShell
echo $env:PATH
# For bash
echo "$PATH"
Set environment variables in VSCode (Windows) - Node - Code with Mosh Forum
Integrated terminal does not load PATH environment variable from user environment variables on windows 10
Injecting Environment Variables into Terminal
How to set environmental variable using WSL terminal integrated in VSCode?
Videos
In my VSCode settings.json file I have this setting:
"terminal.integrated.env.windows": {
"TERM_PROGRAM": "vscode"
},which allows me to I run `echo $TERM_PROGRAM` using the bash terminal integrated into VSCode and returns `vscode`.
I'm wondering is there any way I can do I similar think using the WSL terminal integrated into VSCode. Does anyone know?
I'd like to create a conditional to customize my Bash prompt I use across different systems but have it not print my fastfetch output if I'm using VSCode because it clogs up the terminal real estate.
In Visual Studio Code open Settings (JSON) from the command palete (⇧⌘P), and at the end of the file add the following
"terminal.integrated.env.osx": {
"PATH": ""
}
Restart VSCode and you are all set.
Taken from https://github.com/Microsoft/vscode-python/issues/4434
You can uncheck Terminal › Integrated: Inherit Env option, which can be searched by terminal.integrated.inheritEnv, in Visual Studio Code Settings like the following image:

Referece: https://github.com/microsoft/vscode/issues/70248#issuecomment-502186149 (Now the option terminal.integrated.inheritEnv is included in the stable build.)