Skip to content

On receiving SIGWINCH, only stdout has its rows/columns updated or resize event fired #2219

Description

@iarna

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

confirmed-bugIssues and PRs for confirmed bugs.processIssues and PRs related to the process subsystem.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions