prior-cli 1.2.0 → 1.2.1
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/bin/prior.js +6 -4
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -402,7 +402,7 @@ function renderToolSkip(name) {
|
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
// ── Single-keypress confirm prompt ────────────────────────────
|
|
405
|
-
function askConfirmKey(promptText) {
|
|
405
|
+
function askConfirmKey(promptText, rl) {
|
|
406
406
|
return new Promise(resolve => {
|
|
407
407
|
process.stdout.write(` ${c.muted('┤')} ${promptText} ${c.muted('[Y/n]')} `);
|
|
408
408
|
|
|
@@ -411,14 +411,16 @@ function askConfirmKey(promptText) {
|
|
|
411
411
|
return resolve(true);
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
+
// Pause readline so it doesn't swallow the keypress or react to stdin events
|
|
415
|
+
if (rl) rl.pause();
|
|
414
416
|
process.stdin.setRawMode(true);
|
|
415
|
-
process.stdin.resume();
|
|
416
417
|
process.stdin.setEncoding('utf8');
|
|
417
418
|
|
|
418
419
|
function handler(ch) {
|
|
419
420
|
process.stdin.setRawMode(false);
|
|
420
|
-
process.stdin.pause();
|
|
421
421
|
process.stdin.removeListener('data', handler);
|
|
422
|
+
// Resume readline — do NOT call process.stdin.pause() or rl.close()
|
|
423
|
+
if (rl) rl.resume();
|
|
422
424
|
|
|
423
425
|
const key = ch.toLowerCase();
|
|
424
426
|
if (key === '\u0003') { process.stdout.write('\n'); process.exit(0); }
|
|
@@ -929,7 +931,7 @@ Keep it under 350 words. Write prior.md now.`;
|
|
|
929
931
|
file_write: 'Write this file?',
|
|
930
932
|
file_delete: 'Delete this file?',
|
|
931
933
|
};
|
|
932
|
-
const approved = await askConfirmKey(PROMPTS[name] || `Execute ${name}
|
|
934
|
+
const approved = await askConfirmKey(PROMPTS[name] || `Execute ${name}?`, rl);
|
|
933
935
|
if (approved) spinStart('working…');
|
|
934
936
|
return approved;
|
|
935
937
|
};
|