Open
Description
So lets say you are making a cute little CLI app, and you write this code:
const rl = readline.createInterface(...);
rl.on('SIGINT', () => {
console.log('bye!');
process.exit();
});
rl.on('line', (line) => {
rl.pause();
compute(line).then(() => {
rl.resume();
});
});
You will discover that, while the interface is paused, the SIGINT event stops working. This is because pausing readline just pauses the underlying input stream. To fix this I think we would need to decouple that and have readline have an internal buffer of events. Alternatively we could say that people just shouldn't use readline pausing in this case, and do the line buffering themselves (that being said, I don't know how you would do this yourself or if it is even possible).
cc @nodejs/readline