-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shell task without environment variables. #72323
Comments
duplicate of #72029 |
That other issue is about ${env:ENV_VAR_NAME} not expanding in tasks, not about no environment being given to the terminal. I can't reproduce that though. Can you try updating to 1.33.1 and running this task:
|
Hi @alexr00 , Indeed I updated the VSCode to 1.33.1 and I can access env variables right now ;-) Thanks a lot for the quick response and support. |
Cannot use additional environment variables in task. VSCode Version: 1.33.1 tasks.json
Terminal:
|
That is correct! This needs to be better documented. Please see the new documentation here: microsoft/vscode-docs#2603 |
#47985 is for overwriting env vars and #22374 is for global scope tasks only. There is no plan to change the behavior here. Feel free to open a feature request for it. However, it doesn't seem strictly necessary to expand env vars that are defined in the task in the task command like this. Since you are defining the value in the tasks.json, you already know the expanded value and you could easily just include the expanded value in the task command. |
We are using VSCode to build an IoT project for STM32 products using cmake. We need to build it using a toolchain and normally we can compile it from the cmd by using several environment variables with the different tools path.
We created several tasks to build and run the project, but the problem is that the cmd/powershell shell is launching VSCode does not have any environment variables.
For the moment we created a config variable in the settings to specify the root folder of all the compilation tools, but we do not think ois the best solution.
Steps to Reproduce:
You can see the images below of the winpty process that launch the shell:
You can see that the process is launched without the environment variables.
The text was updated successfully, but these errors were encountered: