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

Created on 1 Sep 2019  路  9Comments  路  Source: microsoft/terminal

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
Area-Output Area-Server Issue-Bug Priority-2 Product-Terminal Resolution-Duplicate v1-Scrubbed

Most helpful comment

@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.

All 9 comments

@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 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).

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.

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

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!

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

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

@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

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DieselMeister picture DieselMeister  路  3Comments

Wid-Mimosa picture Wid-Mimosa  路  3Comments

NickITGuy picture NickITGuy  路  3Comments

xmm1989218 picture xmm1989218  路  3Comments

miniksa picture miniksa  路  3Comments