fix: show cleanup warning when script is interrupted by Ctrl+C (#723)

Previously, when a user hit Ctrl+C during script execution, the CLI
silently exited with code 130. This left users unaware that a server
may have already been created and could still be running, potentially
incurring charges.

Now shows a warning about orphaned resources before exiting.

Agent: ux-engineer

Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
A 2026-02-12 15:00:30 -08:00 committed by GitHub
parent 8140c1b61b
commit 96d96b3ef6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 4 deletions

View file

@ -648,6 +648,10 @@ async function execScript(cloud: string, agent: string, prompt?: string, authHin
} catch (err) {
const errMsg = getErrorMessage(err);
if (errMsg.includes("interrupted by user")) {
console.error();
p.log.warn("Script interrupted (Ctrl+C).");
p.log.warn("If a server was already created, it may still be running.");
p.log.warn(` Check your cloud provider dashboard to stop or delete any unused servers.`);
process.exit(130);
}
lastErr = errMsg;