fix(cli): stop spinner before version selection to prevent UI conflict

The ora spinner was still running during p.select() interactive prompt,
causing the spinner to continuously overwrite the terminal and block
the version selection UI. The user would see "Fetching..." stuck until
pressing Enter.

Stop spinner before p.select() and restart after selection completes.
This commit is contained in:
chenbaowang 2026-04-17 18:49:23 +08:00
parent e93adaaaaa
commit 90809c47ab

View file

@ -260,6 +260,8 @@ async function installFromRegistry(slug: string, opts: Record<string, string | s
}
} else {
// Interactive: show version selection
spinner.stop();
const picked = await p.select({
message: "Select version",
options: versions.map((v) => ({
@ -275,6 +277,7 @@ async function installFromRegistry(slug: string, opts: Record<string, string | s
}
selectedVersion = picked as string;
spinner.start("Downloading");
}
const baseUrl = config.registry.replace(/\/$/, "");