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

gsudo --vt seems to have problems with character encoding #31

Closed
oising opened this issue May 3, 2020 · 4 comments
Closed

gsudo --vt seems to have problems with character encoding #31

oising opened this issue May 3, 2020 · 4 comments

Comments

@oising
Copy link

oising commented May 3, 2020

First up, great work Gerardo. Superb, in fact. Now, on to the issue at hand:

image

As you can see, gsudo without conpty is fine. But with --vt for conpty, the extended unicode characters are getting corrupted/munged somehow. I don't think this is an issue with conpty since WT itself uses conpty in general, and unicode works fine (obviously.)

Let me know if you need any more information. I'm using Fira Code as a font.

@gerardog
Copy link
Owner

gerardog commented May 4, 2020

First up, great work Gerardo. Superb, in fact.

Thanks, I appreciate it!

As you can see, gsudo without conpty is fine. But with --vt for conpty, the extended unicode characters are getting corrupted/munged somehow.

I haven't yet found time to find the root cause. gsudo uses Utf-8 which is unicode with 8 bytes representation. So, it should support all characters, right? There is a hidden problem somewhere and I should investigate, but nonetheless when I switched all IPC encodings to Utf-16 the problem is gone.

So, in case you want a fast-fix try this unsigned build.

But I am very courious on why are you using the VT/Pseudoconsole mode. It was my first approach to gsudo, and it has never been very reliable. I quickly ran into microsoft/terminal#3765 which Microsoft is not responding and my workaroud was flagged as "A non-recommended way to fix this issue that will cause long-term application stability issues", LOL. ConHost may wrap VT sequences at the far right of the screen, breaking them. So... I've marked VT mode as deprecated and almost deleted it's code. Let me know please!

@oising
Copy link
Author

oising commented May 4, 2020

It might be related to the lack of a ConPTY passthrough mode, the goal being to let all VT generated by client apps be unmolested by the plumbing: microsoft/terminal#1173

@oising
Copy link
Author

oising commented May 6, 2020

Closing as VT mode is deprecated.

@gerardog
Copy link
Owner

gerardog commented Jun 3, 2020

I got an answer on microsoft/terminal#3765. It was a silly mistake on my end. So I started looking into this:

The real issue here is this is missing line:
Console.OutputEncoding = System.Text.Encoding.UTF8;
Without it, it won't print the unicode symbols, like the special ">" as in Console.WriteLine("\ue0a0");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants