facebookarchive / atom-ide-ui

A collection of user interfaces for Atom IDE.
http://ide.atom.io
Other
934 stars 79 forks source link

System environment variable modified in atom terminal environment #244

Open ghost opened 6 years ago

ghost commented 6 years ago

Description

I am having a problem where I have a proxy path in my environment that is modified when imported into the terminal - it has ";DIRECT" appended to it causing it not to work for applications that use it.

I open a new terminal by right clicking on a file's tab and clicking "New terminal here" The environment variable, HTTP_PROXY, is http://my-proxy-server.local:port outside of Atom but it is modified to http://my-proxy-server.local:port;DIRECT when used in the Atom-ide Terminal. Because of this, using something like PIP to install a package for Python does not work.

Expected Behavior

Ideally, my environment would remain unchanged.

Actual Behavior

";DIRECT" is added to the the url assigned to the environment variable

Versions

Additional Details

Installed packages: Community Packages (15) C:\Users\yatesau.atom\packages ├── atom-ide-debugger-native-gdb@0.7.2 (disabled) ├── atom-ide-debugger-python@0.7.1 ├── atom-ide-ui@0.11.2 ├── autocomplete-python@1.10.5 ├── highlight-line@0.12.0 ├── highlight-selected@0.13.1 ├── ide-python@0.9.2 ├── language-batch@0.4.0 ├── language-log@1.10.1 ├── minimap@4.29.8 ├── minimap-git-diff@4.3.1 ├── minimap-highlight-selected@4.6.1 ├── script@3.17.3 ├── tool-bar@1.1.7 └── tool-bar-main@0.0.11

pelmers commented 6 years ago

Since our terminal api supports setting environment variables one workaround is to add a command into your init script. Here's an example to get you started:

atom.packages.serviceHub.consume('nuclide-terminal', '0.0.0', t => {
    const environmentVariables = new Map();
    environmentVariables.set('HTTP_PROXY', 'http://my-proxy-server.local:port;DIRECT');
    atom.commands.add('atom-workspace', 'open-terminal-with-env2', () => {
        t.open({environmentVariables});
    });
});
ghost commented 6 years ago

OK! Thanks for the workaround, I'll try it out and see if it will set it without the DIRECT suffix.

Any idea why that is automatically being added?