xFurkanAdenia
xFurkanAdenia•4d ago

rl.prompt issue

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