Fix CLI launch: remove shell: true from spawn#197
Merged
Alan-Jowett merged 1 commit intomicrosoft:mainfrom Apr 7, 2026
Merged
Conversation
The spawn call used shell: true which caused two issues: 1. Node DEP0190 deprecation warning about unescaped args 2. The bootstrap prompt string containing spaces was split by the shell into multiple arguments, causing copilot to receive 'Read', 'and', 'execute' as 3 separate args instead of one -i value. This produced: 'too many arguments. Expected 0 arguments but got 3.' shell: true is not needed — spawn with an args array handles argument quoting correctly without a shell intermediary. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Alan-Jowett
pushed a commit
to Alan-Jowett/PromptKit
that referenced
this pull request
Apr 7, 2026
Hotfix release: fixes CLI launch failure caused by shell: true in spawn (PR microsoft#197). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merged
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes PromptKit CLI interactive launch failures caused by spawning the target LLM CLI with shell: true, which re-parses and splits the bootstrap prompt (containing spaces) into multiple arguments.
Changes:
- Remove
shell: truefrom thespawn(cmd, args, …)call inlaunchInteractive()to preserve argument boundaries. - Eliminate the associated Node deprecation warning about passing args with
shell: true.
Comment on lines
114
to
119
| // All CLIs are spawned from the user's original directory so the LLM | ||
| // session reflects the directory the user was working in. | ||
| const child = spawn(cmd, args, { | ||
| cwd: originalCwd, | ||
| stdio: "inherit", | ||
| shell: true, | ||
| }); |
There was a problem hiding this comment.
The regression fixed here (bootstrap prompt containing spaces being split into multiple argv entries) isn’t currently asserted by tests. Consider adding/adjusting launch tests to verify that the "-i" value (or final prompt argument) is passed as a single argument exactly equal to Read and execute <absolute path> so shell: true/splitting can’t reappear unnoticed.
Alan-Jowett
added a commit
that referenced
this pull request
Apr 7, 2026
Hotfix release: fixes CLI launch failure caused by shell: true in spawn (PR #197). Co-authored-by: Alan Jowett <alan.jowett@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
px @alan-jowett/promptkit\ fails with:
\
error: too many arguments. Expected 0 arguments but got 3.
\\
Plus a Node deprecation warning:
\
(node:8212) [DEP0190] DeprecationWarning: Passing args to a child process
with shell option true can lead to security vulnerabilities
\\
Root Cause
\spawn(cmd, args, { shell: true })\ in \launch.js\ causes the shell to re-parse the args array. The bootstrap prompt string (\Read and execute /path/to/bootstrap.md) contains spaces, so the shell splits it into multiple arguments. \copilot\ then receives \Read, \�nd, \�xecute\ as 3 separate args instead of the single -i\ value.
Fix
Remove \shell: true. \spawn\ with an args array handles argument passing correctly without a shell intermediary — each element of the array becomes exactly one argument.
Testing
Verified
ode bin/cli.js --version\ still works after the change.