nodejs: resize doesn't fire on Windows Terminal #4526

Closed
opened 2026-01-30 23:49:44 +00:00 by claunia · 5 comments
Owner

Originally created by @8HoLoN on GitHub (Oct 17, 2019).

Environment

Windows build number: W10P : Microsoft Windows [version 10.0.18362.418]
Windows Terminal version (if applicable): Windows Terminal (Preview) Version: 0.5.2762.0


nodejs: v12.11.1

cmd-resize-bug.zip

Steps to reproduce

1. Open cmd or powershell on Windows Terminal
2. run node test.js (after npm i)
3. resize Windows Terminal => the number of column or row is not modified, resize event is not fired

Expected behavior

  1. run the same node test.js on native cmd or powershell and resize the window => everything is OK (the number of row and column is updated)

Actual behavior

  1. resize Windows Terminal => the number of column or row is not modified, resize event is not fired
Originally created by @8HoLoN on GitHub (Oct 17, 2019). # Environment ```none Windows build number: W10P : Microsoft Windows [version 10.0.18362.418] Windows Terminal version (if applicable): Windows Terminal (Preview) Version: 0.5.2762.0 nodejs: v12.11.1 ``` [cmd-resize-bug.zip](https://github.com/microsoft/terminal/files/3741116/cmd-resize-bug.zip) # Steps to reproduce 1. Open cmd or powershell on Windows Terminal 2. run node test.js (after npm i) 3. resize Windows Terminal => the number of column or row is not modified, resize event is not fired # Expected behavior 1. run the same node test.js on native cmd or powershell and resize the window => everything is OK (the number of row and column is updated) # Actual behavior 1. resize Windows Terminal => the number of column or row is not modified, resize event is not fired
claunia added the Needs-Tag-FixProduct-Terminal labels 2026-01-30 23:49:44 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 17, 2019):

So! This is a fun one. Node has decided to ignore the built-in console "resize" events that are automatically generated for anybody who asks, and instead listen to our accessibility subsystem to figure out when the console window has changed size. Since they took a hard dependency on a system that we never offered with an application compatibility guarantee, their resize detector doesn't work in WT.

This is related to #281.

I'm digging up our PM contact with nodejs to make sure we drive this somewhere.

@DHowett-MSFT commented on GitHub (Oct 17, 2019): So! This is a fun one. Node has decided to ignore the built-in console "resize" events that are automatically generated for anybody who asks, and instead listen to our accessibility subsystem to figure out when the console window has changed size. Since they took a hard dependency on a system that we never offered with an application compatibility guarantee, their resize detector doesn't work in WT. This is related to #281. I'm digging up our PM contact with nodejs to make sure we drive this somewhere.
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 17, 2019):

/cc @yodurr

@DHowett-MSFT commented on GitHub (Oct 17, 2019): /cc @yodurr
Author
Owner

@8HoLoN commented on GitHub (Oct 17, 2019):

For the reference : https://nodejs.org/api/tty.html#tty_event_resize

@8HoLoN commented on GitHub (Oct 17, 2019): For the reference : https://nodejs.org/api/tty.html#tty_event_resize
Author
Owner

@oising commented on GitHub (Oct 18, 2019):

Even more pertinent information on https://github.com/microsoft/terminal/issues/410

@oising commented on GitHub (Oct 18, 2019): Even more pertinent information on https://github.com/microsoft/terminal/issues/410
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 23, 2019):

It looks like the documentation was updated at some point, but there's a note in this version that explains what's going wrong.

If you switch your tty into raw mode and resume it, you'll get resize events.

@DHowett-MSFT commented on GitHub (Oct 23, 2019): It looks like the documentation was updated at some point, but there's a note in [this version](https://nodejs.org/docs/v8.6.0/api/tty.html#tty_event_resize) that explains what's going wrong. If you switch your tty into raw mode and resume it, you'll get resize events.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4526