On receiving SIGWINCH, only stdout has its rows/columns updated or resize event fired #2219
Closed
Description
I would expect that if both stdout and stderr are bound to /dev/tty
then resizes would trigger on both tty
objects, but this is not the case. This can be demonstrated with a simple script:
function setup (name, tty) {
console.error(name, 'started with rows:', tty.rows, 'columns:', tty.columns)
tty.on('resize', function () {
console.error('\n',name, 'resized to rows:', tty.rows, 'columns:', tty.columns)
})
}
setup('stdout', process.stdout)
setup('stderr', process.stderr)
console.error('sleeping for 10 seconds')
setTimeout(function () {}, 10000)
Run and try resizing the window before the timeout. You'll see update events from stdout
but none from stderr
.