You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Double-cell characters that get wrapped to the next line not removed from the screen when deleting #2984
Make sure the double-cell character wraps to the next line. It means that there is 1 cell buffer left on the current line for the double-cell character, so that character will be rendered to the next line.
Start to delete characters, from the end, or from the middle of the line.
You will see the double-cell character left behinds even though it's already removed from the buffer.
The GIF's in the screenshot section above are 2 examples.
Expected behavior
Deletion works as expected to remove the character from screen.
Actual behavior
The double-cell characters are left on screen, even though the characters were already removed from the text buffer.
The root cause of this issue is how we calculate the physical line count and the length of the last physical line for a logical line (see code here). The columns is the total buffer cells of the logical line (see code here), but it doesn't count into the possibility of the word warping for a double-cell character, which will make the logical line take up more cells than the calculated sum. This causes the line clearing to not work correctly in this case.
changed the title [-]double-cell characters that get wrapped to the next line not removed from the screen when deleting[/-][+]Double-cell characters that get wrapped to the next line not removed from the screen when deleting[/+]on Nov 9, 2021
Intersting, it seems pwsh has such wrapper too. Makes sense to have the code duplicate? I remember we fixed issues in pwsh wrapper code too. Maybe has one well-tested?
I think the "wrapper" code you refer to is for word wrapping. It's different, here is the character wrapping that is done by the terminal/console, not the word wrapping.
Activity
daxian-dbw commentedon Nov 9, 2021
The root cause of this issue is how we calculate the physical line count and the length of the last physical line for a logical line (see code here). The
columnsis the total buffer cells of the logical line (see code here), but it doesn't count into the possibility of the word warping for a double-cell character, which will make the logical line take up more cells than the calculated sum. This causes the line clearing to not work correctly in this case.[-]double-cell characters that get wrapped to the next line not removed from the screen when deleting[/-][+]Double-cell characters that get wrapped to the next line not removed from the screen when deleting[/+]iSazonov commentedon Nov 10, 2021
Intersting, it seems pwsh has such wrapper too. Makes sense to have the code duplicate? I remember we fixed issues in pwsh wrapper code too. Maybe has one well-tested?
daxian-dbw commentedon Nov 10, 2021
I think the "wrapper" code you refer to is for word wrapping. It's different, here is the character wrapping that is done by the terminal/console, not the word wrapping.
iSazonov commentedon Nov 10, 2021
Isn't this based on the "same" helper method to calculate cell width?
daxian-dbw commentedon Nov 10, 2021
I don't know, never really looked at the word wrapping code in PS :)
iSazonov commentedon Nov 10, 2021
It doesn't cover all cases (use a workaround for simplicity). I think it could be good request for new API in .Net Runtime.