@inquirer/core 10.1.10 → 10.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -94,6 +94,12 @@ function createPrompt(view) {
|
|
|
94
94
|
cleanups.add((0, signal_exit_1.onExit)((code, signal) => {
|
|
95
95
|
reject(new errors_ts_1.ExitPromptError(`User force closed the prompt with ${code} ${signal}`));
|
|
96
96
|
}));
|
|
97
|
+
// SIGINT must be explicitly handled by the prompt so the ExitPromptError can be handled.
|
|
98
|
+
// Otherwise, the prompt will stop and in some scenarios never resolve.
|
|
99
|
+
// Ref issue #1741
|
|
100
|
+
const sigint = () => reject(new errors_ts_1.ExitPromptError(`User force closed the prompt with SIGINT`));
|
|
101
|
+
rl.on('SIGINT', sigint);
|
|
102
|
+
cleanups.add(() => rl.removeListener('SIGINT', sigint));
|
|
97
103
|
// Re-renders only happen when the state change; but the readline cursor could change position
|
|
98
104
|
// and that also requires a re-render (and a manual one because we mute the streams).
|
|
99
105
|
// We set the listener after the initial workLoop to avoid a double render if render triggered
|
|
@@ -55,6 +55,12 @@ export function createPrompt(view) {
|
|
|
55
55
|
cleanups.add(onSignalExit((code, signal) => {
|
|
56
56
|
reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal}`));
|
|
57
57
|
}));
|
|
58
|
+
// SIGINT must be explicitly handled by the prompt so the ExitPromptError can be handled.
|
|
59
|
+
// Otherwise, the prompt will stop and in some scenarios never resolve.
|
|
60
|
+
// Ref issue #1741
|
|
61
|
+
const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
|
|
62
|
+
rl.on('SIGINT', sigint);
|
|
63
|
+
cleanups.add(() => rl.removeListener('SIGINT', sigint));
|
|
58
64
|
// Re-renders only happen when the state change; but the readline cursor could change position
|
|
59
65
|
// and that also requires a re-render (and a manual one because we mute the streams).
|
|
60
66
|
// We set the listener after the initial workLoop to avoid a double render if render triggered
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/core",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.11",
|
|
4
4
|
"description": "Core Inquirer prompt API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"answer",
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@arethetypeswrong/cli": "^0.17.4",
|
|
88
88
|
"@inquirer/testing": "^2.1.46",
|
|
89
|
-
"@repo/tsconfig": "workspace:*",
|
|
90
89
|
"@types/mute-stream": "^0.0.4",
|
|
91
90
|
"@types/node": "^22.14.0",
|
|
92
91
|
"@types/wrap-ansi": "^3.0.0",
|
|
@@ -115,5 +114,5 @@
|
|
|
115
114
|
".": "./src/index.ts"
|
|
116
115
|
}
|
|
117
116
|
},
|
|
118
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "50bac82683b9a8d8e06ec87972894d56b2883bcd"
|
|
119
118
|
}
|