Merge pull request #1474 from QwenLM/fix/vscode-run

fix(vscode-ide-companion): Fix cross-platform CLI terminal execution
This commit is contained in:
tanzhenxin 2026-01-13 17:38:28 +08:00 committed by GitHub
commit b60ae42d10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 53 additions and 7 deletions

View file

@ -170,7 +170,17 @@ function normalizeOutputFormat(
}
export async function parseArguments(settings: Settings): Promise<CliArgs> {
const rawArgv = hideBin(process.argv);
let rawArgv = hideBin(process.argv);
// hack: if the first argument is the CLI entry point, remove it
if (
rawArgv.length > 0 &&
(rawArgv[0].endsWith('/dist/qwen-cli/cli.js') ||
rawArgv[0].endsWith('/dist/cli.js'))
) {
rawArgv = rawArgv.slice(1);
}
const yargsInstance = yargs(rawArgv)
.locale('en')
.scriptName('qwen')