top | item 43133161

(no title)

davidt84 | 1 year ago

I know nothing about how Cursor is implemented, so this may be wildly off base, but...

Perhaps it is written using some kind of JavaScript framework that doesn't allow access to the process environment by default, but this lets them work around that to access the environment like a native app?

One reason you'd want an IDE to have access to your environment is to enable any tools/compilers/whatever you launch from the IDE to inherit the environment (say, to access SSH_AGENT_SOCK, or whatever).

discuss

order

iyn|1 year ago

Ok, this sounds like a plausible direction — thanks!

It seems that Cursor is using Electron. I don't know about its internals (tried it a couple of times years ago), but after a quick look at the docs I've found this: https://www.electronjs.org/docs/latest/api/utility-process#u... which is a section describing `utilityProcess.fork(modulePath[, args][, options])`:

    env Object (optional) - Environment key-value pairs. Default is process.env.
I don't get why some unique-looking prefix/suffix would be needed there, though.