From 2d7a7abb28b63ea1e100d75bc32769a7440886ab Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Thu, 5 Jul 2018 11:05:42 -0700 Subject: [PATCH] Handle spaces in portable install path on Linux for process explorer calculations, fixes #53166 --- src/vs/base/node/ps.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/base/node/ps.ts b/src/vs/base/node/ps.ts index f0410cc42d4..a7d2d36d0ca 100644 --- a/src/vs/base/node/ps.ts +++ b/src/vs/base/node/ps.ts @@ -206,7 +206,8 @@ export function listProcesses(rootPid: number): Promise { // The cpu usage value reported on Linux is the average over the process lifetime, // recalculate the usage over a one second interval - let cmd = URI.parse(require.toUrl('vs/base/node/cpuUsage.sh')).fsPath; + // JSON.stringify is needed to escape spaces, https://github.com/nodejs/node/issues/6803 + let cmd = JSON.stringify(URI.parse(require.toUrl('vs/base/node/cpuUsage.sh')).fsPath); cmd += ' ' + pids.join(' '); exec(cmd, {}, (err, stdout, stderr) => { -- GitLab