Merge branch 'main' into dev/3.1

This commit is contained in:
musistudio 2026-06-26 21:29:57 +08:00
commit 27ffe73c6d
3 changed files with 11 additions and 10 deletions

View file

@ -67,7 +67,8 @@ async function main(): Promise<void> {
const launch = profileLaunchSpawnCommand(plan);
const child = spawn(launch.command, launch.args, {
env: childEnv,
stdio: "inherit"
stdio: "inherit",
windowsVerbatimArguments: !!launch.windowsVerbatimArguments
});
const code = await waitForChild(child);
process.exitCode = code;

View file

@ -13,6 +13,7 @@ export type ProfileLaunchPlan = {
export type ProfileLaunchSpawnCommand = {
args: string[];
command: string;
windowsVerbatimArguments?: boolean;
};
export function findProfileForOpen(config: Pick<AppConfig, "profile">, profileRef: string): ProfileConfig {
@ -98,15 +99,14 @@ export function profileLaunchSpawnCommand(plan: Pick<ProfileLaunchPlan, "args" |
command: plan.command
};
}
let cmdLine = `"${plan.command}"`;
if (plan.args && plan.args.length > 0) {
cmdLine += " " + plan.args.join(" ");
}
return {
args: [
"/d",
"/s",
"/v:off",
"/c",
windowsCommandScriptInvocation(plan.command, plan.args)
],
command: process.env.ComSpec || process.env.COMSPEC || "cmd.exe"
args: ["/d", "/v:off", "/c", cmdLine],
command: process.env.ComSpec || process.env.COMSPEC || "cmd.exe",
windowsVerbatimArguments: true
};
}

View file

@ -77,7 +77,7 @@ function applyClaudeCodeProfile(config: AppConfig, profile: ProfileConfig, token
const wrapperResult = writeClaudeCodeWrapper(config, profile);
const nextSettings = {
...settings,
apiKeyHelper: helperResult.file,
apiKeyHelper: process.platform === "win32" ? `"${helperResult.file}"` : helperResult.file,
env
};
const writeResult = writeFileWithBackup(settingsFile, `${JSON.stringify(nextSettings, null, 2)}\n`, { mode: privateFileMode });