RPC
RPC copied to clipboard
Fix getIPCPath on darwin (macOS) under a parent process
On Darwin (macOS), under a parent process, the environment args might not be correctly passed and os.tmpdir() returns a subdirectory of the root temp dir. This PR therefore uses os.tmpdir() to ensure the environment args aren't modified and gets the parent of the subdirectory if it is detected that the returned temp directory is in a subdirectory.
Any update on this?
@kyranet
cc: @devsnek
This fix doesn't seem to work for me 😦
The paths appear as this which isn't the ipc directory:
My actual IPC directory should be this:

Here's inline fix
import fs from "fs";
for (const key of ['XDG_RUNTIME_DIR', 'TMPDIR', 'TMP', 'TEMP']) {
if (process.env[key]) process.env[key] = fs.realpathSync(process.env[key] as string);
}
(i also have a fork that should fix this problem)