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.
- package/dist/commands/exam.js +21 -6
- package/package.json +1 -1
package/dist/commands/exam.js
CHANGED
|
@@ -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
|
-
|
|
1582
|
-
|
|
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
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
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();
|