-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Full-screen COLOR command no longer works right when resizing conhost and Terminal #12567
Comments
yes, yes it does |
for linking: #3848 Options
|
…. I was worng. My theory was "fuck perf, let's do it right, and figure out perf later". It didn't work. This wraps lines super weird, probably because I'm copying the whole line to the right side of the row, which is then starting to mark it as wrapped. Also like the test doesn't even pass.
So, this is totally low key #32. It was just never a problem before, because when you'd do
I bet it would have done the same thing with the red FOO line in conhost before this change.
Look, this has been busted since RS5. That's like, since October 2018. I wasn't the murderer (this time)! |
bunch of todos. It also totally takes care of #12567 as well
Yeah, I was going to say I thought this was probably the same thing as #32. Will be great if we can get that fixed. |
it's my white whale 😆 |
Yo @j4james since you've probably spent more time in the buffer than anyone else recently, would you mind taking a quick look at https://github.com/microsoft/terminal/compare/dev/migrie/b/32-attempt-2 ? I feel like I have to be missing something obvious. Like, this bug (#32) dates back to Windows 10, there's no way fixing it should be that easy. It's not perfect:
I just feel like I must have missed something obvious. It couldn't have been that easy |
The first thing I noticed is that it only works as far as the last non-blank line. For example, if you do Then there were a couple of things in the code that looked wrong to me, which I suspect might fail in certain edge cases. One example being the line widths not taking line rendition into account - I'd expect us to be using the And why are we using the min of the old width and new width for the source column range? Maybe I'm missing something, but that doesn't make sense to me. I would have thought the Then, not related to this fix per se, but I noticed that the active attributes are being reset when you resize. I suspect this is because the two lines below are in the wrong order (the old attributes are restored into the buffer that's about to be replaced): terminal/src/host/screenInfo.cpp Lines 1474 to 1476 in 71c7556
I should also note that I've definitely had some other things looking wrong when messing about resizing randomly, but I need to experiment some more to get reproducible test cases. |
In that branch, yea. That's one of the TODOs that definitely needs to be done 😅
See this is exactly why I asked for your help - I totally forgot about that feature entirely. That can be fixed. Thanks!
Yea, that's an artifact from the first iteration of the fix I forgot to remove. Whoops. This was a great sanity check! I'll patch those up and see if I can't get some tests written too. If we can confidently say that the fix is "not perfect, but definitely no worse than before", that's good enough for me frankly.
holy shit you're right, that's been there since forever. I wonder if that's a bug floating around on the repo somewhere. |
## 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 #32 🎉🎉🎉🎉🎉🎉🎉🎉🎉 Closes #12567
## 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 #32 🎉🎉🎉🎉🎉🎉🎉🎉🎉 Closes #12567 (cherry picked from commit 855e136)
## 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 #32 🎉🎉🎉🎉🎉🎉🎉🎉🎉 Closes #12567 (cherry picked from commit 855e136)
🎉This issue was addressed in #12637, which has now been successfully released as Handy links: |
🎉This issue was addressed in #12637, which has now been successfully released as Handy links: |
## 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 #32 🎉🎉🎉🎉🎉🎉🎉🎉🎉 Closes #12567 (cherry picked from commit 855e136)
This is the external half of MSFT:34761400
Since this one's a partner bug, we've gotta get this sorted out in this OS release.
The text was updated successfully, but these errors were encountered: