@inquirer/core
Advanced tools
Comparing version 9.0.7 to 9.0.8
@@ -62,3 +62,3 @@ "use strict"; | ||
}); | ||
const onExit = node_async_hooks_1.AsyncResource.bind(() => { | ||
const hooksCleanup = node_async_hooks_1.AsyncResource.bind(() => { | ||
try { | ||
@@ -70,2 +70,5 @@ hook_engine_mjs_1.effectScheduler.clearAll(); | ||
} | ||
}); | ||
function onExit() { | ||
hooksCleanup(); | ||
if (context === null || context === void 0 ? void 0 : context.clearPromptOnDone) { | ||
@@ -80,3 +83,4 @@ screen.clean(); | ||
rl.input.removeListener('keypress', checkCursorPos); | ||
}); | ||
rl.removeListener('close', hooksCleanup); | ||
} | ||
cancel = () => { | ||
@@ -111,2 +115,6 @@ onExit(); | ||
rl.input.on('keypress', checkCursorPos); | ||
// The close event triggers immediately when the user press ctrl+c. SignalExit on the other hand | ||
// triggers after the process is done (which happens after timeouts are done triggering.) | ||
// We triggers the hooks cleanup phase on rl `close` so active timeouts can be cleared. | ||
rl.on('close', hooksCleanup); | ||
}); | ||
@@ -113,0 +121,0 @@ }); |
@@ -11,3 +11,6 @@ "use strict"; | ||
(0, use_effect_mjs_1.useEffect)((rl) => { | ||
let ignore = false; | ||
const handler = (0, hook_engine_mjs_1.withUpdates)((_input, event) => { | ||
if (ignore) | ||
return; | ||
signal.current(event, rl); | ||
@@ -17,2 +20,3 @@ }); | ||
return () => { | ||
ignore = true; | ||
rl.input.removeListener('keypress', handler); | ||
@@ -19,0 +23,0 @@ }; |
{ | ||
"name": "@inquirer/core", | ||
"version": "9.0.7", | ||
"version": "9.0.8", | ||
"engines": { | ||
@@ -99,3 +99,3 @@ "node": ">=18" | ||
"sideEffects": false, | ||
"gitHead": "b89972b992a65005afd6397b57aa4635010a5ef7" | ||
"gitHead": "8be69de6107bed7d85a7f2bfe99353d106d9c3bf" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93086
1931
80
1
9
0
32