@arcadialdev/arcality 2.6.4 → 2.6.6
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.
- package/package.json +1 -1
- package/scripts/gen-and-run.mjs +32 -2
package/package.json
CHANGED
package/scripts/gen-and-run.mjs
CHANGED
|
@@ -795,6 +795,17 @@ async function main() {
|
|
|
795
795
|
_origProcessExit(code);
|
|
796
796
|
};
|
|
797
797
|
|
|
798
|
+
// ── RESTORE RAW MODE FOR WINDOWS FIX ──
|
|
799
|
+
// @clack/prompts pausea stdin y desactiva raw mode al terminar un menú.
|
|
800
|
+
// Debemos reactivarlo aquí para que nuestro interceptor global de Ctrl+C
|
|
801
|
+
// siga funcionando durante toda la misión.
|
|
802
|
+
if (process.stdin.isTTY && process.stdin.setRawMode) {
|
|
803
|
+
try {
|
|
804
|
+
process.stdin.setRawMode(true);
|
|
805
|
+
process.stdin.resume();
|
|
806
|
+
} catch(e) {}
|
|
807
|
+
}
|
|
808
|
+
|
|
798
809
|
const cancelHandler = () => {
|
|
799
810
|
sigintCount++;
|
|
800
811
|
if (sigintCount > 3) {
|
|
@@ -1192,12 +1203,31 @@ async function main() {
|
|
|
1192
1203
|
console.log(chalk.gray('\n Press Enter to return to menu...'));
|
|
1193
1204
|
await new Promise(resolve => {
|
|
1194
1205
|
const onKey = (key) => {
|
|
1195
|
-
|
|
1206
|
+
const keyStr = String(key);
|
|
1207
|
+
if (keyStr.includes('\r') || keyStr.includes('\n') || keyStr === '\u0003') {
|
|
1196
1208
|
process.stdin.off('data', onKey);
|
|
1197
|
-
|
|
1209
|
+
|
|
1210
|
+
// Restaurar stdin en modo normal para @clack/prompts
|
|
1211
|
+
if (process.stdin.isTTY && process.stdin.setRawMode) {
|
|
1212
|
+
process.stdin.setRawMode(false);
|
|
1213
|
+
}
|
|
1214
|
+
process.stdin.pause();
|
|
1215
|
+
|
|
1216
|
+
if (keyStr === '\u0003') process.emit('SIGINT'); // Ctrl+C = salir
|
|
1198
1217
|
else resolve();
|
|
1199
1218
|
}
|
|
1200
1219
|
};
|
|
1220
|
+
|
|
1221
|
+
// ── BUGFIX: @clack/prompts llama explícitamente a process.stdin.pause()
|
|
1222
|
+
// al terminar cada select()/text(). En Node.js, agregar un listener 'data'
|
|
1223
|
+
// a un stream EXPLÍCITAMENTE pausado NO lo reactiva automáticamente.
|
|
1224
|
+
// Resultado: el event loop queda vacío y el proceso termina antes de que
|
|
1225
|
+
// el usuario pueda presionar Enter.
|
|
1226
|
+
// Solución: llamar resume() explícitamente antes de registrar el listener.
|
|
1227
|
+
if (process.stdin.isTTY && process.stdin.setRawMode) {
|
|
1228
|
+
process.stdin.setRawMode(true); // raw mode para capturar Enter inmediatamente
|
|
1229
|
+
}
|
|
1230
|
+
process.stdin.resume(); // ← CRÍTICO: reactiva stdin para mantener el event loop vivo
|
|
1201
1231
|
process.stdin.on('data', onKey);
|
|
1202
1232
|
});
|
|
1203
1233
|
|