diff options
author | Alin Sinpalean <[email protected]> | 2020-05-31 12:41:52 +0100 |
---|---|---|
committer | Alin Sinpalean <[email protected]> | 2020-05-31 12:41:55 +0100 |
commit | 771457ec5cc4e3af6f5d64b6b8d89f1cba4d2aba (patch) | |
tree | 9fe13bf51a080be51b516f98bc14b6d89bf2e50d /editors | |
parent | 09df51dab89340bcf4b8ede95c02c32b0c8eb2bc (diff) |
Always derive from `process.env` when spawning a child process/shell execution
This is useful when an extension (e.g. Nix Environment Selector) or launch
configuration 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.
Diffstat (limited to 'editors')
-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 = { |