Propagate JetBrains IDE proxy configuration to executed Salesforce CLI processes

Issue #2402 resolved
Scott Wells repo owner created an issue

Because of the difficulty in setting environment variables on Mac such that they are properly inherited by IDE processes launched via Finder/Dock, it would be nice to have the IDE’s proxy configuration be used to set the Node.js proxy environment variables when such a configuration is present.

This should be a configurable option, and proxy credentials should never be logged.

Comments (3)

  1. Scott Wells reporter

    On Mac, this should also use EnvironmentUtil#getEnvironmentMap to scrape SFDX_* and SF_* environment variables for propagation to the executed sfdx and sf commands respectively.

  2. Scott Wells reporter

    This is a build that should propagate the environment to executed subprocesses as follows:

    On macOS, things are complicated. An app launched by a GUI launcher (Finder, Dock, Spotlight etc.) receives a pretty empty and useless environment, since standard Unix ways of setting variables via e.g. ~/.profile do not work. What's more important, there are no sane alternatives. This causes a lot of user complaints about tools working in a terminal not working when launched from the IDE. To ease their pain, the IDE loads a shell environment (see getShellEnv for gory details) and returns it as the result. And one more thing (c): locale variables on macOS are usually set by a terminal app - meaning they are missing even from a shell environment above. This again causes user complaints about tools being unable to output anything outside ASCII range when launched from the IDE. Resolved by adding LC_CTYPE variable to the map if it doesn't contain explicitly set locale variables (LANG/LC_ALL/LC_CTYPE).

    I have verified that environment variables set in .zshrc are propagated properly.

    Install the build by downloading (but not extracting) the attached archive, then using Settings / Preferences > Plugins > Install plugin from disk (under the gear drop-down menu) and restarting the IDE.

  3. Log in to comment