SGR 0 doesn't work correctly when combined with meta attributes #7398

Closed
opened 2026-01-31 01:02:54 +00:00 by claunia · 3 comments
Owner

Originally created by @j4james on GitHub (Apr 13, 2020).

Environment

Windows build number: Version 10.0.18362.657
Windows Terminal version (if applicable): Commit ea1bb2ed93

Steps to reproduce

From a bash shell in conhost, execute the following command:

printf "\e[0;7mReverse\e[0;4mUnderline\e[m\n"

Expected behavior

It should display the first word with reversed video, and the second word underlined.

For example, here's what it looks like in mintty:

image

Actual behavior

The SGR 0 in the second sequence doesn't take effect, so the second word is both underlined and reversed.

image

Originally created by @j4james on GitHub (Apr 13, 2020). # Environment Windows build number: Version 10.0.18362.657 Windows Terminal version (if applicable): Commit ea1bb2ed9359fcc6ded32ad11a8cab544b91ae0e # Steps to reproduce From a bash shell in conhost, execute the following command: printf "\e[0;7mReverse\e[0;4mUnderline\e[m\n" # Expected behavior It should display the first word with reversed video, and the second word underlined. For example, here's what it looks like in mintty: ![image](https://user-images.githubusercontent.com/4181424/79155064-7cdcd580-7dc8-11ea-9ab4-a8a6a919b3d5.png) # Actual behavior The `SGR 0` in the second sequence doesn't take effect, so the second word is both underlined and reversed. ![image](https://user-images.githubusercontent.com/4181424/79155101-89612e00-7dc8-11ea-9799-42defc72c26f.png)
Author
Owner

@j4james commented on GitHub (Apr 13, 2020):

I should mention that I'm currently experimenting with a refactor of the SGR code, based on a discussion we had in PR https://github.com/microsoft/terminal/pull/3160#discussion_r341249386. That refactoring actually fixes this bug (which is how I discovered it in the first place), but it's still a work in progress, and may be in that state for a while. However, if there is an urgent need for this to be fixed I can probably put together a simpler PR targetting just this bug.

@j4james commented on GitHub (Apr 13, 2020): I should mention that I'm currently experimenting with a refactor of the SGR code, based on a discussion we had in PR https://github.com/microsoft/terminal/pull/3160#discussion_r341249386. That refactoring actually fixes this bug (which is how I discovered it in the first place), but it's still a work in progress, and may be in that state for a while. However, if there is an urgent need for this to be fixed I can probably put together a simpler PR targetting just this bug.
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 14, 2020):

No need for a rush fix on this one. I'll yank the triage tag off (and leave it in 21H1). Thanks for being our VT champion!

@DHowett-MSFT commented on GitHub (Apr 14, 2020): No need for a rush fix on this one. I'll yank the triage tag off (and leave it in 21H1). Thanks for being our VT champion!
Author
Owner

@ghost commented on GitHub (Jun 18, 2020):

:tada:This issue was addressed in #5758, which has now been successfully released as Windows Terminal Preview v1.1.1671.0.🎉

Handy links:

@ghost commented on GitHub (Jun 18, 2020): :tada:This issue was addressed in #5758, which has now been successfully released as `Windows Terminal Preview v1.1.1671.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.1.1671.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7398