-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
LVB Gridlines do not transit ConPTY (Win32 "underline", overline, left/right) #8037
Comments
The problem is that the console APIs don't have a way to set the real underline attribute. If you want your text to be properly underlined, you'd need to have the Virtual Terminal mode enabled, and use a VT escape sequence ( If you really do need support for the (Note to any core devs reading this: I've suggested before that we could possibly use the ECMA ideogram SGR attributes for this, but those attributes aren't very well defined, so I'm not convinced that's a great idea. It's something to consider though.) |
Thank you James. I played with the escape seqs, and I got something working, but I have side effects after enabling Virtual Terminal Mode, I feel it is because my current rendering method is centered around WriteConsoleOutput(). I will debug. |
Wow, yeah -- "underline or right side", "overline or left side" I do think we should try to send these over ConPTY, and unfortunately I do think they need to be an SGR (specifically). They're a visual styling and terminals have a very good history of ignoring specifically graphical renditions they don't understand. |
My understanding of the "underline or right side" and "overline or left side" is that those attributes were intended to be used with East Asian scripts when written in a vertical orientation. So an "underline" would be rendered to the right of the glyphs, and an "overline" would be rendered to the left. And that's the way those attributes are rendered by RLogin, so there is at least some precedence for interpreting them that way.
That said, an underline is sometimes (rarely) used to indicate stress (at least according to this StackExchange answer), so it wouldn't be that terrible to interpret it that way. We unfortunately can't look to RLogin for precedence here, because they render The bottom line is we could reasonably translate our right and left grid lines as |
James, I had to change my code to NOT to use WriteConsoleOutput(), because it seems WriteConsoleOutput() "overrides" the underline. I am now using WriteConsole() in conjunction with SetConsoleCursorPosition(), and doing the ESC sequence when needed. This made the output very slow. I have not played with the cursor enable/disable yet. |
... disabling the cursor for the duration of the output improves performance significantly, but it is still far behind the WriteConsoleOutput() performance. |
I'm gonna re-purpose this thread as "make COMMON_LVB_*" attributes work in the Terminal - we definitely need to come up with something, because I'm sure that most legacy console apps are going to be using |
FWIW using *_LVB_UNDERSCORE in CHAR_INFO.Attributes via WriteConsoleOutput() would be the nicest solution in my use case, because: |
I came across something a while ago which I've been meaning to post, which could possibly work as a solution to this issue. I didn't think it was a great solution, but it's worth noting anyway. Quoting from this site: https://www.cs.auckland.ac.nz/references/unix/digital/AQ0R4CTE/DOCU_006.HTM#I768
The main escape sequence they're referring to there is If we were suggesting it as a VT sequence people could use in place of the legacy gridlines, it might be reasonable, but using it to forward existing gridline attributes over conpty seems like it would be horribly complicated. You could potentially be having to pass through a separate Bottom line is it's probably useless, but I wanted to at least make a note of it. Edit: The other thing I wanted to say was maybe we should just pass through the |
Windows 10, Windows Terminal, Version: 1.3.2651.0
I use
-- SetConsoleMode(hStdin, ENABLE_WINDOW_INPUT | ENABLE_LVB_GRID_WORLDWIDE )
-- I do "| COMMON_LVB_UNDERSCORE' on the attributes of CHAR_INFO 'line'
-- WriteConsoleOutput(... line );
I am 95% sure the rest of the code is valid -- because I can do colors, etc.
Expected behavior
-- characters should be underlined.
Actual behavior
-- no underline
The text was updated successfully, but these errors were encountered: