@inetafrica/open-claudia 1.0.5 → 1.0.6
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/setup.js +5 -3
package/package.json
CHANGED
package/setup.js
CHANGED
|
@@ -19,19 +19,21 @@ const SETUP_STATE_FILE = path.join(CONFIG_DIR, ".setup-state.json");
|
|
|
19
19
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
20
20
|
const ask = (q) => new Promise((r) => rl.question(q, r));
|
|
21
21
|
const askHidden = (q) => new Promise((resolve) => {
|
|
22
|
+
// Pause readline so it doesn't compete for stdin
|
|
23
|
+
rl.pause();
|
|
22
24
|
process.stdout.write(q);
|
|
23
25
|
const stdin = process.stdin;
|
|
24
|
-
const wasRaw = stdin.isRaw;
|
|
25
26
|
stdin.setRawMode(true);
|
|
26
27
|
stdin.resume();
|
|
27
28
|
stdin.setEncoding("utf8");
|
|
28
29
|
let input = "";
|
|
29
30
|
const onData = (ch) => {
|
|
30
31
|
if (ch === "\n" || ch === "\r" || ch === "\u0004") {
|
|
31
|
-
stdin.setRawMode(wasRaw);
|
|
32
|
-
stdin.pause();
|
|
33
32
|
stdin.removeListener("data", onData);
|
|
33
|
+
stdin.setRawMode(false);
|
|
34
34
|
process.stdout.write("\n");
|
|
35
|
+
// Restore readline
|
|
36
|
+
rl.resume();
|
|
35
37
|
resolve(input);
|
|
36
38
|
} else if (ch === "\u0003") {
|
|
37
39
|
process.exit();
|