提交 2582ff3f 编写于 作者: D Dirk Baeumer

Fixes #39775: some "code --status" paths start with "\\?"

上级 8fdebbd3
......@@ -126,6 +126,20 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
type Item = ProcessInfo | TopProcess;
const cleanUNCPrefix = (value: string): string => {
if (value.indexOf('\\\\?\\') === 0) {
return value.substr(4);
} else if (value.indexOf('\\??\\') === 0) {
return value.substr(4);
} else if (value.indexOf('"\\\\?\\') === 0) {
return '"' + value.substr(5);
} else if (value.indexOf('"\\??\\') === 0) {
return '"' + value.substr(5);
} else {
return value;
}
};
const execMain = path.basename(process.execPath).replace(/ /g, '` ');
const script = URI.parse(require.toUrl('vs/base/node/ps-win.ps1')).fsPath.replace(/ /g, '` ');
const commandLine = `${script} -ProcessName ${execMain} -MaxSamples 3`;
......@@ -159,9 +173,10 @@ export function listProcesses(rootPid: number): Promise<ProcessItem> {
} else {
load = -1;
}
let commandLine = cleanUNCPrefix(item.commandLine);
processItems.set(item.processId, {
name: findName(item.commandLine),
cmd: item.commandLine,
name: findName(commandLine),
cmd: commandLine,
pid: item.processId,
ppid: item.parentProcessId,
load: load,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册