Another case of the virtual bottom being miscalculated #17463

Closed
opened 2026-01-31 05:43:17 +00:00 by claunia · 3 comments
Owner

Originally created by @j4james on GitHub (May 10, 2022).

Windows Terminal version

Commit ec726e7ba7

Windows build number

10.0.19041.1415

Other Software

vttest

Steps to reproduce

  1. Open a bash shell in conhost.
  2. Immediately run vttest.
  3. Select test 4 (Test of double-sized characters).
  4. Press enter twice until it gets to the 132-column test.

Expected Behavior

It should display a 132-column version of the test output with examples of double width and double height content.

Actual Behavior

The page appears mostly blank, but if you scroll back in the buffer, you can see the test content has rendered on the page above (partially overwriting the previous test). This doesn't seem to happen (at least not consistently) if you've already scrolled down in the buffer when you start the test.

I believe this is another victim of PR #12972. And it looks like the source of the problem is again in the ResizeWithReflow code, which picks a position for the virtual bottom that isn't far enough down. I think this is because the majority of the page is blank at the time of the resize.

Originally created by @j4james on GitHub (May 10, 2022). ### Windows Terminal version Commit ec726e7ba70b760f98eb1e1ea1d71124536783c0 ### Windows build number 10.0.19041.1415 ### Other Software [vttest](https://www.invisible-island.net/vttest/) ### Steps to reproduce 1. Open a bash shell in conhost. 2. Immediately run vttest. 3. Select test 4 (Test of double-sized characters). 4. Press enter twice until it gets to the 132-column test. ### Expected Behavior It should display a 132-column version of the test output with examples of double width and double height content. ### Actual Behavior The page appears mostly blank, but if you scroll back in the buffer, you can see the test content has rendered on the page above (partially overwriting the previous test). This doesn't seem to happen (at least not consistently) if you've already scrolled down in the buffer when you start the test. I believe this is another victim of PR #12972. And it looks like the source of the problem is again in the `ResizeWithReflow` code, which picks a position for the virtual bottom that isn't far enough down. I think this is because the majority of the page is blank at the time of the resize.
Author
Owner

@j4james commented on GitHub (May 11, 2022):

I should add that I have an idea for fixing this: Essentially what we'd need to do is save the distance between the cursor row and the virtual bottom prior to resizing, and then add that distance to the new cursor row after resizing, and that should give us a good estimate of where the new virtual bottom ought to be. We'd still probably also need to take into account the other boundaries that we're currently checking, like the last non-space row, and the viewport height.

If that works, I'll try and put together a PR with the fix on Thursday.

@j4james commented on GitHub (May 11, 2022): I should add that I have an idea for fixing this: Essentially what we'd need to do is save the distance between the cursor row and the virtual bottom *prior* to resizing, and then add that distance to the new cursor row *after* resizing, and that should give us a good estimate of where the new virtual bottom ought to be. We'd still probably also need to take into account the other boundaries that we're currently checking, like the last non-space row, and the viewport height. If that works, I'll try and put together a PR with the fix on Thursday.
Author
Owner

@DHowett commented on GitHub (May 11, 2022):

(FWIW: I don't necessarily think you do, but if you do feel bad about introducing more virtual bottom bugs . . . just think about all the ones we already had that you helped to enumerate and fix(!). In true Windows Console fashion, and in the fashion of every other project everywhere, you can't make an omelet without breaking a few lions eggs. I'm eternally grateful for you breaking those eggs.)

@DHowett commented on GitHub (May 11, 2022): (FWIW: I don't necessarily think you do, but _if you do_ feel bad about introducing more virtual bottom bugs . . . just think about all the ones we already had that you helped to enumerate _and fix(!)_. In true Windows Console fashion, and in the fashion of every other project everywhere, you can't make an omelet without breaking a few ~lions~ eggs. I'm eternally grateful for you breaking those eggs.)
Author
Owner

@ghost commented on GitHub (May 24, 2022):

:tada:This issue was addressed in #13087, which has now been successfully released as Windows Terminal Preview v1.14.143.🎉

Handy links:

@ghost commented on GitHub (May 24, 2022): :tada:This issue was addressed in #13087, which has now been successfully released as `Windows Terminal Preview v1.14.143`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.14.143) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17463