Skip to content
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

Ambiguous width character incorrectly sized when UseDx enabled in conhost #4604

Closed
j4james opened this issue Feb 15, 2020 · 4 comments
Closed
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Conhost For issues in the Console codebase Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason.

Comments

@j4james
Copy link
Collaborator

j4james commented Feb 15, 2020

Environment

Windows build number: Version 10.0.18362.535
Windows Terminal version (if applicable): n/a
Conhost built from commit 4634a68

Steps to reproduce

  1. Set the UseDx registry entry to 1
  2. Open a WSL bash shell in conhost
  3. Run the command printf "12\n\uFFFD\n"

Expected behavior

U+FFFD is an ambiguous width character, which I thought we were supposed to be interpreting as narrow (see PR #2928). It certainly seems to work that way in Windows Terminal.

image

Actual behavior

In conhost (when UseDx is enabled), ambiguous width characters appear to be dependent on the font, so on my system this character is being rendered over two columns as if it were a wide character.

image

Looking at PR #2928, I see we made the glyph width fallback method in TermControl.cpp return false for all values. If I do something similar for the SetGlyphWidthFallback call in srvinit.cpp, that fixes the problem. Is there a reason why we don't want to do that? Are there backwards compatibility issues?

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 15, 2020
@zadjii-msft zadjii-msft added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Conhost For issues in the Console codebase labels Feb 18, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Feb 18, 2020
@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented Feb 18, 2020

This is just one of those weird things that the console host is going to have to do for compatibility--this behavior is conserved with the GDI renderer, where I believe we always queried the font when we didn't know. To change that would, perhaps, pose a compatibility issue for CJK/"FE" consumers. ☹️
(@miniksa can keep me honest here)

@DHowett-MSFT DHowett-MSFT added the Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason. label Feb 18, 2020
@j4james
Copy link
Collaborator Author

j4james commented Feb 18, 2020

I figured it might be something like that. But I thought maybe we could apply the narrow-ambiguous behavior only when in VT mode, and/or only when UseDx is enabled, assuming those are both opt-in modes. Not the end of the world though.

@DHowett-MSFT
Copy link
Contributor

In the fullness of time, Dx will (fingers crossed, schedules permitting, etc., etc.) be a viable renderer for the inbox console host as well, and unfortunately VT mode doesn't preclude an application from reading out the output buffer because that application is insane. 😄

This might be a good candidate for the I_SOLEMNLY_SWEAR_I_WILL_BE_A_GOOD_CITIZEN console mode.

@DHowett-MSFT
Copy link
Contributor

I'm gonna close this one out with my condolences.

@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Conhost For issues in the Console codebase Resolution-Won't-Fix We're just really obstinate about this. There's probably a good reason.
Projects
None yet
Development

No branches or pull requests

3 participants