0

I'm wondering if it's possible to set environment variables for the VSC Runtime as a whole without launching from terminal?

As a simple example, if I want to set all_proxy="" for every extension that runs with VSCode (i.e. the Docker extension), the only way I know right now to accomplish this is:

  1. Go to my terminal (e.g. iTerm or Hyper)
  2. Set the environment variable, i.e. export all_proxy=""
  3. Run code from the terminal, e.g. code /path/to/project-workdir.

Is there a way to get VSCode to load with these environment variables configured, but done on a project-specific basis without needing me to first manually set them in the terminal?

Yes, I am aware that I can set up terminal-based automation to automatically set environment variables when in a directory, but I'm wondering if this is possible for VSCode without resorting to terminal trickery?

ericmjl
  • 13,541
  • 12
  • 51
  • 80

1 Answers1

2

did you mean this?

terminal.integrated.env.linux

enter image description here

alexzshl
  • 902
  • 6
  • 6
  • Almost, but I was looking for something vscode-wide, such that even the Docker extension would recognize it. I have yet to try what you suggested, but I suspect it'll only affect the terminal; happy to be proven wrong though! – ericmjl Jun 02 '20 at 21:16
  • Vadim, Thank you so mach for your solution – Nathan Almeida Aug 21 '20 at 15:54
  • indeed, this answer is wrong. It will only affect shells in integrated terminals of VS Code- not the VS Code process itself. cc @ericmjl I suggest you unaccept this answer. – starball Aug 10 '23 at 22:53