Skip to content

fix: default args to [] in plainExec to handle undefined on Node 22#1175

Open
ishwar170695 wants to merge 1 commit intodevcontainers:mainfrom
ishwar170695:main
Open

fix: default args to [] in plainExec to handle undefined on Node 22#1175
ishwar170695 wants to merge 1 commit intodevcontainers:mainfrom
ishwar170695:main

Conversation

@ishwar170695
Copy link

Fixes #1147

ExecParameters.args is optional (args?: string[]), so cp.spawn can receive undefined on Node 22, which now throws EINVAL.
The PTY path already guards against this with args || [] (line 345). This brings the non-PTY path into parity:
diff:
- cp.spawn(exec, args, { cwd, env, stdio: stdio as any, windowsHide: true });
+ cp.spawn(exec, args ?? [], { cwd, env, stdio: stdio as any, windowsHide: true });

@ishwar170695 ishwar170695 requested a review from a team as a code owner March 17, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: spawn EINVAL / node 22 breaks devcontainer up

1 participant