Skip to content

Commit df6adac

Browse files
committed
Candidate port detail shouldn't be the whole long command
Fixes microsoft#88059
1 parent dccd0b2 commit df6adac

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/vs/workbench/api/node/extHostTunnelService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
128128
const childStat = fs.statSync(childUri.fsPath);
129129
if (childStat.isDirectory() && !isNaN(pid)) {
130130
const cwd = fs.readlinkSync(resources.joinPath(childUri, 'cwd').fsPath);
131-
const cmd = fs.readFileSync(resources.joinPath(childUri, 'cmdline').fsPath, 'utf8').replace(/\0/g, ' ');
131+
const rawCmd = fs.readFileSync(resources.joinPath(childUri, 'cmdline').fsPath, 'utf8');
132+
const nullIndex = rawCmd.indexOf('\0');
133+
const cmd = rawCmd.substr(0, nullIndex > 0 ? nullIndex : rawCmd.length);
132134
processes.push({ pid, cwd, cmd });
133135
}
134136
} catch (e) {

0 commit comments

Comments
 (0)