Open NikGovorov opened 1 year ago
did this used to work? I don't think anything's changed here recently
I'm not 100% sure whether it's a regression in VS Code or not. Maybe Tasks have never been tested with the setting. We added a feature to our extension that modifies PATH
for integrated terminal several days ago and it works well. However, our users complain that when the setting is set it breaks PATH
for tasks.
Any update on this issue?
@meganrogge - are you able to help provide an update please?
Pls do not ping me. This is one of many, many things I am working on and not a top priority. Feel free to investigate this yourself as I'm not sure when I'll get to it
Feel free to investigate this yourself as I'm not sure when I'll get to it
Will do, didn't want to do so if something was in progress. Thanks.
Hey @meganrogge, this issue might need further attention.
@NikGovorov, you can help us out by closing this issue if the problem no longer exists, or adding more information.
Regrettably, the problem persists. Below are the straightforward steps to replicate the issue:
.vscode/tasks.json
with the following content:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "echo $PATH"
}
]
}
PATH
setting to the settings.json
file:
"terminal.integrated.env.linux": {
"PATH": "${env:PATH}"
}
echo
task.Expected result:
The task prints the same content as running echo $PATH
from the integrated terminal would do - full user PATH
environment variable.
Actual result:
The task prints the basic(system) version of the PATH
variable: /usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib
Expected result: The task prints the same content as running
echo $PATH
from the integrated terminal would do - full userPATH
environment variable.Actual result: The task prints the basic(system) version of the
PATH
variable:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib
I'm seeing the same actual behaviour from tasks (in my case PATH shows as simply /bin:/usr/bin:/bb/bin
. However, I'm also getting that behaviour in integrated terminal windows - my PATH is extended in ~/.profile (and, indeed, by vscode itself adding the location of code
), but if I attempt to extend PATH to add workspace-specific stuff in .vscode/settings.json, it ends up losing all those extensions.
Does this issue occur when all extensions are disabled?: Yes
Version: 1.76.2 (user setup) Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884 Date: 2023-03-14T17:55:54.936Z Electron: 19.1.11 Chromium: 102.0.5005.196 Node.js: 16.14.2 V8: 10.2.154.26-electron.0 OS: Windows_NT x64 10.0.19045 Sandboxed: No WSL 2 Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal
Steps to Reproduce:
Result:
The integrated terminal works as expected.
terminal.integrated.env.windows.PATH
seems to work.