aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/run.ts
diff options
context:
space:
mode:
authorAlin Sinpalean <[email protected]>2020-05-31 12:41:52 +0100
committerAlin Sinpalean <[email protected]>2020-05-31 12:41:55 +0100
commit771457ec5cc4e3af6f5d64b6b8d89f1cba4d2aba (patch)
tree9fe13bf51a080be51b516f98bc14b6d89bf2e50d /editors/code/src/run.ts
parent09df51dab89340bcf4b8ede95c02c32b0c8eb2bc (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/code/src/run.ts')
-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 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 = {