icoa-cli 2.19.55 → 2.19.56

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.
@@ -1578,13 +1578,28 @@ export function registerExamCommand(program) {
1578
1578
  console.log(chalk.gray(' • You may exit and resume with the same token'));
1579
1579
  console.log();
1580
1580
  // ── Wait for confirmation ──
1581
- const readline = await import('node:readline');
1582
- const rlConfirm = readline.createInterface({ input: process.stdin, output: process.stdout });
1581
+ // Raw stdin read (not readline.createInterface) — a second readline on
1582
+ // process.stdin fights the parent REPL's readline and leaves stdin in
1583
+ // a half-detached state, so subsequent commands silently get no input.
1583
1584
  await new Promise((resolve) => {
1584
- rlConfirm.question(chalk.bold.yellow(' Press Enter to start the exam timer... '), () => {
1585
- rlConfirm.close();
1586
- resolve();
1587
- });
1585
+ process.stdout.write(chalk.bold.yellow(' Press Enter to start the exam timer... '));
1586
+ const wasRaw = process.stdin.isTTY ? process.stdin.isRaw : false;
1587
+ if (process.stdin.isTTY && process.stdin.setRawMode) {
1588
+ process.stdin.setRawMode(false);
1589
+ }
1590
+ const onData = (chunk) => {
1591
+ const s = chunk.toString();
1592
+ if (s.includes('\n') || s.includes('\r')) {
1593
+ process.stdin.removeListener('data', onData);
1594
+ if (process.stdin.isTTY && process.stdin.setRawMode) {
1595
+ process.stdin.setRawMode(wasRaw);
1596
+ }
1597
+ process.stdout.write('\n');
1598
+ resolve();
1599
+ }
1600
+ };
1601
+ process.stdin.on('data', onData);
1602
+ process.stdin.resume();
1588
1603
  });
1589
1604
  // ── Timer starts NOW ──
1590
1605
  const confirmedAt = new Date().toISOString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.19.55",
3
+ "version": "2.19.56",
4
4
  "description": "ICOA CLI — The world's first CLI-native CTF competition terminal",
5
5
  "type": "module",
6
6
  "bin": {