Some applications failed to respond to resize of the console #13279

Closed
opened 2026-01-31 03:38:35 +00:00 by claunia · 2 comments
Owner

Originally created by @ZEDCWT on GitHub (Apr 1, 2021).

Windows Terminal version (or Windows build number)

1.7.572.0

Other Software

Node v15.13.0

Steps to reproduce

  • Open CMD or PowerShell in the Terminal
  • Run the following command
path\to\node.exe -e "void setInterval(() => console.log(new Date,process.stdout.columns,process.stdout.rows),1000)"

Expected Behavior

The columns and rows numbers, which indicate the size of the console, change while resizing the terminal.

Actual Behavior

The output does no change

Here is the initial status
WT Init
After resizing
WT Resize
You can see the output does not change

Here is the result run on a standalone CMD.exe
CMD Init
CMD Resize
You can see the output reflect the console size

I also tried standalone PowerShell.exe, ConEmu, and Cmder with the same command, they all behave the same as the standalone
CMD.exe.

Furthermore, I found that result becomes different if run the code in the REPL mode of Node
REPL Init
REPL Resize
You can see that this time, it output as expected.

Originally created by @ZEDCWT on GitHub (Apr 1, 2021). ### Windows Terminal version (or Windows build number) 1.7.572.0 ### Other Software Node v15.13.0 ### Steps to reproduce + Open CMD or PowerShell in the Terminal + Run the following command ``` path\to\node.exe -e "void setInterval(() => console.log(new Date,process.stdout.columns,process.stdout.rows),1000)" ``` ### Expected Behavior The `columns` and `rows` numbers, which indicate the size of the console, change while resizing the terminal. ### Actual Behavior The output does no change Here is the initial status ![WT Init](https://user-images.githubusercontent.com/7867810/113320932-aaa68b80-9345-11eb-8d68-c103c23b50bf.png) After resizing ![WT Resize](https://user-images.githubusercontent.com/7867810/113321066-cd38a480-9345-11eb-928e-cfae1f27f296.png) You can see the output does not change Here is the result run on a standalone CMD.exe ![CMD Init](https://user-images.githubusercontent.com/7867810/113321354-17ba2100-9346-11eb-8f08-220735a7c7bc.png) ![CMD Resize](https://user-images.githubusercontent.com/7867810/113321365-1a1c7b00-9346-11eb-8ec0-a8e5b9d04c73.png) You can see the output reflect the console size I also tried standalone PowerShell.exe, ConEmu, and Cmder with the same command, they all behave the same as the standalone CMD.exe. Furthermore, I found that result becomes different if run the code in the REPL mode of Node ![REPL Init](https://user-images.githubusercontent.com/7867810/113322627-7fbd3700-9347-11eb-9d7b-94e32b87e0f5.png) ![REPL Resize](https://user-images.githubusercontent.com/7867810/113322634-821f9100-9347-11eb-9edb-045bbf27625f.png) You can see that this time, it output as expected.
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-31 03:38:35 +00:00
Author
Owner

@DHowett commented on GitHub (Apr 1, 2021):

I believe that this is because node uses libuv for terminal I/O, and libuv uses the accessibility system (!) to determine when its console window has changed size, instead of the actual console event. Because Terminal hosts console applications in panes, it cannot give each of them an individual window... so libuv's resize detection is broken. It will also be broken for node applications running under ssh, telnet, vscode, vim :terminal in ++conpty mode, and wezterm.

@DHowett commented on GitHub (Apr 1, 2021): I believe that this is because node uses libuv for terminal I/O, and libuv uses _the accessibility system_ (!) to determine when its console window has changed size, instead of the actual console event. Because Terminal hosts console applications in panes, it cannot give each of them an individual window... so libuv's resize detection is broken. It will also be broken for node applications running under ssh, telnet, vscode, vim :terminal in ++conpty mode, and wezterm.
Author
Owner

@DHowett commented on GitHub (Apr 1, 2021):

They talked about moving away from the resize event which all consoles produce in https://github.com/libuv/libuv/issues/2430#issuecomment-522405492. Hm.

@DHowett commented on GitHub (Apr 1, 2021): They talked about moving away from the resize event which all consoles produce in https://github.com/libuv/libuv/issues/2430#issuecomment-522405492. Hm.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13279