-
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
Render the SGR "underlined" attribute in the style of the font #7148
Conversation
@msftbot make sure @zadjii-msft signs off |
Hello @DHowett! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
See, this is way more comprehensive than my "2 files changed" hack hour 😄 Thanks @j4james |
(don't mind me editing your pr bodies -- it's purely aesthetic for when the bot takes over the merge 😄) |
🎉 Handy links: |
This PR updates the rendering of the underlined graphic rendition
attribute, using the style specified in the active font, instead of just
reusing the grid line at the bottom of the character cell.
renderer was added in Refactor grid line renderers with support for more line types #7107.
There was already an
ExtendedAttributes
flag defined for theunderlined state, but I needed to update the
SetUnderlined
andIsUnderlined
methods in theTextAttribute
class to use that flagnow in place of the legacy
LVB_UNDERSCORE
attribute. This enablesunderlines set via a VT sequence to be tracked separately from
LVB_UNDERSCORE
grid lines set via the console API.I then needed to update the
Renderer::s_GetGridlines
method toactivate the
GridLines::Underline
style when theUnderlined
attribute was set. The
GridLines::Bottom
style is still triggered bythe
LVB_UNDERSCORE
attribute to produce the bottom grid line effect.Validation
Because this is a change from the existing behaviour, certain unit tests
that were expecting the
LVB_UNDERSCORE
to be toggled bySGR 4
andSGR 24
have now had to be updated to check theUnderlined
flaginstead.
There were also some UI Automation tests that were checking for
SGR 4
mapping to
LVB_UNDERSCORE
attribute, which I've now substituted with atest of the
SGR 53
overline attribute mapping toLVB_GRID_HORIZONTAL
. These tests only work with legacy attributes, sothey can't access the extended underline state, and I thought a
replacement test that covered similar ground would be better than
dropping the tests altogether.
As far as the visual rendering is concerned, I've manually confirmed
that the VT underline sequences now draw the underline in the correct
position and style, while grid lines output via the console API are
still displayed in their original form.
Closes #2915