From 67201cb039403e92fc164a8d9fb97337101d9dd5 Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Wed, 21 Jan 2026 12:42:02 -0600 Subject: [PATCH] fix(install): escape/Ctrl+C cancels instead of installing globally Previously, closing the readline (via Escape, Ctrl+C, or stdin closure) would default to global install. Now it cancels the installation. Co-Authored-By: Claude Opus 4.5 --- bin/install.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/install.js b/bin/install.js index 47b893636..cc51fd04d 100755 --- a/bin/install.js +++ b/bin/install.js @@ -533,15 +533,12 @@ function promptLocation() { // Track whether we've processed the answer to prevent double-execution let answered = false; - // Handle readline close event to detect premature stdin closure + // Handle readline close event (Ctrl+C, Escape, etc.) - cancel installation rl.on('close', () => { if (!answered) { answered = true; - console.log(`\n ${yellow}Input stream closed, defaulting to global install${reset}\n`); - const { settingsPath, settings, statuslineCommand } = install(true); - handleStatusline(settings, false, (shouldInstallStatusline) => { - finishInstall(settingsPath, settings, statuslineCommand, shouldInstallStatusline); - }); + console.log(`\n ${yellow}Installation cancelled${reset}\n`); + process.exit(0); } });