-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
the vast majority of our supra-BMP output on windows/msys is fubar #2117
Comments
@j4james, how would you describe Unicode capabilities in Windows Terminal? |
Here's a screenshot from the notcurses uniblock demo running under WSL. Most of the BMP blocks should be showing content like this, so if most UTF-8 is not working for you, then something is seriously wrong. Once you get to the higher planes things become a little more messy, mostly in terms of the width calculations being wrong, so you'll have text "leaking" out of the area you were expecting it to fit and screwing up the rest of the page. I think this is because Windows stores Unicode in 16-bit "wide characters", and code points from the supplementary planes require surrogate pairs, so they don't fit in a single cell. Don't quote me on that, though. I just know that it's a known issue that they're still working on. It's also worth mentioning that there are additional limitations in the old conhost console. It uses a GDI renderer that doesn't do font fallback so if your selected font doesn't support a particular code point, you're just going to get a � (or something of the sort). I think the GDI renderer also ignored anything outside the BMP, so none of the supplementary planes are likely to work. Both those issues have been worked on recently, but unless you're building from source, you won't have those fixes. Then if you're testing on Mintty (or any other third-party terminal), there could be a number of other issues coming into play, so I'd suggest you stick to Windows Terminal to start with, until you've got something working reasonably. |
if you could run |
i'm testing on both. right now windows terminal is getting close to usable. mintty i would not say so, due to input problems detailed in #2116. in neither do i get much in the way of good |
Just looking at a couple of the missing code points at random, they seem to be outside the BMP, but are meant to be narrow width, so this could be the surrogate pair issue I mentioned above. Otherwise it may just be that my system doesn't have an appropriate font for all of those code points, although then I would expect a bunch of � replacement characters instead. Whatever it is, I don't think it's your problem. |
Now I'm beginning to have some doubts. I've just installed a font that it is supposed to have the segmented digit characters. That didn't seem to help with font fallback, but if I select it as my primary font, I can display those characters in the shell, like this: When I run notcurse-info, though, I'm still seeing those code points missing. I wouldn't have expected it to work perfectly, because I know the width calculations are going to be wrong, but I am surprised it's not showing anything at all. |
you have |
ohhhhhhhhhhhh you have WSL there not Windows Terminal. that's a whole different thing, no? that's using UNIX interfaces. |
Yeah. I haven't tried getting the native Windows build running. I was just trying to show you what Unicode you should be able to see in Windows Terminal. Also I can redirect the notcurses-info output to a file, and then |
i am setting the code page in Windows Terminal |
Actually, that's probably an easy way for you to test the Windows build. Just redirect to a file and compare the output to what you're seeing from a Linux build. I would think they would be more or less the same if things were working correctly. Then you don't have to worry about whether or not the terminal is rendering it correctly. |
i wouldn't be shocked if this is due to 16-bit |
yeah, i'm becoming pretty convinced that this has to do with being beyond the BMP and thus outside the range of |
hrmmm. |
removing this definitely did not help |
FYI, I figured out why there were so many gaps in the notcurse-info output from my WSL build. It seems that on my system those characters aren't support by
And the output I get is -1. I don't unix, so I don't know whether that means I need to upgrade the compiler or the libraries, or there's something else I'm doing wrong, but at least it suggests it's not your problem, and it likely isn't a terminal problem either. |
i notice that Braille works just fine for us in |
alright, coming back around to take a look at this. i think the thing to do is to write a small testing tool that allows us to explore these characters in windows. they're definitely usable, we're just doing something wrong. i'll look into this this weekend. |
once we get this resolved, we're going to pretty much be right on windows, so let's put some effort in here soon. |
Before you get too stressed about this, note that the narrow width characters in the astral planes are expected not to work correctly in Windows Terminal. They're going to take up twice as many cells as expected, which completely screws up the notcurses-info output. This is what it looks like at the moment when running from WSL: It actually looked better before you fixed the wcwidth problem and the characters were just dropped, but I'm definitely not suggesting you revert that. This is something that Windows Terminal needs to fix. |
do you know of any upstream bug i can track and/or comment on? |
ok, it's all clear now: RAST 00000020 [ ] to 45/0 cols: 1 40ffffff40191970
RAST 000000e2 [▒] to 45/1 cols: 1 40ffffff40191b70
RAST 00000096 [▒] to 45/2 cols: 1 40ffffff40191e71
RAST 00000098 [▒] to 45/3 cols: 1 40ffffff40192071
RAST 000000e2 [▒] to 45/4 cols: 1 40ffffff40192372
RAST 00000096 [▒] to 45/5 cols: 1 40ffffff40192572
RAST 0000009d [▒] to 45/6 cols: 1 40ffffff40192872
RAST 000000e2 [▒] to 45/7 cols: 1 40ffffff40192a73
RAST 00000096 [▒] to 45/8 cols: 1 40ffffff40192c73
RAST 00000080 [▒] to 45/9 cols: 1 40ffffff40192f73
RAST 000000e2 [▒] to 45/10 cols: 1 40ffffff40193174
RAST 00000096 [▒] to 45/11 cols: 1 40ffffff40193474
RAST 00000096 [▒] to 45/12 cols: 1 40ffffff40193675
RAST 000000e2 [▒] to 45/13 cols: 1 40ffffff40193875
RAST 00000096 [▒] to 45/14 cols: 1 40ffffff40193b75
RAST 0000008c [▒] to 45/15 cols: 1 40ffffff40193d76
RAST 000000e2 [▒] to 45/16 cols: 1 40ffffff40194076
RAST 00000096 [▒] to 45/17 cols: 1 40ffffff40194276
RAST 0000009e [▒] to 45/18 cols: 1 40ffffff40194577 this is from the quadrants output in also, right above this, we have:
output directly to stderr. so yeah, it's all a matter of our UTF8 being broken up into cells. find that, and we've got this resolved. |
it looks like |
i think we have a ridiculously low |
yep |
I can't comment on If you want an issue to track, the root of the problem is probably microsoft/terminal#8000 - essentially the text buffer implementation needs to be rewritten. But if you want to comment on this specific manifestation, something like microsoft/terminal#11694 might be more appropriate. |
aye, but we've just made massive progress! we now have quadrants! |
so it's not that |
https://www.youtube.com/watch?v=lO6mNbJGWHI oh yeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah |
ahhh this is a glorious day indeed, w00t w00t w00t, all good things come to he who hacks |
as hoped, this has also fixed various demos which were failing, including |
alright, whatever problems still exist, we no longer have the vast majority of our supra-BMP output on windows/msys fubar. we'll create focused issues for remaining problems, but this showstopper is resolved. |
microsoft/terminal#14640 and microsoft/terminal#13626 probably put a significant dent in this issue; they were just released as part of v1.17.1023. The infrastructure they lay will be available in newer[1] versions of ConPTY and therefore other terminal emulators on Windows at some future point. [1] we have plans about how we can update ConPTY outside of the Windows update cadence :) |
awesome! are you a fellow Friend of Redmond? feel free to hit me up at niblack on teams =] |
I was kinda hoping this would resolve itself without my intervention, but it appears not. Run some notcurses code. Note that most UTF-8 doesn't show up, or is otherwise fucked up. I refuse to believe that Microsoft Windows in 2021 cannot display most unicode. I mean, we don't even seem to have quadrants, and yet I think I've seen quadrants generated by other programs.
Figure out what we're doing wrong, and rectify it.
The text was updated successfully, but these errors were encountered: