fix(cli): Prevent stdout/stderr patching for extension commands (#13600)

Co-authored-by: jacob314 <jacob314@gmail.com>
This commit is contained in:
christine betts
2025-11-21 21:08:06 -05:00
committed by GitHub
parent 5e218a5630
commit bdf80ea7c0
30 changed files with 83 additions and 14 deletions

View File

@@ -312,19 +312,6 @@ export async function parseArguments(settings: Settings): Promise<CliArgs> {
process.exit(0);
}
// If yargs handled --help/--version it will have exited; nothing to do here.
// Handle case where MCP subcommands are executed - they should exit the process
// and not return to main CLI logic
if (
result._.length > 0 &&
(result._[0] === 'mcp' || result._[0] === 'extensions')
) {
// MCP commands handle their own execution and process exit
await runExitCleanup();
process.exit(0);
}
// Normalize query args: handle both quoted "@path file" and unquoted @path file
const queryArg = (result as { query?: string | string[] | undefined }).query;
const q: string | undefined = Array.isArray(queryArg)