It seems you tried to enter this
terminal.integrated.env.linux
into the terminal prompt itself, which treated it as a literal command.
What that guide on PYTHONPATH meant when it said "through the terminal settings" was Visual Studio Code's Integrated Terminal settings: https://code.visualstudio.com/docs/getstarted/settings. Specifically the settings under Terminal (filtered on terminal.integrated.env):

Depending on your OS/platform, you put a terminal.integrated.env.<os> block in your VS Code's settings.json file to specify the environment variables to inject when using VS Code's integrated terminal:
From https://code.visualstudio.com/docs/getstarted/settings#_default-settings:
// Object with environment variables that will be added to the
// VS Code process to be used by the terminal on Linux. Set to
// `null` to delete the environment variable.
"terminal.integrated.env.linux": {},
So if you are on Linux:
"terminal.integrated.env.linux": {
"PYTHONPATH": "<absolute path>"
},
Note: see the Python docs on PYTHONPATH on what exactly needs to be specified here.
Or, as the guide says, you can also specify a .env file.
It seems you tried to enter this
terminal.integrated.env.linux
into the terminal prompt itself, which treated it as a literal command.
What that guide on PYTHONPATH meant when it said "through the terminal settings" was Visual Studio Code's Integrated Terminal settings: https://code.visualstudio.com/docs/getstarted/settings. Specifically the settings under Terminal (filtered on terminal.integrated.env):

Depending on your OS/platform, you put a terminal.integrated.env.<os> block in your VS Code's settings.json file to specify the environment variables to inject when using VS Code's integrated terminal:
From https://code.visualstudio.com/docs/getstarted/settings#_default-settings:
// Object with environment variables that will be added to the
// VS Code process to be used by the terminal on Linux. Set to
// `null` to delete the environment variable.
"terminal.integrated.env.linux": {},
So if you are on Linux:
"terminal.integrated.env.linux": {
"PYTHONPATH": "<absolute path>"
},
Note: see the Python docs on PYTHONPATH on what exactly needs to be specified here.
Or, as the guide says, you can also specify a .env file.
Personally I like to put the relative path to the current directory:
"terminal.integrated.env.linux": {
"PYTHONPATH": "./"
},
Then terminals started from the project folder have that folder added to the PYTHONPATH.
visual studio code - terminal.integrated.env.windows for Integrated Terminal - Stack Overflow
How can I globally set the PATH environment variable in VS Code? - Stack Overflow
Setting of terminal.integrated.env.windows do not works in the new version
Usage of terminal.integrated.env is now showing 'Do you allow this workspace to modify your terminal shell? env' info message
Videos
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.)
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"
My OS is Windows and I usually work with cmake-based C projects. The compiler isn't always the same, it generally changes for each project.
I usually launch and configure the environment variables (PATH and others) of a terminal depending on the project I'm working on. I have terminal configuration for projects that need an instance of arm-gcc (installed in C:\nxp\toolchanins\... for example). Another terminal configuration for avr8-gcc and so on.
In this way cmake is able to find the correct compiler of the project (arm-gcc, avr-gcc or other) without putting any absolute path in the build configuration files (CMakeLists.txt, CMakePresets.json, ...).
I thought it was obvious to launch vscode from the same build terminal to have the same behaviour... and indeed it really works. However it works until I launch a second VSCode instance on a different compiler project. It seems the second VSCode instance inherit the same env variables from the first VSCode instance, ignoring the env variables of the terminal it was launched from.
The solution I found is to modify .vscode/settings.json, putting there the env variables needed for the workspace. In this case I need to use absolute paths, that isn't too good. And I need to specify the env variables multiple times in settings.json ("terminal.integrated.env.windows", "cmake.configureEnvironment" and so on).
Do you suggest another and better approach?
Yes, you can use one of these settings (depending in your platform):
"terminal.integrated.env.linux": {},
"terminal.integrated.env.windows": {},
"terminal.integrated.env.osx": {
"PYTHONPATH": "${workspaceFolder}/src:${env:PYTHONPATH}"
},
However, they will only work for the integrated terminal, not for any other processes the vs code python extension might spawn (tests, linting, debugger). For those you need to use the .env file.
Edit:
It is worth noting that if you start VS Code from the terminal it should inherit any env variables from terminal environment (at least for all the spawned subprocesses, probably not for the integrated terminal).
If you don't want to set environment variables using the terminal you can do it using configuration files.
You need to run the following line in a new window of one of your terminals (Command Prompt, Powershell, ...):
code
It will open 'VS Code' once from them.
Now you can close and re-open 'VS Code' again as many time as you want using its normal shortcuts and have your environment variables.
This manually resets the path variable in the specific PowerShell terminal.
$env:Path = `
[System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + `
[System.Environment]::GetEnvironmentVariable("Path","User")