Closed
Description
- Version: 11.8.0, 11.9.0
- Platform: Windows 10 (x64)
- Subsystem: console
This code produces repeated output:
const readline = require('readline')
const process = require('process')
let rl = readline.createInterface({terminal: true, input: process.stdin, output: process.stdout})
rl.resume()
rl.input.on('data', (chunk) => {
console.log(`Received ${chunk.length} bytes of data - content was: ${chunk}`)
})
Run this with Node 11.8.0 or above and press the down arrow; two messages are produced:
Received 3 bytes of data - content was:
Received 3 bytes of data - content was:
Revert to Node 11.7.0, a single message is produced.
Received 3 bytes of data - content was:
This breaks, among many things, scrolling through menus in Inquirer.js: SBoudrias/Inquirer.js#778
This appears to be Windows specific (as far as I could tell, I was only able to test on a Linux VM via Docker right now).
Git bisect tells me this issue first appeared with c0859d7, which upgraded libuv
to 1.25.0
.
I'll keep digging into libuv (I already have an idea of where the problem was introduced in 1.25.0) but since this impacts Node on Windows somehwat significantly I figured it would be useful to have a way to track this!