You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I close readline, readline.question still prompts the question, but the callback won't be called and the process hangs!
constreadline=require('readline').createInterface({input: process.stdin,output: process.stdout})readline.question(`What's your name?`,name=>{console.log(`Hi ${name}!`)readline.close()readline.question(`How are you?`,how=>{console.log(`Good to know you are ${how}!`)//readline.close() should close here})})
What is the feature you are proposing to solve the problem?
If readline.close() I think it is better readline.question not prompt, so no hang either.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered:
qiulang
changed the title
Node.js readline.question still prompts question when readline.close
Node.js readline.question still prompts question after readline.close
Mar 24, 2022
Mesteery
added
readline
Issues and PRs related to the built-in readline module.
feature request
Issues that request new features to be added to Node.js.
and removed
feature request
Issues that request new features to be added to Node.js.
labels
Mar 24, 2022
What is the problem this feature will solve?
When I close readline,
readline.question
still prompts the question, but the callback won't be called and the process hangs!What is the feature you are proposing to solve the problem?
If
readline.close()
I think it is betterreadline.question
not prompt, so no hang either.What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: