Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix VtEngine hang when resizing while scrolling (#15618)
This fixes a bug reported internally that occurs when resizing the terminal while also scolling the contents. The easiest way to reproduce it is to resize the terminal to 0 rows, but it's much more prominent in a debug build where everything goes out of sync almost immediately. The underlying issue is that `VtEngine::_wrappedRow` may contain an offset that is outside of the viewport bounds, because reflowing and scrolling aren't properly synchronized. The previous `bitmap` code would then throw an exception for such invalid coordinates and cause the internal `VtEngine` state to be broken. Once `_wrappedRow` got to a negative value at least once, it would stay that way unless you're scrolling up. If the contents are actively scrolling it would quickly reach a negative value from which it can never recover. At that point OpenConsole would enter a tight exception-throw-catch-retry loop and Windows Terminal seemingly cease to show any content. ## Validation Steps Performed * Resize WT to the minimal window size repeatedly * Doesn't hang ✅
- Loading branch information