-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Another case of the virtual bottom being miscalculated #13078
Comments
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. |
(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 |
When the buffer is resized with a reflow, we were previously calculating the new virtual bottom based on the position of last non-space character. If the viewport was largely blank when resized, this could result in the new virtual bottom being higher than it should be. This PR attempts to address that problem by restoring the virtual bottom to a position that is the same distance from the cursor row as it was prior to the resize. This was a regression introduced in PR #12972. We still take the last non-space row into account when determining the virtual bottom, because if the content of the screen is forced to wrap, the virtual bottom will need to be lower (relative to the cursor) than it was before. We also need to check that we don't overflow the bottom of the buffer, which can occur when the viewport is at the bottom of the buffer, and the cursor position is pushed down as a result of content wrapping above it. I've manually confirmed that this fixes the problem reported in issue #13078, and I've also extended the existing `RefreshWithReflow` unit test to cover that particular scenario. Closes #13078
When the buffer is resized with a reflow, we were previously calculating the new virtual bottom based on the position of last non-space character. If the viewport was largely blank when resized, this could result in the new virtual bottom being higher than it should be. This PR attempts to address that problem by restoring the virtual bottom to a position that is the same distance from the cursor row as it was prior to the resize. This was a regression introduced in PR #12972. We still take the last non-space row into account when determining the virtual bottom, because if the content of the screen is forced to wrap, the virtual bottom will need to be lower (relative to the cursor) than it was before. We also need to check that we don't overflow the bottom of the buffer, which can occur when the viewport is at the bottom of the buffer, and the cursor position is pushed down as a result of content wrapping above it. I've manually confirmed that this fixes the problem reported in issue #13078, and I've also extended the existing `RefreshWithReflow` unit test to cover that particular scenario. Closes #13078 (cherry picked from commit c2f8308) Service-Card-Id: 81864034 Service-Version: 1.14
🎉This issue was addressed in #13087, which has now been successfully released as Handy links: |
Windows Terminal version
Commit ec726e7
Windows build number
10.0.19041.1415
Other Software
vttest
Steps to reproduce
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.The text was updated successfully, but these errors were encountered: