Bug Report: initialRows (or buffersize) doesn't get updated on windows size changes #3697

Closed
opened 2026-01-30 23:27:34 +00:00 by claunia · 9 comments
Owner

Originally created by @Vreyesm on GitHub (Sep 1, 2019).

Originally assigned to: @zadjii-msft on GitHub.

Environment

Windows build number: Microsoft Windows [Versión 10.0.18362.295]
Windows Terminal version: 0.4.2382.0

Steps to reproduce

  1. Set the initialRows value to something like 30 rows (a value that makes the openned window has less rows than the maximized window should have).
  2. Maximize the window.
  3. Run some command with a lot of output (like ps, lsor dir).

Expected behavior

  • The buffersize setted with initialRows gets updated after window size changes.
  • Behavior on PowerShell.
    image

image

Actual behavior

  • After maximizing the window and running ps the buffer size setted with the initialRows value doesn't get updated after the window size changes.

image

image

  • The problem gets solved if I open a new tab and run the command again.
    image
Originally created by @Vreyesm on GitHub (Sep 1, 2019). Originally assigned to: @zadjii-msft on GitHub. <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Versión 10.0.18362.295] Windows Terminal version: 0.4.2382.0 ``` # Steps to reproduce 1. Set the `initialRows` value to something like 30 rows (a value that makes the openned window has less rows than the maximized window should have). 2. Maximize the window. 3. Run some command with a lot of output (like `ps`, `ls`or `dir`). # Expected behavior - The buffersize setted with `initialRows` gets updated after window size changes. - Behavior on PowerShell. ![image](https://user-images.githubusercontent.com/12416901/64070190-a6763180-cc29-11e9-892d-8ffa4d3f9e24.png) ![image](https://user-images.githubusercontent.com/12416901/64070158-146e2900-cc29-11e9-9c70-903fbe72662c.png) <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior - After maximizing the window and running `ps` the buffer size setted with the `initialRows` value doesn't get updated after the window size changes. ![image](https://user-images.githubusercontent.com/12416901/64070198-d7566680-cc29-11e9-8278-8b4fe5c8b138.png) ![image](https://user-images.githubusercontent.com/12416901/64070205-e3dabf00-cc29-11e9-88f4-45e3500f15b2.png) - The problem gets solved if I open a new tab and run the command again. ![image](https://user-images.githubusercontent.com/12416901/64070208-f1904480-cc29-11e9-9705-5ebc57e0b609.png) <!-- What's actually happening? -->
Author
Owner

@zadjii-msft commented on GitHub (Sep 5, 2019):

@Vreyesm Out of curiosity, does this repro if you execute Remove-Module psreadline before maximizing? Does it repro if you switch the default profile to cmd?

@zadjii-msft commented on GitHub (Sep 5, 2019): @Vreyesm Out of curiosity, does this repro if you execute `Remove-Module psreadline` before maximizing? Does it repro if you switch the default profile to `cmd`?
Author
Owner

@Vreyesm commented on GitHub (Sep 6, 2019):

@zadjii-msft Executing Remove-Module PSReadline doesn't make any changes on the behavior, but if I change the default profile to cmd (or wsl running ubuntu 18.04) as you suggest, the problem gets solved (following the steps described above).

@Vreyesm commented on GitHub (Sep 6, 2019): @zadjii-msft Executing `Remove-Module PSReadline` doesn't make any changes on the behavior, but if I change the default profile to `cmd` (or `wsl` running ubuntu 18.04) as you suggest, the problem gets solved (following the steps described above).
Author
Owner

@hwinkler commented on GitHub (Jan 31, 2020):

I too have this problem as described, yet my default profile is wsl Ububtu 18.04.

I can confirm the workaround described, opening a new tab: the new tab doesn't have the problem. Thanks for that tip.

@hwinkler commented on GitHub (Jan 31, 2020): I too have this problem as described, yet my default profile is `wsl` Ububtu 18.04. I can confirm the workaround described, opening a new tab: the new tab doesn't have the problem. Thanks for that tip.
Author
Owner

@zadjii-msft commented on GitHub (Mar 17, 2020):

Hey so while burning down bugs, it looks like this is the same bug as #2815. This one was filed first, but the other one's got a bit more details on the specific root cause of the problem, so I'm going to mark that one as the parent bug. Regardless, I've got a fix ready for these that should be in PR later today. Thanks!

/dup #2815

@zadjii-msft commented on GitHub (Mar 17, 2020): Hey so while burning down bugs, it looks like this is the same bug as #2815. This one was filed first, but the other one's got a bit more details on the specific root cause of the problem, so I'm going to mark that one as the parent bug. **Regardless**, I've got a fix ready for these that should be in PR later today. Thanks! /dup #2815
Author
Owner

@ghost commented on GitHub (Mar 17, 2020):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Mar 17, 2020): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Author
Owner

@f9analytics commented on GitHub (May 28, 2020):

Any idea when this buffer resize issue will have a fix? If I run a normal cmd the screen adjusts, if I run in Windows Terminal I get [process exited with code 4294967295] {See Image-1 }. If I manually expand the window, and rerun, everything works fine {See Image-2 }.

Image-1
Error

Image-2
Ok

@f9analytics commented on GitHub (May 28, 2020): Any idea when this buffer resize issue will have a fix? If I run a normal cmd the screen adjusts, if I run in Windows Terminal I get [process exited with code 4294967295] {See Image-1 }. If I manually expand the window, and rerun, everything works fine {See Image-2 }. **Image-1** <img width="825" alt="Error" src="https://user-images.githubusercontent.com/61324207/83191205-77252000-a0e8-11ea-9a9f-c50e91360b14.png"> **Image-2** <img width="887" alt="Ok" src="https://user-images.githubusercontent.com/61324207/83191490-f4e92b80-a0e8-11ea-81ab-a8bc1add2252.png">
Author
Owner

@zadjii-msft commented on GitHub (May 28, 2020):

Oh, that's probably #4062 or #5094, or some combo of the two

@zadjii-msft commented on GitHub (May 28, 2020): Oh, that's probably #4062 or #5094, or some combo of the two
Author
Owner

@f9analytics commented on GitHub (May 28, 2020):

@zadjii-msft - I believe it is thrown due to SetCursorPosition. Please See Below:

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was 30.
at System.Console.SetCursorPosition(Int32 left, Int32 top)

Any thoughts? thx

@f9analytics commented on GitHub (May 28, 2020): @zadjii-msft - I believe it is thrown due to SetCursorPosition. Please See Below: Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. Parameter name: top Actual value was 30. at System.Console.SetCursorPosition(Int32 left, Int32 top) Any thoughts? thx
Author
Owner

@f9analytics commented on GitHub (May 29, 2020):

@zadjii-msft - I think I found the issue. The old school conhost.exe apparently auto resizes buffer rows without any explicit setting. If I set the console buffer height explicitly. No error. It works as intended. perfectly. Please let anyone know that had similar issue.

Thanks again msft.

@f9analytics commented on GitHub (May 29, 2020): @zadjii-msft - I think I found the issue. The old school conhost.exe apparently auto resizes buffer rows without any explicit setting. If I set the console buffer height explicitly. No error. It works as intended. perfectly. Please let anyone know that had similar issue. Thanks again msft.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3697