diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-31 17:58:57 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-31 17:58:57 +0100 |
commit | 9feb15e6a2ab6903769e9ad2d4e7c4006e80c501 (patch) | |
tree | 0de7e082161a41927c36e89d015b136381738c13 | |
parent | c575da1609e3ed793002e73acdb135e4a831eb81 (diff) | |
parent | 771457ec5cc4e3af6f5d64b6b8d89f1cba4d2aba (diff) |
Merge #4669
4669: Always derive from `process.env` when spawning a child process/shell execution r=matklad a=Dfinity-Alin
This is useful when an extension (e.g. [Nix Environment Selector](https://marketplace.visualstudio.com/items?itemName=arrterian.nix-env-selector)) or [launch
configuration](https://stackoverflow.com/questions/57641460/set-env-var-for-node-js-when-launching-through-vs-code) sets one or more environment variables.
When `env` is not explicitly specified in the options passed to
`child_process.spawn()` or `vscode.ShellExecution()`, then `process.env` gets
applied automatically. But when an explicit `env` is set, it should inherit from
`process.env` rather than replace it completely.
Co-authored-by: Alin Sinpalean <[email protected]>
-rw-r--r-- | editors/code/src/run.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/code/src/run.ts b/editors/code/src/run.ts index 2a7a429cf..8e1ba83ed 100644 --- a/editors/code/src/run.ts +++ b/editors/code/src/run.ts | |||
@@ -177,7 +177,7 @@ export function createTask(spec: ra.Runnable): vscode.Task { | |||
177 | label: spec.label, | 177 | label: spec.label, |
178 | command: spec.bin, | 178 | command: spec.bin, |
179 | args: spec.extraArgs ? [...spec.args, '--', ...spec.extraArgs] : spec.args, | 179 | args: spec.extraArgs ? [...spec.args, '--', ...spec.extraArgs] : spec.args, |
180 | env: spec.env, | 180 | env: Object.assign({}, process.env, spec.env), |
181 | }; | 181 | }; |
182 | 182 | ||
183 | const execOption: vscode.ShellExecutionOptions = { | 183 | const execOption: vscode.ShellExecutionOptions = { |