-
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
resize event not firing #16194
Comments
/cc @nodejs/platform-macos @Flet #13197 would have been my first guess too, but it was closed by a documentation change - ff07eaa |
I'm not sure what broke exactly but it starts working again when you add a no-op
My initial guess was that some of the inspector changes broke it because the problem goes away with this patch but I haven't pinpointed the cause yet: diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
index e7676c0867..b9ac545dd1 100644
--- a/lib/internal/bootstrap_node.js
+++ b/lib/internal/bootstrap_node.js
@@ -36,6 +36,7 @@
const browserGlobals = !process._noBrowserGlobals;
if (browserGlobals) {
setupGlobalTimeouts();
+ _process.setupSignalHandlers();
setupGlobalConsole();
}
@@ -57,7 +58,6 @@
_process.setup_cpuUsage();
_process.setupMemoryUsage();
_process.setupKillAndExit();
- _process.setupSignalHandlers();
if (global.__coverage__)
NativeModule.require('internal/process/write-coverage').setup();
|
Did a bisect, and it seems like f34e0f9 is what introduced the new behavior. |
@maclover7 , @Flet can you devise a regression test for this? (something like: start a child node process in a terminal, then try to script a resize of that terminal) Another good test to have is a unit test of the event on the node side (one that mocks the libuv behaviour) |
That commit was one of my suspects but its code does not exist anymore in v8.6.0, it was removed in 8ce0e9a (which is a somewhat suspect commit as well.) |
This sounds reasonable to me, we should set up the signal handlers before loading the console / |
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]>
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]>
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]>
In versions
v8.5.0
and higher, theresize
event does not seem to fire on terminal window resize.Test code:
I was able to have success when trying
v8.4.0
, butv8.5.0
does not work.Possibly related recent closed issue:
#13197
The text was updated successfully, but these errors were encountered: