-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Can't run electron from vscode due to ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 #5064
Comments
What do you think is the issue with that env var? |
Obviously I don't know about the inner working of electron and vscode. 😄 What I did is empirically determine that this env var is the cause. I compare the env between a normal terminal and the one spawned from vscode and saw that variable is set. Once I remove it things started working again. In https://github.com/remcoros/vscode-startanyshell/blob/master/src/extension.ts#L46 "startanyshell.shells": [
{
"description": "Cmder",
"command": "start \"%description%\" \"%HOMEDRIVE%\\Program Files (x86)\\cmder\\Cmder.exe\" /START %path%"
}
] Given that, I don't see why the env var should be set and cause the issue I experienced. On the other hand, when I use |
CC /@remcoros @remcoros, I tried with @Tyriar , I do what vscode is running, Really have no idea why when |
Just dig in a bit and here is my finding: vscode runs extensions in difference process(es). In those process(es) the vscode_1.window.showErrorMessage(process.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'].toString()); |
// CC @weinand |
Looks like it's related to extensions, not launch. |
VS Code should always un-define (or set to 0) this environment variable on entry to make VS Code independent from it. |
This effects all extensions spawning an external process, not just shell extensions. vscode-cli unsets this variable on startup (see https://github.com/Microsoft/vscode/blob/ad7e861dbb9127e919bc686da162b19cbb7e2391/src/vs/workbench/electron-main/cli.ts#L59). Can this be also done for extension (forked) processes? |
@remcoros @joaomoreno that's what I was thinking; clone the env and remove the var for extension processes. |
Agree, should give the extensions a clean env to work with. |
This is loosely related to #4779, vscode sources its env by running |
@Tyriar When I say that we don't really know what the runtime consequences of unsetting it will be, I mean it in the extension host process. We do want that process to run as Node, and I'm not sure if that flag is only read on process startup or during runtime too. |
It depends on how much testing you have in place. 😜 |
Seems like it is fixed now. 🌷 |
We haven't really changed anything. The variable isn't set anymore in your world, @unional? |
I think there are PR that change |
This seems to be an issue on
vscode
vscode version: 0.10.11
OS: OSX and Windows
I'm using
vscode
andvscode-startanyshell
to opencmder
.When I run
browserify test.js | tape-run
It fails with:
After some digging, it turns out to be ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 causes the issue.
Once I remove that env variable, it started working again.
Reference:
remcoros/vscode-startanyshell#2
electron/electron#4979 (comment)
The text was updated successfully, but these errors were encountered: