fix(installer): give the checkout hand-off the same return-to-open wait

The login step now waits for Return before opening the browser, but the
CMEM Pro checkout step still auto-opened, so the two browser hand-offs
behaved differently in one flow.

Worth the extra keystroke here: noteDeviceCode prints the pairing code
immediately above this, and that code has to be read before the browser
takes focus.

The two stdin listeners never overlap — waitForReturnToOpenBrowser
detaches its handler and restores raw mode before returning, and
waitForInstallerPairing attaches its own afterwards.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DD5YMaAiXXeY3zaitbGC6n
This commit is contained in:
Alex Newman
2026-08-31 13:04:23 -07:00
parent b685ccfab9
commit 99c61b21ad
+5
View File
@@ -1694,7 +1694,12 @@ export async function completeCmemTrialPairing(
if (pairing.delivered) return pairing.delivered;
noteDeviceCode(pairing);
// Same hand-off as the login step: print the URL, wait for Return, then open.
// Both browser hand-offs behaving identically matters more here than saving a
// keystroke — the device code above needs to be read before the browser
// steals focus.
log.info(`Continue CMEM Pro setup: ${pairing.checkoutUrl}`);
await waitForReturnToOpenBrowser('Continue setup in browser... (hit return to open automatically)');
openBrowser(pairing.checkoutUrl);
const result = await waitForInstallerPairing(pairing, 'enrollment', version);