From df6adac482f4c19f670bf616b893eec0a936d74d Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 6 Jan 2020 10:57:44 +0100 Subject: [PATCH] Candidate port detail shouldn't be the whole long command Fixes #88059 --- src/vs/workbench/api/node/extHostTunnelService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/node/extHostTunnelService.ts b/src/vs/workbench/api/node/extHostTunnelService.ts index 794d8863dc9..c9b4bd50a14 100644 --- a/src/vs/workbench/api/node/extHostTunnelService.ts +++ b/src/vs/workbench/api/node/extHostTunnelService.ts @@ -128,7 +128,9 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe const childStat = fs.statSync(childUri.fsPath); if (childStat.isDirectory() && !isNaN(pid)) { const cwd = fs.readlinkSync(resources.joinPath(childUri, 'cwd').fsPath); - const cmd = fs.readFileSync(resources.joinPath(childUri, 'cmdline').fsPath, 'utf8').replace(/\0/g, ' '); + const rawCmd = fs.readFileSync(resources.joinPath(childUri, 'cmdline').fsPath, 'utf8'); + const nullIndex = rawCmd.indexOf('\0'); + const cmd = rawCmd.substr(0, nullIndex > 0 ? nullIndex : rawCmd.length); processes.push({ pid, cwd, cmd }); } } catch (e) { -- GitLab