fabiospampinato / vscode-terminals

An extension for setting-up multiple terminals at once, or just running some commands.
MIT License
121 stars 19 forks source link

Support for setting environment variables #10

Closed fabiospampinato closed 6 years ago

fabiospampinato commented 6 years ago

VSC's API supports setting environment variables, we should also support them.

M-Zuber commented 6 years ago

I'd be interested in trying to get this in, where would you suggest I start?

fabiospampinato commented 6 years ago

@M-Zuber The code could certainly be written better, but it shouldn't be too hard to add support for this. You'll basically have to:

  1. Get the env here, deconstructing a terminal's configuration object.
  2. Replace this vscode.window.createTerminal call, passing all the arguments in an object instead, as this is the only supported way to pass environment variables to the terminal instance. Read more about this here and here.
  3. Add the env object you retrieved at step 1 to the object you're passing to vscode.window.createTerminal.

That should work.

M-Zuber commented 6 years ago

So... In order for this to work, we will need to upgrade the engine to ^1.18.0

fabiospampinato commented 6 years ago

I think that's fine, I don't want to spend my time supporting legacy versions anyway.