cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open ishwar170695 opened this issue 8 months ago • 0 comments

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 avatar Mar 18 '26 04:03 ishwar170695