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

Add support for the "overline" graphic rendition attribute #6754

Merged
5 commits merged into from
Jul 6, 2020

Conversation

j4james
Copy link
Collaborator

@j4james j4james commented Jul 2, 2020

Summary of the Pull Request

This PR adds support for the SGR 53 and SGR 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 this
attribute 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 and IsOverlined methods to the
TextAttribute class, to set and get the legacy
COMMON_LVB_GRID_HORIZONTAL attribute. Technically there was already an
IsTopHorizontalDisplayed method, but I thought it more readable to add
a 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 and SGR 55 sequences in the
SetGraphicsRendition methods of the two dispatchers. The actual
rendering was already taken care of by the PaintBufferGridLines method
in the rendering engines.

The only other change required was to update the _UpdateExtendedAttrs
method in the Xterm256Engine of the VT renderer, to ensure the
attribute 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, the OutputEngineTest, and the VtRendererTest.
I've also manually tested the SGR 53 and SGR 55 sequences to confirm
that they do actually render (or remove) an overline on the characters
being output.

@ghost ghost added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-VT Virtual Terminal sequence support Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. labels Jul 2, 2020
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid!

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jul 3, 2020
@ghost
Copy link

ghost commented Jul 3, 2020

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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 (@msftbot) and give me an instruction to get started! Learn more here.

Copy link
Member

@zadjii-msft zadjii-msft left a 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!

@ghost ghost merged commit 70a7ccc into microsoft:master Jul 6, 2020
@j4james j4james deleted the feature-sgr-overline branch July 7, 2020 19:00
@ghost
Copy link

ghost commented Jul 22, 2020

🎉Windows Terminal Preview v1.2.2022.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-VT Virtual Terminal sequence support AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terminal should support ANSI SGR 53 overline attribute
3 participants