[PR #6754] Add support for the "overline" graphic rendition attribute #26775

Open
opened 2026-01-31 09:18:05 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/6754

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/6754 **State:** closed **Merged:** Yes --- ## 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 * [x] Closes #6000 * [x] CLA signed. * [x] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [x] I've discussed this with core contributors already. ## 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.
claunia added the pull-request label 2026-01-31 09:18:05 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26775