cli
cli copied to clipboard
fix: default args to [] in plainExec to handle undefined on Node 22
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 });