-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
- Loading branch information
1 parent
7ac760b
commit f321921
Showing
4 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
const { mustCall } = require('../common'); | ||
const { notStrictEqual } = require('assert'); | ||
|
||
// tty.WriteStream#_refreshSize() only emits the 'resize' event when the | ||
// window dimensions change. We cannot influence that from the script | ||
// but we can set the old values to something exceedingly unlikely. | ||
process.stdout.columns = 9001; | ||
process.stdout.on('resize', mustCall()); | ||
process.kill(process.pid, 'SIGWINCH'); | ||
setImmediate(mustCall(() => notStrictEqual(process.stdout.columns, 9001))); |
Empty file.