-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Add support for the "overline" graphic rendition attribute #6754
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid!
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 (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thanks!
🎉 Handy links: |
Summary of the Pull Request
This PR adds support for the
SGR 53
andSGR 55
escapes 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
SetOverline
andIsOverlined
methods to theTextAttribute
class, to set and get the legacyCOMMON_LVB_GRID_HORIZONTAL
attribute. Technically there was already anIsTopHorizontalDisplayed
method, but I thought it more readable to adda separate
IsOverlined
as an alias for that.Then it was just a matter of adding calls to set and reset the attribute
in response to the
SGR 53
andSGR 55
sequences in theSetGraphicsRendition
methods of the two dispatchers. The actualrendering was already taken care of by the
PaintBufferGridLines
methodin the rendering engines.
The only other change required was to update the
_UpdateExtendedAttrs
method in the
Xterm256Engine
of 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 53
andSGR 55
sequences to confirmthat they do actually render (or remove) an overline on the characters
being output.