From 1841b6721f9dcd29679705ea3196cec68b401cb4 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 22 Oct 2022 00:44:02 +0000 Subject: [PATCH] Filter out environment variables with newlines --- src/WorkspaceManager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/WorkspaceManager.ts b/src/WorkspaceManager.ts index 01ccac8a..47b85cdf 100644 --- a/src/WorkspaceManager.ts +++ b/src/WorkspaceManager.ts @@ -460,7 +460,9 @@ export class WorkspaceManager implements vscode.Disposable { // TestAdapter._debugMetricSent = true; // } - const envVars = Object.assign({}, process.env, executable.shared.options.env); + const envVarsRaw = Object.assign({}, process.env, executable.shared.options.env); + const envVarsEntries = Object.entries(envVarsRaw).filter(item => !item[1]?.includes("\n")); + const envVars = Object.fromEntries(envVarsEntries); { const setEnvKey = 'testMate.cpp.debug.setEnv';