icoa-cli 2.19.73 → 2.19.75
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 +3 -3
- package/dist/repl.js +22 -6
- package/package.json +1 -1
package/dist/commands/exam.js
CHANGED
|
@@ -342,10 +342,10 @@ function printQuestionProgress(current, total, answered) {
|
|
|
342
342
|
console.log(` ${chalk.gray('⏱ Time remaining:')} ${color(timeStr)} ${chalk.gray('(server-authoritative)')}`);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
// Help budget per exam.md §3:
|
|
345
|
+
// Help budget per exam.md §3: 20 base + 10 hidden bonus (unlocked via `more help`).
|
|
346
346
|
// Demo still uses the lighter 5 + 3 set via _helpMax overrides at demo start.
|
|
347
|
-
const HELP_BASE =
|
|
348
|
-
const HELP_WITH_BONUS =
|
|
347
|
+
const HELP_BASE = 20;
|
|
348
|
+
const HELP_WITH_BONUS = 30;
|
|
349
349
|
function getHelpState(state) {
|
|
350
350
|
return {
|
|
351
351
|
used: state._helpUsed || 0,
|
package/dist/repl.js
CHANGED
|
@@ -873,20 +873,36 @@ export async function startRepl(program, resumeMode) {
|
|
|
873
873
|
}
|
|
874
874
|
function runSystemCommand(input, rl, cwd) {
|
|
875
875
|
return new Promise((resolve) => {
|
|
876
|
+
// Fully release the TTY so interactive children (python3, bash, etc.)
|
|
877
|
+
// get a clean terminal with proper echo. `rl.pause()` alone doesn't
|
|
878
|
+
// reset raw mode or release stdin — readline keeps it in line-editing
|
|
879
|
+
// mode where typed characters don't display until our REPL reads a line.
|
|
880
|
+
const stdin = process.stdin;
|
|
881
|
+
const wasRaw = stdin.isTTY ? !!stdin.isRaw : false;
|
|
876
882
|
rl.pause();
|
|
883
|
+
if (stdin.isTTY && typeof stdin.setRawMode === 'function') {
|
|
884
|
+
try {
|
|
885
|
+
stdin.setRawMode(false);
|
|
886
|
+
}
|
|
887
|
+
catch { }
|
|
888
|
+
}
|
|
877
889
|
const child = spawn(input, {
|
|
878
890
|
shell: true,
|
|
879
891
|
stdio: 'inherit',
|
|
880
892
|
cwd: cwd || process.cwd(),
|
|
881
893
|
});
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
894
|
+
const restore = () => {
|
|
895
|
+
if (stdin.isTTY && typeof stdin.setRawMode === 'function' && wasRaw) {
|
|
896
|
+
try {
|
|
897
|
+
stdin.setRawMode(true);
|
|
898
|
+
}
|
|
899
|
+
catch { }
|
|
900
|
+
}
|
|
887
901
|
rl.resume();
|
|
888
902
|
resolve();
|
|
889
|
-
}
|
|
903
|
+
};
|
|
904
|
+
child.on('close', restore);
|
|
905
|
+
child.on('error', restore);
|
|
890
906
|
});
|
|
891
907
|
}
|
|
892
908
|
function mapCommand(input) {
|