未验证 提交 b4a1029e 编写于 作者: A Alex Dima

Fixes #107596: Use `XDG_RUNTIME_DIR` if defined

上级 88b3efb5
......@@ -296,14 +296,19 @@ function unmask(buffer: VSBuffer, mask: number): void {
}
}
// Read this before there's any chance it is overwritten
const xdgRuntimeDir = <string | undefined>process.env['XDG_RUNTIME_DIR'];
export function generateRandomPipeName(): string {
const randomSuffix = generateUuid();
if (process.platform === 'win32') {
return `\\\\.\\pipe\\vscode-ipc-${randomSuffix}-sock`;
} else {
// Mac/Unix: use socket file
return join(tmpdir(), `vscode-ipc-${randomSuffix}.sock`);
}
// Mac/Unix: use socket file
if (xdgRuntimeDir) {
return join(xdgRuntimeDir, `vscode-ipc-${randomSuffix}.sock`);
}
return join(tmpdir(), `vscode-ipc-${randomSuffix}.sock`);
}
export class Server extends IPCServer {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册