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 is not being passed to the extension host #65113

Closed
ramya-rao-a opened this issue Dec 14, 2018 · 7 comments
Closed

Environment variable is not being passed to the extension host #65113

ramya-rao-a opened this issue Dec 14, 2018 · 7 comments
Assignees
Labels
info-needed Issue requires more information from poster windows VS Code on Windows issues

Comments

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Dec 14, 2018

Related to microsoft/vscode-go#2026 by @lrstanley

@lrstanley is on a Windows machine and has an environment variable called GOPROXY which is available in both Git bash and the Windows command prompt.

When running VS Code (either directly or from the Git bash or the Windows command prompt), the variable is being passed to VS Code just fine as it is available when echoing in the integrated terminal.

But the same is not being passed to the Go extension. We added console.log statements in the extension code to print out process.env.GOPROXY and it wasnt available.

Therefore, logging this issue here.

@isidorn
Copy link
Contributor

isidorn commented Dec 17, 2018

I think this is a duplicate, but @weinand would know better

@isidorn isidorn assigned weinand and unassigned isidorn Dec 17, 2018
@weinand weinand assigned alexdima and unassigned weinand Dec 17, 2018
@weinand
Copy link
Contributor

weinand commented Dec 17, 2018

This doesn't seem to be debug related.

@alexdima alexdima added the windows VS Code on Windows issues label Dec 17, 2018
@alexdima
Copy link
Member

@ramya-rao-a I cannot reproduce. Here is what I have tried:

  • I have defined an environmental variable TEST_65113:

image

  • package.json:
{
    "name": "65113",
    "publisher": "alex",
    "version": "1.0.0",
    "engines": {
        "vscode": "^1.31.0"
    },
    "activationEvents": ["*"],
    "main": "index.js"
}
  • index.js
console.log(JSON.stringify(process.env['TEST_65113']));

I can then see that the value is available:
image

@alexdima alexdima added the info-needed Issue requires more information from poster label Dec 17, 2018
@lrstanley
Copy link

lrstanley commented Dec 17, 2018 via email

@alexdima
Copy link
Member

@lrstanley I also cannot reproduce when naming the environment variable as GOPROXY. The extension I've written receives the environmental variable correctly.

@lrstanley
Copy link

I can still seem to replicate, specifically with GOPROXY in relation to vscode-go. If you have a sample vsix file I could use to test, I'd imagine that would probably work. I've attempted TESTPROXY, and this is when I noticed the testing that I was told to do in microsoft/vscode-go#2026 may have not been correct. After testing, I cannot print any of the environment variables from process.env within the vscode-go extension section that I was told to modify when debugging.

I will follow up in microsoft/vscode-go#2026 to troubleshoot on the vscode-go side a bit more.

@lrstanley
Copy link

Confirmed, this can be closed -- not an issue with vscode.

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

5 participants