You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make Ctrl+C triggered during the skills-install prompt dismiss it permanently
6
+
7
+
Previously, pressing Ctrl+C (SIGINT) during the "Would you like to install Cloudflare skills?" prompt terminated the process without writing the metadata file, causing the prompt to reappear on every subsequent `wrangler` invocation. A SIGINT handler is now registered around the prompt so that the metadata file is written with `accepted: "SIGINT"` before the process exits, preventing the prompt from being shown again.
* Detects AI coding agents installed on the user's machine and, if
@@ -95,12 +96,48 @@ export async function maybeInstallCloudflareSkillsGlobally(
95
96
return;
96
97
}
97
98
98
-
constaccepted=
99
-
force||
100
-
(awaitconfirm(
101
-
`Wrangler detected the following AI coding agents: ${detectedAgents.map(({ name })=>name).join(", ")}. Would you like to install Cloudflare skills for them?`,
102
-
{defaultValue: true,fallbackValue: false}
103
-
));
99
+
letaccepted: boolean;
100
+
letsigintReceived=false;
101
+
if(force){
102
+
accepted=true;
103
+
}else{
104
+
// Use prompts directly (instead of the shared `confirm()` helper) so
105
+
// we can intercept the abort (Ctrl+C) and write SIGINT metadata
106
+
// before the process exits. The prompts library's readline interface
107
+
// swallows SIGINT — it never reaches `process.on("SIGINT")` — so this
108
+
// `onState` callback is the only reliable place to handle it.
109
+
const{ value }=awaitprompts({
110
+
type: "confirm",
111
+
name: "value",
112
+
message: `Wrangler detected the following AI coding agents: ${detectedAgents.map(({ name })=>name).join(", ")}. Would you like to install Cloudflare skills for them?`,
113
+
initial: true,
114
+
onState: (state)=>{
115
+
if(state.aborted){
116
+
sigintReceived=true;
117
+
logger.warn(
118
+
"Ctrl+C received — skipping Cloudflare skills installation. This prompt will not be shown again."
119
+
);
120
+
// Write metadata synchronously so it survives the exit.
121
+
writeSkillsInstallMetadataFile({
122
+
version: 1,
123
+
accepted: "SIGINT",
124
+
date: newDate().toISOString(),
125
+
detectedAgents,
126
+
});
127
+
}
128
+
},
129
+
});
130
+
accepted=value;
131
+
}
132
+
133
+
if(sigintReceived){
134
+
// Metadata was already written in the onState callback.
135
+
// Send metrics and wait for the dispatch to complete before exiting.
0 commit comments