xFurkanAdenia
xFurkanAdenia•4w ago

rl.prompt issue

when i use rl.prompt program freezes. how can i solve?
9 Replies
Doctor 🤖
Doctor 🤖•4w ago
rl.prompt? Can you give an example?
xFurkanAdenia
xFurkanAdeniaOP•4w 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•4w 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•4w ago
I can reproduce a hang on Mac. Most likely a bug in Deno - could you please open an issue about it?
xFurkanAdenia
xFurkanAdeniaOP•4w ago
i dont write in ide :D okey
xFurkanAdenia
xFurkanAdeniaOP•4w ago
No description
xFurkanAdenia
xFurkanAdeniaOP•4w ago
this code frezees
Olli
Olli•4w ago
I see. I'm on windows, seems to not be consistent :)
xFurkanAdenia
xFurkanAdeniaOP•4w ago
:D