about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorAlin Sinpalean <alin.sinpalean@dfinity.org>2020-05-31 13:41:52 +0200
committerAlin Sinpalean <alin.sinpalean@dfinity.org>2020-05-31 13:41:55 +0200
commit771457ec5cc4e3af6f5d64b6b8d89f1cba4d2aba (patch)
tree9fe13bf51a080be51b516f98bc14b6d89bf2e50d /editors/code/src
parent09df51dab89340bcf4b8ede95c02c32b0c8eb2bc (diff)
downloadrust-771457ec5cc4e3af6f5d64b6b8d89f1cba4d2aba.tar.gz
rust-771457ec5cc4e3af6f5d64b6b8d89f1cba4d2aba.zip
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/code/src')
-rw-r--r--editors/code/src/run.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/code/src/run.ts b/editors/code/src/run.ts
index 2a7a429cfa6..8e1ba83ed67 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 {
         label: spec.label,
         command: spec.bin,
         args: spec.extraArgs ? [...spec.args, '--', ...spec.extraArgs] : spec.args,
-        env: spec.env,
+        env: Object.assign({}, process.env, spec.env),
     };
 
     const execOption: vscode.ShellExecutionOptions = {