forked from microsoft/terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually copy trailing attributes on a resize (microsoft#12637)
## THE WHITE WHALE This is a fairly naive fix for this bug. It's not terribly performant, but neither is resize in the first place. When the buffer gets resized, typically we only copy the text up to the `MeasureRight` point, the last printable char in the row. Then we'd just use the last char's attributes to fill the remainder of the row. Instead, this PR changes how reflow behaves when it gets to the end of the row. After we finish copying text, then manually walk through the attributes at the end of the row, and copy them over. This ensures that cells that just have a colored space in them get copied into the new buffer as well, and we don't just blat the last character's attributes into the rest of the row. We'll do a similar thing once we get to the last printable char in the buffer, copying the remaining attributes. This could DEFINITELY be more performant. I think this current implementation walks the attrs _on every cell_, then appends the new attrs to the new ATTR_ROW. That could be optimized by just using the actual iterator. The copy after the last printable char bit is also especially bad in this regard. That could likely be a blind copy - I just wanted to get this into the world. Finally, we now copy the final attributes to the correct buffer: the new one. We used to copy them to the _old_ buffer, which we were about to destroy. ## Validation I'll add more gifs in the morning, not enough time to finish spinning a release Terminal build with this tonight. Closes microsoft#32 🎉🎉🎉🎉🎉🎉🎉🎉🎉 Closes microsoft#12567 (cherry picked from commit 855e136)
- Loading branch information
1 parent
a638e01
commit 9ccd6ec
Showing
5 changed files
with
334 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.