Skip to content

[BUG] VSCode Extension: Environment variables not fully provided when spawning native commands #1236

Description

@chawyehsu

obfuscated code snippet from version 0.7.2026051203

//...
async function wi(n,t,i){let x=[],o=[];return await new Promise((u,l)=>{let d=l3.default.spawn(n,t,i);...
//...
await wi("moonc"...,{env:{PATH:n}}.. // override happened here 
await wi("moon"...{cwd:o})...
//... other `wi` calls

Some env vars (e.g. TMP/TEMP/PATHEXT on Windows) are crutial for native commands to behave expectedly. The default process.env used by spawn() gets overrided completely by passed parameters in current implementation.

Possible Solution

Before spawning actual commands, consider a merge of process.env and passed parameters in wi(n,t,i).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions