[snap] Fix vscode debugger attaching to forked proc

Turns out I just forgot to forward `process.env` when forking 😅 

`debugger` statements and breakpoints should work with both `--sync` and 
`--no-sync` (default) modes
This commit is contained in:
Mofei Zhang
2023-05-26 13:18:37 -04:00
parent 99257aa430
commit 71c9743e38
+3 -1
View File
@@ -34,7 +34,9 @@ const childProc = fork(require.resolve("./runner.js"), hideBin(process.argv), {
// when we `inherit` stdin.
// pipe stdout and stderr so we can silence child process after parent exits
stdio: ["pipe", "pipe", "pipe", "ipc"],
env: { FORCE_COLOR: "true" },
// forward existing env variables, like `NODE_OPTIONS` which VSCode uses to attach
// its debugger
env: { ...process.env, FORCE_COLOR: "true" },
});
invariant(