natureco-cli 2.23.24 → 2.23.25
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/src/commands/code.js +14 -10
package/package.json
CHANGED
package/src/commands/code.js
CHANGED
|
@@ -693,7 +693,11 @@ ${indexPrompt}`;
|
|
|
693
693
|
if (rl) {
|
|
694
694
|
try { rl.removeAllListeners(); rl.close(); } catch {}
|
|
695
695
|
}
|
|
696
|
-
rl = readline.createInterface({
|
|
696
|
+
rl = readline.createInterface({
|
|
697
|
+
input: process.stdin,
|
|
698
|
+
output: process.stdout,
|
|
699
|
+
terminal: true,
|
|
700
|
+
});
|
|
697
701
|
|
|
698
702
|
rl.on('SIGINT', async () => {
|
|
699
703
|
console.log('\n');
|
|
@@ -712,25 +716,25 @@ ${indexPrompt}`;
|
|
|
712
716
|
process.exit(0);
|
|
713
717
|
});
|
|
714
718
|
|
|
715
|
-
|
|
716
|
-
rl.on('close', () => {
|
|
717
|
-
if (process.exitCode !== undefined) return;
|
|
718
|
-
createRl();
|
|
719
|
-
});
|
|
719
|
+
rl.on('close', () => {});
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
async function promptLoop() {
|
|
723
723
|
while (true) {
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
724
|
+
let msg;
|
|
725
|
+
try {
|
|
726
|
+
msg = await new Promise(resolve => {
|
|
727
|
+
rl.question(chalk.gray('> '), resolve);
|
|
728
|
+
});
|
|
729
|
+
} catch {
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
727
732
|
|
|
728
733
|
process.stdout.write('\x1b[1A\x1b[2K');
|
|
729
734
|
|
|
730
735
|
const trimmed = msg.trim();
|
|
731
736
|
if (!trimmed) continue;
|
|
732
737
|
if (['exit', 'quit', 'çıkış', 'q'].includes(trimmed.toLowerCase())) {
|
|
733
|
-
rl.close();
|
|
734
738
|
process.exit(0);
|
|
735
739
|
}
|
|
736
740
|
|