{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/vscode/issues/46436","repository_url":"https://api.github.com/repos/Microsoft/vscode","labels_url":"https://api.github.com/repos/Microsoft/vscode/issues/46436/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vscode/issues/46436/comments","events_url":"https://api.github.com/repos/Microsoft/vscode/issues/46436/events","html_url":"https://github.com/Microsoft/vscode/issues/46436","id":308144322,"number":46436,"title":"tasks.json Environment Variable Expansion Broken When Variable is Not Defined","user":{"login":"beufordy3k","id":4059486,"avatar_url":"https://avatars3.githubusercontent.com/u/4059486?v=4","gravatar_id":"","url":"https://api.github.com/users/beufordy3k","html_url":"https://github.com/beufordy3k","followers_url":"https://api.github.com/users/beufordy3k/followers","following_url":"https://api.github.com/users/beufordy3k/following{/other_user}","gists_url":"https://api.github.com/users/beufordy3k/gists{/gist_id}","starred_url":"https://api.github.com/users/beufordy3k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beufordy3k/subscriptions","organizations_url":"https://api.github.com/users/beufordy3k/orgs","repos_url":"https://api.github.com/users/beufordy3k/repos","events_url":"https://api.github.com/users/beufordy3k/events{/privacy}","received_events_url":"https://api.github.com/users/beufordy3k/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-23T18:57:07Z","updated_at":"2018-03-23T18:57:07Z","closed_at":null,"author_association":"NONE","body":"- VSCode Version: \r\nVersion 1.20.0\r\nCommit c63189deaa8e620f650cc28792b8f5f3363f2c5b\r\nDate 2018-02-07T17:09:39.780Z\r\nShell 1.7.9\r\nRenderer 58.0.3029.110\r\nNode 7.9.0\r\nArchitecture x64\r\n\r\n- OS Version: Windows 10 Enterprise x64\r\n```\r\nMajor  Minor  Build  Revision\r\n-----  -----  -----  --------\r\n6      2      9200   0\r\n```\r\n\r\nSteps to Reproduce:\r\n\r\n1. Create a task in tasks.json using latest 2.0.0 format\r\n2. Add an environment variable to the args parameter string\r\n3. If variable is present, value will be properly expanded\r\n3. If variable is **not** present, value will incorrectly use the literal environment variable name\r\n\r\nDoes this issue occur when all extensions are disabled?: Yes\r\n\r\nThis worked in vs code 1.19.3 and broke in 1.20.0 and is still broken in the latest version 1.21.1.\r\n\r\nIssue is reproduced here, https://github.com/beufordy3k/vscode-tasks-environment-issue\r\n\r\n### Task Output from 1.19.3\r\n```\r\n> Executing task: dotnet build <\r\n\r\nMicrosoft (R) Build Engine version 15.6.82.30579 for .NET Core\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n  Restore completed in 38.05 ms for C:\\tmp\\projects\\vscode-tasks-environment-issue\\vscode-tasks-environment-issue.csproj.\r\n  vscode-tasks-environment-issue -> C:\\tmp\\projects\\vscode-tasks-environment-issue\\bin\\Debug\\netcoreapp2.0\\vscode-tasks-environment-issue.dll\r\n\r\nBuild succeeded.\r\n    0 Warning(s)\r\n    0 Error(s)\r\n\r\nTime Elapsed 00:00:01.33\r\n\r\nTerminal will be reused by tasks, press any key to close it.\r\n\r\n> Executing task: C:\\tools\\CustomTool.exe server=localhost;database=CustomDatabase;Trusted_Connection=Yes;Connection Timeout=15; <\r\n```\r\n\r\n### Task Output from 1.20.0\r\n```\r\n> Executing task: dotnet build <\r\n\r\nMicrosoft (R) Build Engine version 15.6.82.30579 for .NET Core\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n  Restore completed in 53.19 ms for C:\\tmp\\projects\\vscode-tasks-environment-issue\\vscode-tasks-environment-issue.csproj.\r\n  vscode-tasks-environment-issue -> C:\\tmp\\projects\\vscode-tasks-environment-issue\\bin\\Debug\\netcoreapp2.0\\vscode-tasks-environment-issue.dll\r\n\r\nBuild succeeded.\r\n    0 Warning(s)\r\n    0 Error(s)\r\n\r\nTime Elapsed 00:00:02.04\r\n\r\nTerminal will be reused by tasks, press any key to close it.\r\n\r\n> Executing task: C:\\tools\\CustomTool.exe server=localhost${env:MyCustomVar};database=CustomDatabase;Trusted_Connection=Yes;Connection Timeout=15; <\r\n```\r\n"}}
{"actor":{"display_login":"beufordy3k"}}