Terminal.Gui
Terminal.Gui copied to clipboard
Wide Glyphs do not work correctly on `conhost`
Run the scenario Buttons with host console and you'll see the same. I really don't know why this happens but I'm sure the right string are passed to the console.
Originally posted by @BDisp in https://github.com/gui-cs/Terminal.Gui/issues/2928#issuecomment-1785413495
This problem is not just about Button. conhost operates differently from WT when rendering wide glyphs.
Run CharMap under conhost to see:
Note that NetDriver doesn't work correctly either.:
I am beginning to suspect the REAL problem is Rune.GetColumns(), which depends on wcwidth is returning values different than what WT is using internally (and WT an conhost behave differently in this regard).
The real fix to all of this is to figure out how to calculate the number of columns the same way WT is doing it.
I am beginning to suspect the REAL problem is
Rune.GetColumns(), which depends onwcwidthis returning values different than what WT is using internally (and WT an conhost behave differently in this regard).
You probably are right. Maybe you can open an issue on the owner repo?
The real fix to all of this is to figure out how to calculate the number of columns the same way WT is doing it.
Yes, this probably be a good choice. Do you are going to investigate the code?
Yes, this probably be a good choice. Do you are going to investigate the code?
Yes, I am actively working on this as part of #2610
I think that haven't anything related with wide char. I did this change to GetColumns:
and the result is:
The width is really 1 but conhost doesn't render well on all situations with certain character.
It's more subtle than that. How each terminal internally stores code points in cells and how it deals with cells to the left or right varies widely.
Run v1 charmap in conhost/wt/netdriver/windowsdriver and see wild differences.
It's more subtle than that. How each terminal internally stores code points in cells and how it deals with cells to the left or right varies widely.
You are right is terminal dependent. The case of the ⟦ the terminal doesn't handle the same way for all of them. In this case is only on the second button of the Top app and on the Dialog the situation is worst.
Run v1 charmap in conhost/wt/netdriver/windowsdriver and see wild differences.
Yes I already did and I see it happens with WindowsDriver and NetDriver. We can't do nothing unless it's fixed by Microsoft I guess.
@tig see this code point U+1085F “𐡟” where seems to occupies two columns but GetColumn return one. I know that depend if the font support or not a code point but cmd and conhost support it. It feels like it gets too tight.