Add support for the "overline" graphic rendition attribute#6754
Merged
5 commits merged intomicrosoft:masterfrom Jul 6, 2020
Merged
Add support for the "overline" graphic rendition attribute#67545 commits merged intomicrosoft:masterfrom
5 commits merged intomicrosoft:masterfrom
Conversation
|
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
zadjii-msft
approved these changes
Jul 6, 2020
Member
zadjii-msft
left a comment
There was a problem hiding this comment.
Looks great to me, thanks!
|
🎉 Handy links: |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
This PR adds support for the
SGR 53andSGR 55escapes sequences,which enable and disable the ANSI overline graphic rendition
attribute, the equivalent of the console character attribute
COMMON_LVB_GRID_HORIZONTAL. When a character is output with thisattribute set, a horizontal line is rendered at the top of the character
cell.
PR Checklist
Detailed Description of the Pull Request / Additional comments
To start with, I added
SetOverlineandIsOverlinedmethods to theTextAttributeclass, to set and get the legacyCOMMON_LVB_GRID_HORIZONTALattribute. Technically there was already anIsTopHorizontalDisplayedmethod, but I thought it more readable to adda separate
IsOverlinedas an alias for that.Then it was just a matter of adding calls to set and reset the attribute
in response to the
SGR 53andSGR 55sequences in theSetGraphicsRenditionmethods of the two dispatchers. The actualrendering was already taken care of by the
PaintBufferGridLinesmethodin the rendering engines.
The only other change required was to update the
_UpdateExtendedAttrsmethod in the
Xterm256Engineof the VT renderer, to ensure theattribute state would be forwarded to the Windows Terminal over conpty.
Validation Steps Performed
I've extended the existing SGR unit tests to cover the new attribute in
the
AdapterTest, theOutputEngineTest, and theVtRendererTest.I've also manually tested the
SGR 53andSGR 55sequences to confirmthat they do actually render (or remove) an overline on the characters
being output.