-
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
Fix colors getting lost on reflow #17568
Conversation
I suddenly felt an itch and must close this. |
I'm reopening your PR ;P |
We broke a real tests case |
}, | ||
{ 1, 0 }, | ||
{ 1, 4 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure if I was able to think the test fix 100% through, but generally speaking this new value makes sense to me. If you expand this diff hunk above, you see the original buffer. The cursor is at the tail end beyond the "Q" in the bottom right corner. There are 12 spaces between the "Q" and the cursor. When we resize to a size of 2x5 the entire buffer ends up being filled with spaces. It's only natural then, that the cursor should end up at the bottom right corner of the new buffer.
The "copy the remaining attributes" loop assumes that it has full ownership over the rows that it copies. For that to be true, we have to of course make sure that the current write-cursor is at a fresh, new row in the first place. ## Validation Steps Performed * In a new pwsh tab with 120 colums: ``Write-Host -NoNewline "`e[36m$('a'*120)`e[m"; sleep 10`` * Resize the window wider * Color doesn't get lost (cherry picked from commit 2f43886) Service-Card-Id: 93441137 Service-Version: 1.21
The "copy the remaining attributes" loop assumes that it has full ownership over the rows that it copies. For that to be true, we have to of course make sure that the current write-cursor is at a fresh, new row in the first place. ## Validation Steps Performed * In a new pwsh tab with 120 colums: ``Write-Host -NoNewline "`e[36m$('a'*120)`e[m"; sleep 10`` * Resize the window wider * Color doesn't get lost (cherry picked from commit 2f43886) Service-Card-Id: 93522523 Service-Version: 1.20
The "copy the remaining attributes" loop assumes that it has full
ownership over the rows that it copies. For that to be true,
we have to of course make sure that the current write-cursor
is at a fresh, new row in the first place.
Validation Steps Performed
Write-Host -NoNewline "`e[36m$('a'*120)`e[m"; sleep 10