-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tty: fix 'resize' event regression #16225
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if the CI passes.
process.stdout.columns = 9001; | ||
process.stdout.on('resize', mustCall()); | ||
process.kill(process.pid, 'SIGWINCH'); | ||
setImmediate(mustCall(() => notStrictEqual(process.stdout.columns, 9001))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: it doesn't harm but I think mustCall()
is useless here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's there in case a bug makes the immediate not run. Since this PR touches early-boot code it seems like a good extra sanity check
This fixes #16141. Can someone explain why? |
This failed on smartos: https://ci.nodejs.org/job/node-test-commit-smartos/12229/ |
I think that's a pty + smartos issue, not anything specific to this PR. I've added an exception in the status file. CI again: https://ci.nodejs.org/job/node-test-pull-request/10815/ |
...but cc @nodejs/platform-smartos in case you want to investigate. |
@bzoz just in case, you modified |
Strange. I can reproduce #16141 on both Windows 10 build 15063 and Windows 7. But this PR only fixes it on Windows 7. |
Still LGTM |
It's not wholly clear what commit introduced the regression but between v8.4.0 and v8.5.0 the 'resize' event stopped getting emitted when the tty was resized. The SIGWINCH event listener apparently was being installed before the support code for `process.on('SIGWINCH', ...)` was. Fix that by moving said support code to real early in the bootstrap process. This commit also seems to fix a Windows-only "write EINVAL" error for reasons even less well-understood... Fixes: nodejs#16141 Fixes: nodejs#16194 PR-URL: nodejs#16225 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
Landed in 9c1b18a. |
It's not wholly clear what commit introduced the regression but between v8.4.0 and v8.5.0 the 'resize' event stopped getting emitted when the tty was resized. The SIGWINCH event listener apparently was being installed before the support code for `process.on('SIGWINCH', ...)` was. Fix that by moving said support code to real early in the bootstrap process. This commit also seems to fix a Windows-only "write EINVAL" error for reasons even less well-understood... Fixes: #16141 Fixes: #16194 PR-URL: #16225 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
The test here passes on v8.x-staging and v6.x-staging (without the other changes). Should this be backported or should we just backport the test? |
There's been some shuffling in bootstrap_node.js that probably fixed the regression by accident. Back-porting the test is a good idea, IMO. |
It's not wholly clear what commit introduced the regression but between v8.4.0 and v8.5.0 the 'resize' event stopped getting emitted when the tty was resized. The SIGWINCH event listener apparently was being installed before the support code for `process.on('SIGWINCH', ...)` was. Fix that by moving said support code to real early in the bootstrap process. This commit also seems to fix a Windows-only "write EINVAL" error for reasons even less well-understood... Fixes: #16141 Fixes: #16194 PR-URL: #16225 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
What does
this mean, specifically, FAIL,PASS in the status? Its not clear if this is still an issue, in which case there should be an open issue about it, or if its not an issue, can we delete the special notations from the |
It's not wholly clear what commit introduced the regression but between
v8.4.0 and v8.5.0 the 'resize' event stopped getting emitted when the
tty was resized.
The SIGWINCH event listener apparently was being installed before the
support code for
process.on('SIGWINCH', ...)
was. Fix that by movingsaid support code to real early in the bootstrap process.
Fixes: #16194
CI: https://ci.nodejs.org/job/node-test-pull-request/10732/