xFurkanAdenia
xFurkanAdenia•2mo ago

rl.prompt issue

when i use rl.prompt program freezes. how can i solve?
9 Replies
Doctor 🤖
Doctor 🤖•2mo ago
rl.prompt? Can you give an example?
xFurkanAdenia
xFurkanAdeniaOP•2mo ago
import readline from "node:readline";

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
prompt: "Test => "
});


rl.prompt(true);

rl.on("line", (input) => {
console.log(input);
)
import readline from "node:readline";

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
prompt: "Test => "
});


rl.prompt(true);

rl.on("line", (input) => {
console.log(input);
)
but it freezes
Olli
Olli•2mo ago
Doesn't freeze for me, as in, it prompts for input and when I give it the program continues executing. How are you running it? Btw, the code you pasted is missing a } charcter
bartlomieju
bartlomieju•2mo ago
I can reproduce a hang on Mac. Most likely a bug in Deno - could you please open an issue about it?
xFurkanAdenia
xFurkanAdeniaOP•2mo ago
i dont write in ide :D okey
xFurkanAdenia
xFurkanAdeniaOP•2mo ago
No description
xFurkanAdenia
xFurkanAdeniaOP•2mo ago
this code frezees
Olli
Olli•2mo ago
I see. I'm on windows, seems to not be consistent :)
xFurkanAdenia
xFurkanAdeniaOP•2mo ago
:D