Skip to content
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

environment variable substitution not working in tasks.json #28365

Closed
britt opened this issue Jun 9, 2017 · 10 comments
Closed

environment variable substitution not working in tasks.json #28365

britt opened this issue Jun 9, 2017 · 10 comments
Assignees
Labels
tasks Task system issues
Milestone

Comments

@britt
Copy link

britt commented Jun 9, 2017

  • VSCode Version: 1.13.0
  • OS Version: macOS Sierra 10.12.5

Steps to Reproduce:

  1. Update to 1.13.0
  2. Quit VSCode
  3. Open VSCode
  4. Run a task where the command relies on env var substitution like "command": "${env.GOPATH}/bin/gnatsd",

Results:

execvp(3) failed.: No such file or directory
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Specifying a complete path to the executable works, but any path that relies on ${env.*} fails.

@vscodebot vscodebot bot added the new release label Jun 9, 2017
@britt
Copy link
Author

britt commented Jun 9, 2017

I checked and other variable substitutions like workspaceRoot still work. It is only env that fails.

@rkeithhill
Copy link

rkeithhill commented Jun 10, 2017

I'm seeing the same thing with ${env.windir} in 1.13.0. Used to work but no longer. Here's the relevant part of my tasks.json:


    // Start PowerShell
    "windows": {
        "command": "${env.windir}\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",
        "args": [ "-NoProfile", "-ExecutionPolicy", "Bypass" ]
    },

The same task works fine if I substitute C:\\Windows for ${env.windir}.

@TheBurnDoc
Copy link

TheBurnDoc commented Jun 12, 2017

Same problem in launch.json ${env.USERPROFILE} no longer works in windows

@ramya-rao-a ramya-rao-a added the tasks Task system issues label Jun 12, 2017
@triztian
Copy link

Not sure how to link issues but this is a dupe: #28533

@ucirello
Copy link

if I may add, this is a daily nuisance. IMHO, worth a recovery release.

@dbaeumer
Copy link
Member

dbaeumer commented Jun 13, 2017

This happened as a side effect of fixing
#16064. In debug land there was confusion between using '.' and ':' as a separator so we decided to use ':' as a separator for the scope. Since debug and task share the same variable resolving mechanism this got changed for tasks without a necessary deprecation warning.

So the new syntax is ${env:GOPATH} or `${env:windir}. We will look into adding a deprecation warning for this.

Sorry for the breakage.

@dbaeumer dbaeumer added this to the June 2017 milestone Jun 13, 2017
@triztian
Copy link

The docs should be updated to reflect that update.

@TheBurnDoc
Copy link

Thanks!

@dbaeumer
Copy link
Member

@gregvanl can you please update the doc for 1.13. This slipped through my cracks. The debug documentation might need some updating as well.

@gregvanl
Copy link

Documentation fixed with microsoft/vscode-docs@6c11a91

rkeithhill added a commit to PowerShell/vscode-powershell that referenced this issue Jun 17, 2017
We used to have ${env.windir} but then VSCode broke us so we switched back to C:\Windows.

It turns out that the VSCode folks changed the syntax to ${env:windir} - replacing the dot with a colon.

Here's the VSCode issue describing this: microsoft/vscode#28365 (comment)
daviwil pushed a commit to PowerShell/vscode-powershell that referenced this issue Jun 17, 2017
We used to have ${env.windir} but then VSCode broke us so we switched back to C:\Windows.

It turns out that the VSCode folks changed the syntax to ${env:windir} - replacing the dot with a colon.

Here's the VSCode issue describing this: microsoft/vscode#28365 (comment)
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tasks Task system issues
Projects
None yet
Development

No branches or pull requests

9 participants