Skip to content

Commit 2d7a7ab

Browse files
author
Rachel Macfarlane
committed
Handle spaces in portable install path on Linux for process explorer calculations, fixes microsoft#53166
1 parent 096d627 commit 2d7a7ab

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/vs/base/node/ps.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
206206

207207
// The cpu usage value reported on Linux is the average over the process lifetime,
208208
// recalculate the usage over a one second interval
209-
let cmd = URI.parse(require.toUrl('vs/base/node/cpuUsage.sh')).fsPath;
209+
// JSON.stringify is needed to escape spaces, https://github.com/nodejs/node/issues/6803
210+
let cmd = JSON.stringify(URI.parse(require.toUrl('vs/base/node/cpuUsage.sh')).fsPath);
210211
cmd += ' ' + pids.join(' ');
211212

212213
exec(cmd, {}, (err, stdout, stderr) => {

0 commit comments

Comments
 (0)